Fix improper rejecting fitlers with `$all,~document` options

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1134#issuecomment-657122472
This commit is contained in:
Raymond Hill 2020-07-12 10:39:57 -04:00
parent 1a9ad29503
commit 2eec28520f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 15 additions and 6 deletions

View File

@ -25,7 +25,10 @@ $script,redirect=noop.js
*$csp=default-src 'none' *$csp=default-src 'none'
*$all,~document
*$all,~popup
*$all,~inline-script
*$all,~inline-font
!-------------------- !--------------------
@ -50,3 +53,9 @@ $script,redirect=noop.js
! bad regex ! bad regex
/(abc|def/$xhr /(abc|def/$xhr
! https://github.com/gorhill/uBlock/issues/2385#issuecomment-494078763
*$~document
*$~popup
*$~inline-script
*$~inline-font

View File

@ -2011,8 +2011,8 @@ const netOptionTokens = new Map([
[ 'css', OPTTokenCss | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ], [ 'css', OPTTokenCss | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
[ 'stylesheet', OPTTokenCss | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ], [ 'stylesheet', OPTTokenCss | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
[ 'denyallow', OPTTokenDenyAllow | OPTMustAssign | OPTDomainList ], [ 'denyallow', OPTTokenDenyAllow | OPTMustAssign | OPTDomainList ],
[ 'doc', OPTTokenDoc | OPTType | OPTNetworkType ], [ 'doc', OPTTokenDoc | OPTType | OPTNetworkType | OPTCanNegate ],
[ 'document', OPTTokenDoc | OPTType | OPTNetworkType ], [ 'document', OPTTokenDoc | OPTType | OPTNetworkType | OPTCanNegate ],
[ 'domain', OPTTokenDomain | OPTMustAssign | OPTDomainList ], [ 'domain', OPTTokenDomain | OPTMustAssign | OPTDomainList ],
[ 'ehide', OPTTokenEhide | OPTType ], [ 'ehide', OPTTokenEhide | OPTType ],
[ 'elemhide', OPTTokenEhide | OPTType ], [ 'elemhide', OPTTokenEhide | OPTType ],
@ -2025,8 +2025,8 @@ const netOptionTokens = new Map([
[ 'generichide', OPTTokenGhide | OPTType ], [ 'generichide', OPTTokenGhide | OPTType ],
[ 'image', OPTTokenImage | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ], [ 'image', OPTTokenImage | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
[ 'important', OPTTokenImportant | OPTBlockOnly ], [ 'important', OPTTokenImportant | OPTBlockOnly ],
[ 'inline-font', OPTTokenInlineFont | OPTType ], [ 'inline-font', OPTTokenInlineFont | OPTType | OPTCanNegate ],
[ 'inline-script', OPTTokenInlineScript | OPTType ], [ 'inline-script', OPTTokenInlineScript | OPTType | OPTCanNegate ],
[ 'media', OPTTokenMedia | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ], [ 'media', OPTTokenMedia | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
[ 'mp4', OPTTokenMp4 | OPTType | OPTNetworkType | OPTBlockOnly | OPTRedirectType | OPTRedirectableType ], [ 'mp4', OPTTokenMp4 | OPTType | OPTNetworkType | OPTBlockOnly | OPTRedirectType | OPTRedirectableType ],
[ 'object', OPTTokenObject | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ], [ 'object', OPTTokenObject | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],
@ -2035,7 +2035,7 @@ const netOptionTokens = new Map([
[ 'ping', OPTTokenPing | OPTCanNegate | OPTType | OPTNetworkType ], [ 'ping', OPTTokenPing | OPTCanNegate | OPTType | OPTNetworkType ],
[ 'beacon', OPTTokenPing | OPTCanNegate | OPTType | OPTNetworkType ], [ 'beacon', OPTTokenPing | OPTCanNegate | OPTType | OPTNetworkType ],
[ 'popunder', OPTTokenPopunder | OPTType ], [ 'popunder', OPTTokenPopunder | OPTType ],
[ 'popup', OPTTokenPopup | OPTType ], [ 'popup', OPTTokenPopup | OPTType | OPTCanNegate ],
[ 'redirect', OPTTokenRedirect | OPTMustAssign | OPTBlockOnly | OPTRedirectType ], [ 'redirect', OPTTokenRedirect | OPTMustAssign | OPTBlockOnly | OPTRedirectType ],
[ 'redirect-rule', OPTTokenRedirectRule | OPTMustAssign | OPTBlockOnly | OPTRedirectType ], [ 'redirect-rule', OPTTokenRedirectRule | OPTMustAssign | OPTBlockOnly | OPTRedirectType ],
[ 'script', OPTTokenScript | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ], [ 'script', OPTTokenScript | OPTCanNegate | OPTType | OPTNetworkType | OPTRedirectableType ],