2020-07-05 19:24:04 +02:00
|
|
|
! Title: Static Filtering Parser Checklist
|
|
|
|
! Homepage: https://github.com/gorhill/uBlock
|
|
|
|
! Licence: https://github.com/gorhill/uBlock/blob/master/LICENSE.txt
|
|
|
|
!
|
|
|
|
! Description:
|
|
|
|
! To verify that the static filtering parser is properly parsing valid and
|
|
|
|
! invalid cases, by typically adding the list to uBO, disabling the list,
|
|
|
|
! and viewing it in uBO's asset viewer.
|
|
|
|
!
|
|
|
|
! Feel free to add more entries to more throughly validate the static
|
|
|
|
! filtering parser, submit the changes in your fork of uBO by opening an
|
|
|
|
! issue at https://github.com/uBlockOrigin/uBlock-issues/issues
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!-----------------------
|
|
|
|
! Parsing should succeed
|
|
|
|
!-----------------------
|
2020-07-17 16:16:40 +02:00
|
|
|
|
|
|
|
! valid patterns
|
|
|
|
a*
|
|
|
|
|*
|
|
|
|
||*
|
|
|
|
|
|
|
|
! valid options
|
2020-07-05 19:24:04 +02:00
|
|
|
$script,redirect=noop.js
|
|
|
|
*$empty
|
|
|
|
*$xhr,empty
|
|
|
|
*$redirect=empty
|
|
|
|
*$xhr,redirect=empty
|
|
|
|
|
2020-07-05 20:11:15 +02:00
|
|
|
*$csp=default-src 'none'
|
|
|
|
|
2020-07-12 16:39:57 +02:00
|
|
|
*$all,~document
|
|
|
|
*$all,~popup
|
|
|
|
*$all,~inline-script
|
|
|
|
*$all,~inline-font
|
2020-07-05 19:24:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
!--------------------
|
|
|
|
! Parsing should fail
|
|
|
|
!--------------------
|
|
|
|
|
2020-07-17 16:16:40 +02:00
|
|
|
! bad patterns
|
|
|
|
a
|
|
|
|
|
|
|
|
|
||
|
|
|
|
$
|
|
|
|
|
|
|
|
! bad regex
|
|
|
|
/(abc|def/$xhr
|
|
|
|
|
2020-07-05 19:24:04 +02:00
|
|
|
! can't redirect without type (except to `empty`)
|
|
|
|
*$redirect=noop.js
|
|
|
|
|
|
|
|
! can't redirect beacon, ping, websocket
|
|
|
|
*$beacon,redirect-rule=empty
|
|
|
|
*$ping,redirect-rule=empty
|
|
|
|
*$websocket,redirect-rule=empty
|
|
|
|
|
|
|
|
! can't mix csp with other types or redirect directives
|
|
|
|
*$csp=default-src 'none',empty
|
|
|
|
*$csp=default-src 'none',redirect=empty
|
2020-07-05 20:11:15 +02:00
|
|
|
*$redirect=empty,csp=default-src 'none'
|
2020-07-05 19:24:04 +02:00
|
|
|
*$csp=default-src 'none',xhr
|
2020-07-05 20:11:15 +02:00
|
|
|
*$csp=default-src 'none',ghide
|
|
|
|
*$csp=default-src 'none',csp=script-src 'none'
|
|
|
|
|
2020-07-12 16:39:57 +02:00
|
|
|
! https://github.com/gorhill/uBlock/issues/2385#issuecomment-494078763
|
|
|
|
*$~document
|
|
|
|
*$~popup
|
|
|
|
*$~inline-script
|
|
|
|
*$~inline-font
|