Fix Chrome MV3 blocking, add proxy detection, switch to per-site permissions#6
Open
adriaandotcom wants to merge 1 commit intomainfrom
Open
Fix Chrome MV3 blocking, add proxy detection, switch to per-site permissions#6adriaandotcom wants to merge 1 commit intomainfrom
adriaandotcom wants to merge 1 commit intomainfrom
Conversation
Recent Chrome MV3 versions expose a `browser` global alias, which caused `IS_FIREFOX` to incorrectly evaluate to `true` in Chrome. The extension then tried to register a blocking `chrome.webRequest.onBeforeRequest` listener that doesn't exist in the Chrome MV3 manifest, throwing "Cannot read properties of undefined (reading 'onBeforeRequest')". Switch to feature-detecting `declarativeNetRequest` vs. blocking `webRequest` so Chrome uses dynamic rules and Firefox keeps using webRequest. Also guard `updateListeners` against a missing `chrome.webRequest.onBeforeRequest` as a defensive fallback.
Maimunar
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #5
IS_FIREFOXdetection no longer trips on Chrome's newbrowserglobal; Chrome stays on thedeclarativeNetRequestpath.*/simple.gifbeacons (viaperformance.getEntriesByType) and same-origin.jsproxy scripts (via/* Simple Analyticsbody signature). Added"image"to DNR resource types.timesBlockednever worked reliably under DNR; all related code and UI copy is gone.host_permissions: ["<all_urls>"]→optional_host_permissions: ["*://*/*"]. No more "on all sites" warning; users grant access per site.pendingBlockintent and a newchrome.permissions.onAddedlistener in the background finishes detection + storage + icon refresh. First-click Block now works.[object Object]), dedup + empty-filter guards,storage.onChangedis the single source of truth (killed a rule-id race), non-blocklistkeys no longer crash the listener.No tab with iderrors.1.8→1.9.Security implications
Testing
Locally in Google Chrome.
Test plan
*/simple.gif+ detected proxy.jsblocked.Checklist