In iOS 18, browser.tabs.getSelected returns 'Undefined' for the Safari iOS App Extension

I was able to obtain the URL in iOS 17+ and lower versions by using the browser.tabs.getSelected method in background.js, and it was successful.

I upgraded to iOS 18 and now this function is returning 'Undefined'. As a result, the Safari Extension feature is broken.

Is this browser.tabs.getSelected no longer available or deprecated as of iOS 18?

As an alternative, browser.tabs.query functions. is a useful substitute for that.

I believe this might be due to the service worker going inert. Known bug since 17.5, sadly. Search the forums for others with the same issue.

@Ram_Mohan The tabs.getSelected issue has been fixed, thanks for letting us know!

@thianphat The background content issue has also been fixed in the 17.6.1 update, and is unrelated to the tabs.getSelected issue.

Now tabs.getSelected is working. But it returns undefined. Please verify the screenshot.

In iOS 18, browser.tabs.getSelected returns 'Undefined' for the Safari iOS App Extension
 
 
Q