iOS 17.4.1 Safari extension issues

Since updating to iOS v17.4.1 our safari extension no longer functions as it used to We are experiencing issues where our content script is not getting initialized, On devices running iOS 17.4.1, the content script included in our extension does not appear to run. There are no logs from the content script in the console, whereas on other versions and devices, it operates as expected. Our Extension relies con communication between the background and content scripts in order for us to render various popups to our users, based on our logs as of iOS 17.4.1 this communication is not successful, we can see messages being sent from the background script but as mentioned above nothing on the content script side.

This behavior happens majority of the time and on random sites, sometimes opening the same site in a new tab would work but not always. There are also times where we would only receive our popups after opening the safari menu and interacting with our extension via this menu.

Please assist with a way forward

We believe that this issue is resolved in iOS 17.5, please test against the latest developer seed to see if your extension still experiences this issue. If it does, please let us know using http://feedbackassistant.apple.com/ and share the Feedback ID here.

I have tested on the ios 17.5 beta version and we are still experiencing issues.

Here is the feedback id: FB13744621.

Here is the issue we are now facing on the 17.5 beta version. Based on our logs, what we seeing is that the content scripts are being loaded on this beta version but an issue we now seeing is that most of the time our background scripts are only getting run once we interact with our extension via the safari menu. An example of this is, our extension when landing on certain sites and the tab gets loaded we send a message from the background script to the content script to load our popups, what is happening on this version is that even though the tab has completed loading our popup wont appear until we open the safari menu and interact with our extension, as soon as we interact with the safari menu our popups get loaded and we can see the logs from our background script. This functionality used to work as expected on iOS versions prior to 17.4.1

Thank you for filing this feedback!

Is it possible to include a sample extension in the feedback that reproduces this issue + steps to reproduce using that extension?

What do you mean by the Safari menu here?

Good day, I've attached more information as well as a couple of screen recordings to the feedback ticket - FB13744621. I've also added a link to the current production version of our extension. Please review and let me know if there is anything else you need.

By safari menu, I am referring to the menu that opens up when we click on AA, which gives us options to manage our extensions as well as other options.

Thank you for your time and I look forward to your response

I'm experiencing the same issue. The background script only loads once or twice on iOS 17.5 beta 1, 2, and 3, whereas it works as expected on iOS 17.4.1.

My app doesn't include a content script, only a background script. To resolve the issue, I have to force quit Safari and relaunch it. Additionally, I attempted to create a new Safari extension project. In the background script, I added a listener to webNavigation.onBeforeNavigate, but it only triggers once or twice and then stops working. To get it to trigger again, I need to tap the 'aA' menu and then tap the extension popup menu, but it still only functions sporadically.

Feedback id: FB13735437

Good Day, Is there any update on this? FB13744621.

Looking forward to your response.

Good day, Is there any update on this issue? FB13744621.

Thanks.

Hello, I am on the latest iOS 17.5 beta, still having issues with my extension.

In the latest iOS build, Safari Mobile Extensions behave differently, with more aggressive freezing of background processes. Previously, these processes would suspend after 30 seconds of browser or user inactivity, but now they suspend even more quickly and sometimes fail to wake up when expected. Events that should trigger a wake-up, like webNavigation.onCommitted or tabs.onUpdated, often fail to do so, although clicking an extension button to open a Popup window does wake up the process. However, external events like messages from content scripts can still wake up the background process. Overall, it seems that the background process is unexpectedly suspended and fails to wake up as expected in many cases.

We are also experiencing this issue, and upgrading to 17.5 does not appear to solve the problem.

We are also experiencing the same issue after upgrading to iOS 17.5. We are using browser.webNavigation.onBeforeNavigate.addListener in background-script (having "persistent": false"), but the listener is not getting called on navigation, instead getting called only when we interect with location-bar field after navigation. However same code was working in last earlier versions without any issue.

Feedback id: FB13803993

Just updated to iOS 17.5.1, the issues still persists. Would be great to get some communication from Apple on this:

Is this expected behavior or a bug????

I am experiencing the same issue. Commenting so I will stay in the loop

I'm almost certainly experiencing a similar issue that I've documented with a minimum-reproducible example that you can find in this forum post.

It would be great to get some feedback from Apple on this issue, as it has had a very significant impact on our extension.

iOS 17.4.1 Safari extension issues
 
 
Q