[go: nahoru, domu]

Skip to content

Commit

Permalink
Fix improper rejecting fitlers with $all,~document options
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jul 12, 2020
1 parent 1a9ad29 commit 2eec285
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
11 changes: 10 additions & 1 deletion docs/tests/static-filtering-parser-checklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ $script,redirect=noop.js

*$csp=default-src 'none'


*$all,~document
*$all,~popup
*$all,~inline-script
*$all,~inline-font


!--------------------
Expand All @@ -50,3 +53,9 @@ $script,redirect=noop.js

! bad regex
/(abc|def/$xhr

! https://github.com/gorhill/uBlock/issues/2385#issuecomment-494078763
*$~document
*$~popup
*$~inline-script
*$~inline-font
10 changes: 5 additions & 5 deletions src/js/static-filtering-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2011,8 +2011,8 @@ const netOptionTokens = new Map([
[ 'css', OPTTokenCss | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
[ 'stylesheet', OPTTokenCss | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
[ 'denyallow', OPTTokenDenyAllow | OPTMustAssign | OPTDomainList ],
[ 'doc', OPTTokenDoc | OPTType | OPTNetworkType ],
[ 'document', OPTTokenDoc | OPTType | OPTNetworkType ],
[ 'doc', OPTTokenDoc | OPTType | OPTNetworkType | OPTCanNegate ],
[ 'document', OPTTokenDoc | OPTType | OPTNetworkType | OPTCanNegate ],
[ 'domain', OPTTokenDomain | OPTMustAssign | OPTDomainList ],
[ 'ehide', OPTTokenEhide | OPTType ],
[ 'elemhide', OPTTokenEhide | OPTType ],
Expand All @@ -2025,8 +2025,8 @@ const netOptionTokens = new Map([
[ 'generichide', OPTTokenGhide | OPTType ],
[ 'image', OPTTokenImage | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
[ 'important', OPTTokenImportant | OPTBlockOnly ],
[ 'inline-font', OPTTokenInlineFont | OPTType ],
[ 'inline-script', OPTTokenInlineScript | OPTType ],
[ 'inline-font', OPTTokenInlineFont | OPTType | OPTCanNegate ],
[ 'inline-script', OPTTokenInlineScript | OPTType | OPTCanNegate ],
[ 'media', OPTTokenMedia | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
[ 'mp4', OPTTokenMp4 | OPTType | OPTNetworkType | OPTBlockOnly | OPTRedirectType | OPTRedirectableType ],
[ 'object', OPTTokenObject | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
Expand All @@ -2035,7 +2035,7 @@ const netOptionTokens = new Map([
[ 'ping', OPTTokenPing | OPTCanNegate | OPTType | OPTNetworkType ],
[ 'beacon', OPTTokenPing | OPTCanNegate | OPTType | OPTNetworkType ],
[ 'popunder', OPTTokenPopunder | OPTType ],
[ 'popup', OPTTokenPopup | OPTType ],
[ 'popup', OPTTokenPopup | OPTType | OPTCanNegate ],
[ 'redirect', OPTTokenRedirect | OPTMustAssign | OPTBlockOnly | OPTRedirectType ],
[ 'redirect-rule', OPTTokenRedirectRule | OPTMustAssign | OPTBlockOnly | OPTRedirectType ],
[ 'script', OPTTokenScript | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
Expand Down

0 comments on commit 2eec285

Please sign in to comment.