Hi everyone,
I’m encountering a serious reliability issue with message passing in my Safari extension on iOS 18.4.1 and iOS 18.5
In my extension, I use the standard messaging API where the background script sends a message to the content scrip. The content script is listening using:
browser.runtime.onMessage.addListener(handler);
This setup has been working reliably in previous versions of iOS, but since updating to iOS 18.4.1 and iOS 18.5, I’ve noticed that messages sent from the background script are not consistently received by the content script. From my logs, I can confirm that:
The background script is sending the message.
The content script’s listener is not always triggered.
There are no errors or exceptions logged in either script.
It seems as if browser.runtime.onMessage.addListener is either not getting registered in time or failing silently in some instances.
This issue is intermittent and does not occur all the time.
Has anyone else experienced similar issues in iOS 18.4.1 and 18.5? Are there any known changes or workarounds for ensuring reliable communication between background and content scripts in this version?
Any help or insights would be greatly appreciated.
Thanks!