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

Avoid blocking ServiceWorker initiated requests for Chrome MV3 #1544

Merged
merged 1 commit into from
Nov 18, 2022

Conversation

kzar
Copy link
Collaborator

@kzar kzar commented Nov 17, 2022

We already avoid blocking ServiceWorker initiated requests in the MV2
extension, since each time we enabled the blocking of those we saw
major website breakage. In the future, we'd like to start blocking
those requests again, but we'll have to do so carefully.

Anyway, it's important that request blocking is consistent between MV2
and MV3 builds of the extension. So for now, let's also avoid blocking
ServiceWorker initiated requests for Chrome MV3 builds too.

Note: The way we do this, is to ignore requests with a tabId of
-1 (aka requests not associated with a tab). This could also
lead to other requests being ignored, but since that's
consistent with the MV2 code-path[1] it seems the right approach.

1 -

Reviewer: @jdorweiler

Steps to test this PR:

  1. Navigate to https://privacy-test-pages.glitch.me/privacy-protections/request-blocking and ensure ServiceWorker initiated requests aren't blocked, but other requests still are.
  2. Smoke test that tracker blocking is still working generally.
  3. Ensure the integration and unit tests are passing.

Automated tests:

  • Unit tests
  • Integration tests
Reviewer Checklist:
  • Ensure the PR solves the problem
  • Review every line of code
  • Ensure the PR does no harm by testing the changes thoroughly
  • Get help if you're uncomfortable with any of the above!
  • Determine if there are any quick wins that improve the implementation
PR Author Checklist:
  • Get advice or leverage existing code
  • Agree on technical approach with reviewer (if the changes are nuanced)
  • Ensure that there is a testing strategy (and documented non-automated tests)
  • Ensure there is a documented monitoring strategy (if necessary)
  • Consider systems implications

@kzar kzar requested a review from jdorweiler November 17, 2022 17:27
@kzar kzar marked this pull request as draft November 17, 2022 17:37
We already avoid blocking ServiceWorker initiated requests in the MV2
extension, since each time we enabled the blocking of those we saw
major website breakage. In the future, we'd like to start blocking
those requests again, but we'll have to do so carefully.

Anyway, it's important that request blocking is consistent between MV2
and MV3 builds of the extension. So for now, let's also avoid blocking
ServiceWorker initiated requests for Chrome MV3 builds too.

Note: The way we do this, is to ignore requests with a tabId of
      -1 (aka requests not associated with a tab). This could also
      lead to other requests being ignored, but since that's
      consistent with the MV2 code-path[1] it seems the right approach.

1 - https://github.com/duckduckgo/duckduckgo-privacy-extension/blob/92222c85b04894a7f411cd844e2612b7a7d7c923/shared/js/background/before-request.es6.js#L85
@kzar kzar marked this pull request as ready for review November 18, 2022 12:59
@jdorweiler jdorweiler self-requested a review November 18, 2022 15:52
@kzar kzar merged commit b21a7ce into duckduckgo:develop Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants