Created attachment 470653 [details] Sample Xcode project Steps to reproduce: 1. Run the attached sample Safari extension Xcode project PreviewBug 2. Enable PreviewBug in Safari 3. Open https://example.org 4. Press down the More Information link and show the preview Expected results: You see a window alert saying "content script" Actual results: No window alert This bug occurs on device with iOS 17.4.1 and in the iOS 17.4 Xcode simulator. It does not occur on device in earlier version of iOS or in the iOS 17.2 simulator. For some reason, there's no iOS 17.3 simulator available for download, so I couldn't test when exactly the bug was introduced. In the sample project, the extension content script calls setTimeout(() => { alert("content script"); }, 2000); As you can see, unlike the content script, the extension style sheet does get injected: * { background-color: red !important; } This bug breaks my Safari extension in the App Store. For example, it breaks the feature that stops videos from autoplaying. I was alerted to the issue by a customer who previews links before opening them in a new tab. Incidentally, it was difficult to debug this issue, because the link preview web context doesn't appear in the Safari Developer menu, which is why I had to use the primitive window alert method of debugging.
<rdar://problem/125589211>
Created attachment 470665 [details] Working
I am seeing the content script alert on 17.4.1 (21E237).
I was able to reproduce on 21E237 after all.
This has been resolved in Safari.