Tab onDetached and Tab onAttached web extension events are no longer generated in macOS 15.4 / Safari 18.4

Hello - we have a Mac application that uses a browser extension and the web extension JS APIs to communicate with Safari. As of macOS 15.4 / Safari 18.4 the tab OnAttached and tab onDetached events are no longer received.

After some testing we verified that the events were working properly as of macOS 15.3 / Safari 18.3 but appear to have been broken in macOS 15.4. Note a similar issue was reported previously for Safari 17.6 and was fixed in macOS 15.0 (FB14324177).

We have made a TestFlight version of our app (Tabby) available to simplify debugging via https://testflight.apple.com/join/Va8Zdv9d.

To reproduce the issue:

  1. Install the Tabby TestFlight build on macOS 15.4 or 15.4.1
  2. Open Safari, go to Safari settings and select the Extensions tab
  3. Enable the Tabby extension and grant permissions to all windows all the time
  4. Open a Safari window with at least 3 tabs
  5. Note the open window and tabs displayed in Tabby
  6. In Safari, perform a tab detach by dragging a tab out of the window

Expected behavior Within Safari the detached tab should now be in it’s own window, and via the onDetached event Tabby should update to show the tab in it’s own window AND removed from the original window.

Observed Safari fails to send the onDetached event and Tabby will continue to display the detached tab in its original window in addition to the new window.

You can also use the repro steps above to observe the onDetached event being received or not by Tabby in the Safari developer console. The same steps but re-attaching the tab to the original window can be used to observe the onAttached event being received or not.

We’ve attached two screen recordings to the Feedback ID below, one showing the events working on macOS 15.3, and one showing the events failing to be received on macOS 15.4.1. Note it also fails on macOS 15.4.

FEEDBACK ID: FB17367977

Answered by DTS Engineer in 839489022

Thank you for filing a bug report. I verified your bug report has been routed to the correct team and it is currently under investigation. Please continue testing your software with system software updates as they are made available.

Thank you for filing a bug report. I verified your bug report has been routed to the correct team and it is currently under investigation. Please continue testing your software with system software updates as they are made available.

Accepted Answer

After taking a look at your report, it appears that this issue is resolved in Safari 18.5/macOS 15.5. Please test using this update and let us know if you have any other concerns.

We tested on macOS 15.5/Safari 18.5 and the issue is resolved. Thanks for the fix!

Tab onDetached and Tab onAttached web extension events are no longer generated in macOS 15.4 / Safari 18.4
 
 
Q