Created attachment 470407 [details] Safari Develop menu with Extension Background Content and example.org I believe this issue started with iOS 17.4 and iPadOS 17.4. It worked as expected before. I can reproduce on both my iPhone and iPad. Steps to reproduce: 1) Connect iOS device to Mac 2) In mobile Safari, open https://webkit.org 3) In desktop Safari, select the iOS device in the Develop menu 4) Select webkit.org to open the web inspector 5) Close the web inspector 6) In mobile Safari, close the window 7) Open a new window, and open example.org 8) In desktop Safari, select the iOS device in the Develop menu Expected results: example.org appears in the menu Actual results: example org does not appear in the menu See the attached screenshots. You have to force quit mobile Safari in order to see a new window in the web inspector. There are other variations of the issue. For example, in step 2, open two windows, one with webkit.org and the other example.org. But the Develop menu will only show the first website, not the second. I believe the issue depends on the iOS version and not the macOS or desktop Safari version. I was able to reproduce with two Macs, including both Sonoma and Ventura, as well as both desktop Safari 17.4 and 17.2.
Created attachment 470408 [details] Safari Develop menu with just Extension Background Content
<rdar://problem/124876362>
I can reproduce this. Opening Web Inspector on macOS doesn't seem to be related. Additional inspectable pages from tabs in Safari on iOS don't show up for the device in the Develop menu after the first one (unless they're picked from the list of previously open tabs after force-quitting mobile Safari). Inconsistently, pages that were previously opened (available in cache?) did show up in the list. Updated steps steps to reproduce: 1) Connect iOS device to Mac 2) In mobile Safari, open https://webkit.org 3) In desktop Safari, select the iOS device in the Develop menu and observe the list of available inspectable pages 4) In mobile Safari, open a few tabs with various other websites Expected result: All open tabs in mobile Safari show up in the Develop menu. Thank you for filing! Investigating.
The issue turned out to be in Safari on the mobile device side. It is indeed a regression since iOS 17.4 A fix was made in a repository that's not public. I'll update and close this Bugzilla issue when a version of iOS / iPadOS with the fixed Safari is publicly available. (A Safari Technology Preview update on Mac can't fix it) The underlying issue is with tabs in Safari on iOS being incorrectly marked as not inspectable depending on the URL loading strategy. That's why the issue seems flaky. To reproduce consistently, attempt to open a URL that was never opened before in Safari on the device (something that doesn't autocomplete as you type in the address bar). It's easiest to reproduce if you "Clear History and Website Data" in Safari Settings on iOS. A workaround is to open the same URL in another tab after the first one. This second tab will show up for inspection in Safari's Develop menu on the Mac. Thank you for filing this and for your patience.