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

Block requests with type "beacon" or "ping" #311

Merged
merged 11 commits into from Sep 27, 2018
Merged

Conversation

MariagraziaAlastra
Copy link
Member

@MariagraziaAlastra MariagraziaAlastra commented Sep 25, 2018

Reviewer: @dharb

Description:

Beacon and ping type requests are slipping through currently, because they're not included in the list of resource types we recognize and block.
However, adding "beacon" to the list errors on Chrome, while "ping" doesn't seem to block anything in Firefox.
With this change we'll add either beacon or ping on extension install/update depending on the browser.
Also add "beacon" as a reason for blocking these requests.

Steps to test this PR:

  1. build and reload extension
  2. check both firefox and chrome.
  3. visit a site that uses beacons (google, youtube, amazon etc) and disable privacy protection
  4. in the network tab you should be able to see the beacons loading (usually you can filter by "analytics" to make them show up)
  5. enable privacy protection; now the beacon requests should be blocked
  6. also run unit tests

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

Copy link
Contributor

@russellholt russellholt left a comment

Choose a reason for hiding this comment

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

Looks good; suggested simplification.

shared/js/background/trackers.es6.js Outdated Show resolved Hide resolved
shared/js/background/trackers.es6.js Outdated Show resolved Hide resolved
Copy link
Contributor

@dharb dharb left a comment

Choose a reason for hiding this comment

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

Nice work @MariagraziaAlastra ! This looks great.

At some point we should build some new unit tests for trackers.es6 (and maybe make that isTracker function a little more testable) so that we can better test things like trackersByParentCompany.reason. I don't think here is the place or time to do that though.

@dharb dharb merged commit 049bfac into develop Sep 27, 2018
@dharb dharb deleted the maria/block-beacon branch September 27, 2018 15:56
@MariagraziaAlastra MariagraziaAlastra mentioned this pull request Sep 27, 2018
12 tasks
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

4 participants