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

Add support for ABP filter redirects as mock responses #3419

Merged
merged 4 commits into from Nov 19, 2019
Merged

Conversation

@bbondy
Copy link
Member

bbondy commented Sep 12, 2019

Fix: brave/brave-browser#6894

Unlike extensions like uBlock, we don't do this via data: URLs.
This means that the response will appear to a website as a 200 with the proper mime type, but with the content we want from the resources JSON file.

See also:
brave/internal#660
brave/adblock-rust#29
brave/adblock-rust#50
brave/adblock-rust-ffi#8
brave/brave-core-crx-packager#74

Submitter Checklist:

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.
@bbondy bbondy force-pushed the adblock-resources branch 2 times, most recently from 8315b0d to 1de6056 Sep 13, 2019
@bbondy bbondy self-assigned this Sep 18, 2019
@bbondy bbondy force-pushed the adblock-resources branch 2 times, most recently from 6dcdec8 to fa91445 Nov 5, 2019
@antonok-edm antonok-edm mentioned this pull request Nov 6, 2019
11 of 32 tasks complete
@bbondy bbondy force-pushed the adblock-resources branch 5 times, most recently from f271ca1 to fa4057a Nov 7, 2019
@bbondy bbondy requested review from jumde, pes10k and emerick Nov 12, 2019
@bbondy bbondy marked this pull request as ready for review Nov 12, 2019
@bbondy bbondy requested a review from iefremov as a code owner Nov 12, 2019
@bbondy bbondy changed the title WIP: Adblock resources support Adblock resources support Nov 12, 2019
@bbondy bbondy changed the title Adblock resources support Add support for ABP filter redirects as mock responses Nov 12, 2019
@bbondy bbondy force-pushed the adblock-resources branch from 04c6fcc to 291f124 Nov 12, 2019
Copy link
Contributor

emerick left a comment

LGTM, just mentioned a couple of nits.

@jumde jumde requested a review from fmarier Nov 12, 2019
@jumde
jumde approved these changes Nov 12, 2019
@pes10k
pes10k approved these changes Nov 12, 2019
Copy link
Contributor

pes10k left a comment

This results in less code i wrote shipping in brave-core, so thats an automatic good thing for product ;)

More seriously, terrific and fantastic :)

@bbondy bbondy force-pushed the adblock-resources branch from 291f124 to 8267ce2 Nov 13, 2019
browser/net/url_context.h Outdated Show resolved Hide resolved
@iefremov
Copy link
Contributor

iefremov commented Nov 14, 2019

LGTM in general, mostly readability and style-related comments

Copy link
Member

fmarier left a comment

Not sure whether this is the right PR for this comment, but as far as I can see from https://github.com/brave/brave-core-crx-packager/pull/74/files#diff-90ea3bb8e019a7c1cb21f2332bf78c75R13, we appear to be pulling the scriptlets directly from the uBlock origin repo.

In the security review, @diracdeltas and I manually reviewed all existing scriptlets and then asked for a Brave clone of that repo so that we could review any new ones as they get added.

@antonok-edm
Copy link
Collaborator

antonok-edm commented Nov 14, 2019

@fmarier that directory submodules/uBlock is a git submodule pulled from the Brave fork, not the upstream uBlock repo.

It looks like the URL of the uBlock git archive did end up sneaking through into that PR, but it's not used anywhere and I just filed brave/brave-core-crx-packager#75 to remove it.

Copy link
Member

fmarier left a comment

Thanks for the clarifications @antonok-edm.

@bbondy bbondy force-pushed the adblock-resources branch 2 times, most recently from 7736440 to 7434b24 Nov 18, 2019
@bbondy bbondy force-pushed the adblock-resources branch from 7434b24 to 7e2ccbc Nov 19, 2019
@bbondy bbondy merged commit 88d1bbf into master Nov 19, 2019
2 checks passed
2 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bbondy bbondy deleted the adblock-resources branch Nov 19, 2019
@bbondy bbondy added this to the 1.3.x - Nightly milestone Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.