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 doc comments for cosmetic filter structs/methods #61

Merged
merged 2 commits into from Jan 2, 2020

Conversation

@antonok-edm
Copy link
Collaborator

antonok-edm commented Dec 12, 2019

As per brave/brave-core#3303 (comment) I wanted to make sure it's very clear how the cosmetic filtering interface is to be used.

@antonok-edm antonok-edm requested a review from AndriusA Dec 12, 2019
@antonok-edm antonok-edm self-assigned this Dec 12, 2019
@antonok-edm antonok-edm mentioned this pull request Dec 12, 2019
11 of 32 tasks complete
@antonok-edm antonok-edm force-pushed the extra-cosmetic-filter-docs branch from 9dc3682 to 7e10975 Dec 16, 2019
@reeveyoung

This comment has been minimized.

Copy link

reeveyoung commented on 7e10975 Dec 19, 2019

Could you give an example how to pass output from hostname_cosmetic_resources() to class_id_stylesheet()?

@antonok-edm
Copy link
Collaborator Author

antonok-edm commented Dec 19, 2019

Should be as simple as this:

let resources = engine.hostname_cosmetic_resources("github.com");

let stylesheet = engine.class_id_stylesheet(&["new_class1", "new_class2"], &["new_id1"], resources.exceptions.clone());

I'm noticing now that the signature for Engine::hostname_cosmetic_resources should just be updated to take exceptions by reference instead of by value. Once that's done, you'll even be able to remove the .clone() call.

let resources = engine.hostname_cosmetic_resources("github.com");

let stylesheet = engine.class_id_stylesheet(&["new_class1", "new_class2"], &["new_id1"], &resources.exceptions);
@AndriusA AndriusA merged commit 0933635 into master Jan 2, 2020
0 of 4 checks passed
0 of 4 checks passed
Travis CI - Branch Build Errored
Details
Travis CI - Pull Request Build Errored
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
@AndriusA AndriusA deleted the extra-cosmetic-filter-docs branch Jan 2, 2020
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.

None yet

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