NEW298123
dNR: dynamic rules apply to extensions
https://bugs.webkit.org/show_bug.cgi?id=298123
Summary dNR: dynamic rules apply to extensions
rhill
Reported 2025-08-29 14:38:47 PDT
Created attachment 476562 [details] Minimal MV3 extension Steps to reproduce: Install one or more extensions from the App store. Examples: - uBlock Origin Lite: https://apps.apple.com/us/app/ublock-origin-lite/id6745342698 - Ghostery: https://apps.apple.com/us/app/ghostery-privacy-ad-blocker/id6504861501 Install the attached minimal extension as temporary extension. It will dynamically add the following DNR rule: { "id": 1, "action": { "type": "block" }, "condition": { "urlFilter": ".css" } } First, visit a simple webpage: - https://news.ycombinator.com Result: un-styled content, expected. Next, open the popup panel of one of the previously installed extension from the App store. Result: popup panels render with un-style content, possibly unusable as a result. I tried to reproduce the issue using static ruleset with the same dynamic rule causing issue, and I could not reproduce, so unless I erred in my test, the issue occurs only with dynamic rules. I stumbled on this issue while trying to investigate an issue on the iPad. uBlock Origin Lite offers the ability to manually enter DNR rules, and upon entering a broadly blocking rule as the one above (which would block all secondary resources, not just `css`), this issue caused the extension to brick itself, and also break all other extensions installed. Since the extension was now virtually bricked, there was no way to remove the offending rules since the user interface would not come up, as the background process was also broken. Unexpectedly, uninstalling the extension, force closing the browser, shutting down the device, re-opening the browser then re-installing the extension did not solve the issue -- it appears extension storage is not removed when an extension is uninstalled -- this is another issue unveiled while investigating the issue here. The only recourse was to access the background page with dev tools, then manually removing the problematic DNR rule using the console.
Attachments
Minimal MV3 extension (1.71 KB, application/zip)
2025-08-29 14:38 PDT, rhill
no flags
Radar WebKit Bug Importer
Comment 1 2025-08-29 14:38:55 PDT
Jeff Johnson
Comment 2 2025-08-30 11:56:38 PDT
I can reproduce the issue on macOS. In my testing, simply disabling the extension in Safari Extension Settings should disable the DNR rule and stop it from breaking everything. I believe that if you uninstall an extension, Safari does eventually purge the extension's storage after a period of time, but not right away.
Note You need to log in before you can comment on or make changes to this bug.