NEW303118
DNR rules are not applied to a private window if Safari opens with a non-private window and vice versa
https://bugs.webkit.org/show_bug.cgi?id=303118
Summary DNR rules are not applied to a private window if Safari opens with a non-priv...
Jeff Johnson
Reported 2025-11-25 18:21:17 PST
Created attachment 477519 [details] Sample Xcode project demonstrating the bug Safari 26.1 on macOS 15.7.2 DeclarativeNetRequest rules are not applied to private windows if "Safari opens with: A new window" in Settings. Alternatively, they're not applied to non-private windows if "Safari opens with: A new private window" in settings. This might be the same bug, or a related bug to https://bugs.webkit.org/show_bug.cgi?id=290256 DeclarativeNetRequest rules are not applied to a new default profile window in some circumstances Steps to reproduce: 1) Open Safari General Settings 2) Safari opens with: A new window 3) Unzip, build, run, and enable the attached Safari extension DNRProfilesBug 4) Quit Safari 5) Open Safari 6) Open https://gs.statcounter.com/detect in the current window 7) Verify that the User-Agent is "My Custom User Agent" 8) Open a new private window 9) Open https://gs.statcounter.com/detect in the new private window Expected results: User-Agent is "My Custom User Agent" Actual results: User-Agent is Safari You can open the extension popup window to verify that the DeclarativeNetRequest rules are still set to customize the User-Agent, even though the rules aren't currently effective in the tab. This bug breaks my Safari extension ChangeTheHeaders: https://apps.apple.com/app/changetheheaders-for-safari/id6743129567
Attachments
Sample Xcode project demonstrating the bug (324.73 KB, application/zip)
2025-11-25 18:21 PST, Jeff Johnson
no flags
Radar WebKit Bug Importer
Comment 1 2025-11-25 18:21:24 PST
Jeff Johnson
Comment 2 2025-11-25 18:31:45 PST
I received a bug report from a customer showing that DNR rules are broken in other circumstances too, in non-private windows even when Safari opens with a non-private window. I haven't found steps to reproduce for that, but it may involve having Safari content blockers installed. I've just reported what I can reproduce.
Jeff Johnson
Comment 3 2025-11-27 12:06:30 PST
This bug is also reproducible on iPadOS 26.1
Brian Weinstein
Comment 4 2025-12-09 11:37:46 PST
Thank you for filing this Jeff! I believe this was fixed by: https://bugs.webkit.org/show_bug.cgi?id=301720 Is it possible to test with the latest Safari Technology Preview on Mac to confirm?
Jeff Johnson
Comment 5 2025-12-09 11:48:35 PST
(In reply to Brian Weinstein from comment #4) > Thank you for filing this Jeff! > > I believe this was fixed by: > https://bugs.webkit.org/show_bug.cgi?id=301720 > > Is it possible to test with the latest Safari Technology Preview on Mac to > confirm? This bug does indeed appear to be fixed in Safari Technology Preview 233. Thanks!
Note You need to log in before you can comment on or make changes to this bug.