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 1 commit
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.
work around browser-internal race condition
Occasionally, chrome.tabs.insertCSS fails when triggered from chrome.webNavigation events. It cannot work unless some page content is already loaded. See https://bugs.chromium.org/p/chromium/issues/detail?id=331654#c15
- Loading branch information
antonok-edm
committed
Aug 27, 2019
antonok-edm
Anton Lazarev
commit c45be3c54666474824e3d690d217656a5c612a14
Verified
This commit was signed with a verified signature.
GPG key ID: FBD20243E0CD9104
Learn about signing commits
| @@ -4,6 +4,7 @@ import { | ||
| removeSiteFilter, | ||
| removeAllFilters | ||
| } from '../api/cosmeticFilterAPI' | ||
| import shieldsPanelActions from '../actions/shieldsPanelActions' | ||
|
|
||
| export let rule = { | ||
| host: '', | ||
| @@ -59,6 +60,21 @@ chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => { | ||
| }) | ||
antonok-edm
Author
Collaborator
|
||
| break | ||
| } | ||
| case 'contentScriptsLoaded': { | ||
| const tab = sender.tab | ||
| if (tab === undefined) { | ||
| break | ||
| } | ||
| const tabId = tab.id | ||
| if (tabId === undefined) { | ||
| break | ||
| } | ||
| const url = tab.url | ||
| if (url === undefined) { | ||
| break | ||
| } | ||
| shieldsPanelActions.contentScriptsLoaded(tabId, url) | ||
| } | ||
| } | ||
| }) | ||
|
|
||
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.
)should be on separate line since{is separate line to(