1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-01 08:39:37 +02:00
uBlock/docs/tests/static-filtering-parser-checklist.txt
Raymond Hill dc64cfbd97
Fix properly reporting invalid filter options
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1134

Specifically;

- `beacon`, `ping`, and `websocket` cannot be redirected;
- it's ok to not specify a type when redirecting to `empty`
  resource;
- `csp=` option can't be mixed with other types, redirec
  directives, and more `csp=` options.
2020-07-05 14:11:15 -04:00

53 lines
1.3 KiB
Plaintext

! 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
!-----------------------
$script,redirect=noop.js
*$empty
*$xhr,empty
*$redirect=empty
*$xhr,redirect=empty
*$csp=default-src 'none'
!--------------------
! Parsing should fail
!--------------------
! 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
*$redirect=empty,csp=default-src 'none'
*$csp=default-src 'none',xhr
*$csp=default-src 'none',ghide
*$csp=default-src 'none',csp=script-src 'none'
! bad regex
/(abc|def/$xhr