Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mv3): blocking by observing #1181

Merged
merged 36 commits into from
Apr 4, 2023
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4dee9c6
feat(mv3): :sparkles: MV3 Manifest Migration
whizzzkid Mar 3, 2023
54e9edb
fix(mv3): :wastebasket: No longer needed
whizzzkid Mar 3, 2023
937e0f7
fix(mv3): :wrench: Corresponding MV3 Changes
whizzzkid Mar 3, 2023
2de3028
feat(mv3): :package: Adding deps
whizzzkid Mar 3, 2023
98622b7
feat(telemetry): Refactor Metrics Tracking from background service_wo…
whizzzkid Mar 13, 2023
274f7be
feat(mv3): :adhesive_bandage: Patch @protobufjs/inquire to not have eval
whizzzkid Mar 13, 2023
f5dcefd
fix(mv3): :alien: Fixing contextMenus API changes (#1177)
whizzzkid Mar 15, 2023
b05e120
fix(mv3): webpack configs (#1178)
whizzzkid Mar 23, 2023
6819356
feat(mv3): ✨ XHR to Fetch Migration (#1179)
whizzzkid Mar 23, 2023
36b7f74
Fix(mv3): Popup Was Broken (#1180)
whizzzkid Mar 23, 2023
0f99265
fix(mv3): :passport_control: Limiting permissions to chrome-extension
whizzzkid Mar 23, 2023
80dcb0d
Update add-on/src/lib/ipfs-companion.js
whizzzkid Mar 23, 2023
fc74226
fix(types): :label: Refactoring existing type declaration
whizzzkid Mar 23, 2023
4ca1cc0
fix(types): :label: Moving to new types path
whizzzkid Mar 23, 2023
9abfd6f
feat(types): :sparkles: Adding typescript support for transpilation
whizzzkid Mar 23, 2023
0c9aab4
feat(mv3): :sparkles: Adding blocking request tester
whizzzkid Mar 23, 2023
79ffc72
Merge branch 'rc/3.0-mv3' into feat/blocking-by-observing
whizzzkid Mar 24, 2023
f2c678b
fix(mv3): :adhesive_bandage: package.json
whizzzkid Mar 24, 2023
7029569
Merge branch 'rc/3.0-mv3' into feat/blocking-by-observing
whizzzkid Mar 24, 2023
bc07aa9
fix(mv3): :rotating_light: Fix Lint
whizzzkid Mar 24, 2023
abe9208
Merge branch 'rc/3.0-mv3' into feat/blocking-by-observing
whizzzkid Mar 24, 2023
9736b1e
Merge branch 'rc/3.0-mv3' into feat/blocking-by-observing
whizzzkid Mar 24, 2023
be24e8f
fix: :rotating_light: fix lint
whizzzkid Mar 24, 2023
4c3eeb3
fix(mv3): :adhesive_bandage: temp fix to build background context
whizzzkid Mar 27, 2023
7431da1
fix(mv3): :necktie: Detection Logic for MV3 world.
whizzzkid Mar 27, 2023
d8538fa
feat(mv3): :sparkles: Dynamic RegexSubstitution
whizzzkid Mar 28, 2023
dcd51df
fix(types): :arrow_up: Adding .mocharc.json to fix mocha for TS.
whizzzkid Mar 29, 2023
b2dcfeb
fix: :rotating_light: Lint Fix
whizzzkid Mar 29, 2023
27ea2c3
fix(mv3): :recycle: refactor background.service_worker
whizzzkid Mar 29, 2023
78c072a
feat(mv3): :sparkles: Passing state to BlockOrObserve
whizzzkid Mar 30, 2023
04dc26b
fix(recovery): :bug: conditional for recovery
whizzzkid Mar 30, 2023
3d76720
fix: :wastebasket: unneeded @ts-ignore
whizzzkid Apr 4, 2023
3d80737
fix: :bulb: Adding comments
whizzzkid Apr 4, 2023
66e9d9b
fix: fixing string method.
whizzzkid Apr 4, 2023
937e3d0
fix: removing extra space.
whizzzkid Apr 4, 2023
47f5335
fix: removing @ts-nocheck
whizzzkid Apr 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: 💡 Adding comments
whizzzkid committed Apr 4, 2023
commit 3d80737440ca32cf32dcf010f82274cb3c7ba21c
2 changes: 2 additions & 0 deletions add-on/src/lib/redirect-handler/blockOrObserve.ts
Original file line number Diff line number Diff line change
@@ -46,6 +46,8 @@ function constructRegexFilter ({ originUrl, redirectUrl }: redirectHandlerInput)
}

// We need to check if the browser supports the declarativeNetRequest API.
// TODO: replace with check for `Blocking` in `chrome.webRequest.OnBeforeRequestOptions`
// which is currently a bug https://bugs.chromium.org/p/chromium/issues/detail?id=1427952
export const supportsBlock = !(browser.declarativeNetRequest?.MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES === 5000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to check that the value is hardcoded to 5000? can we check that the value is defined to something instead? it should be more future proof

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a work-around for this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1427952

Let me add that as a comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My original comment here still applies. If chrome updates their value from 5000, this will fail. Do we want to have to keep an eye on their value, or can we make this check more robust?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SgtPooki can check for >=5000 they've been pretty consistent with that number. But tbh we can check of this value to be >=0 as this won't apply elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added: #1187


// If the browser supports the declarativeNetRequest API, we can block the request.