SafariExtensions icon indicating copy to clipboard operation
SafariExtensions copied to clipboard

Safari app extension message listener not called in cross-origin iframe when top frame is denied permissions

Open lapcat opened this issue 7 months ago • 0 comments

Steps to reproduce:

  1. Run the attached sample Xcode project MessageBug
  2. In Safari, allow the MessageBug extension on all websites
  3. Open https://lapcatsoftware.com/articles/2023/2/1.html
  4. In Safari Website Settings, deny the MessageBug extension on lapcatsoftware.com
  5. Reload https://lapcatsoftware.com/articles/2023/2/1.html

Here's the console log after step 3: Screenshot 2024-07-17 at 6 30 13 PM

And here's the console log after step 5: Screenshot 2024-07-17 at 6 30 35 PM

The YouTube iframe should receive a message from the native SafariExtensionHandler, but it doesn't, even though the content script runs in the iframe, and the SFSafariExtensionHandler delegate method is called, as verified by the Console log.

MessageBug.zip

lapcat avatar Jul 17 '24 23:07 lapcat