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
Implement cosmetic filtering #3303
Merged
+807
−13
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1715046
expose cosmetic filtering javascript API
antonok-edm 0b93419
adaptations of @Snuupy's MutationObserver work
Snuupy 7512da5
use cosmetic filtering api
antonok-edm c45be3c
work around browser-internal race condition
antonok-edm 3aca80f
add browser tests for cosmetic filtering
antonok-edm 5640c42
add brave://flags feature to enable cosmetic filtering
antonok-edm 6a9fa30
connect feature flag to cosmetic filtering mechanism
antonok-edm e7af497
only use MutationObserver when cosmetic filtering is enabled
antonok-edm ec80ce7
store generic rule exceptions in the Shields Panel state
antonok-edm File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
| @@ -0,0 +1,12 @@ | ||
| /* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
| * You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| #include "../../../../chrome/browser/flag_descriptions.cc" | ||
|
|
||
| namespace flag_descriptions { | ||
| const char kBraveAdblockCosmeticFilteringName[] = "Enable cosmetic filtering"; | ||
| const char kBraveAdblockCosmeticFilteringDescription[] = | ||
| "Enable support for cosmetic filtering"; | ||
| } |
| @@ -0,0 +1,16 @@ | ||
| /* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
| * You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| #ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_FLAG_DESCRIPTIONS_H_ | ||
| #define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_FLAG_DESCRIPTIONS_H_ | ||
|
|
||
| #include "../../../../chrome/browser/flag_descriptions.h" | ||
|
|
||
| namespace flag_descriptions { | ||
| extern const char kBraveAdblockCosmeticFilteringName[]; | ||
| extern const char kBraveAdblockCosmeticFilteringDescription[]; | ||
| } | ||
|
|
||
| #endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_FLAG_DESCRIPTIONS_H_ |
| @@ -0,0 +1,12 @@ | ||
| /* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
| * You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| #include "../../../../chrome/common/chrome_features.cc" | ||
|
|
||
| namespace features { | ||
| const base::Feature kBraveAdblockCosmeticFiltering{ | ||
| "BraveAdblockCosmeticFiltering", | ||
| base::FEATURE_DISABLED_BY_DEFAULT}; | ||
| } |
| @@ -0,0 +1,16 @@ | ||
| /* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
| * You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| #ifndef BRAVE_CHROMIUM_SRC_CHROME_COMMON_CHROME_FEATURES_H_ | ||
| #define BRAVE_CHROMIUM_SRC_CHROME_COMMON_CHROME_FEATURES_H_ | ||
|
|
||
| #include "../../../../chrome/common/chrome_features.h" | ||
|
|
||
| namespace features { | ||
| COMPONENT_EXPORT(CHROME_FEATURES) | ||
| extern const base::Feature kBraveAdblockCosmeticFiltering; | ||
| } | ||
|
|
||
| #endif // BRAVE_CHROMIUM_SRC_CHROME_COMMON_CHROME_FEATURES_H_ |
Oops, something went wrong.
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
you need a dep for
//chrome/commonin brave/browser/extensions/BUILD.gn