Skip to content
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

Domain-anchored filters that can't be tokenized, are rejected #1765

Closed
laniakea64 opened this issue Jun 28, 2016 · 3 comments
Closed

Domain-anchored filters that can't be tokenized, are rejected #1765

laniakea64 opened this issue Jun 28, 2016 · 3 comments

Comments

@laniakea64
Copy link

Describe the issue

Reporting this: https://forums.informaction.com/viewtopic.php?p=83403#p83403

Valid domain-anchored filters which can't be tokenized are being rejected as invalid by uBlock Origin.

Steps for anyone to reproduce the issue

new profile

  1. under 3rd-party filters, disable all lists except "My filters" (to make it easier to see what's going on)
  2. add custom filters such as the ones listed

Expected results: the filters are accepted by uBlock Origin, but are not very efficient, because as gorhill described, they would have to be checked against every network request.

Actual results: the filters are rejected as invalid, as indicated by these console messages:

FilterContainer.compileFilter("torrent*"): invalid filter static-net-filtering.js:1995:9
FilterContainer.prototype.compileFilter() static-net-filtering.js:1995
FilterContainer.prototype.compile() static-net-filtering.js:1937
µBlock.compileFilters() storage.js:622
µBlock.getCompiledFilterList/onRawListLoaded() storage.js:503
readUserAsset/onCachedContentLoaded() assets.js:1022
exports.load/onLoaded() assets.js:174
read/prepareResult() vapi-background.js:495
runStatement/<.handleCompletion() vapi-background.js:413

FilterContainer.compileFilter("::1^"): invalid filter static-net-filtering.js:1995:9
FilterContainer.prototype.compileFilter() static-net-filtering.js:1995
FilterContainer.prototype.compile() static-net-filtering.js:1937
µBlock.compileFilters() storage.js:622
µBlock.getCompiledFilterList/onRawListLoaded() storage.js:503
readUserAsset/onCachedContentLoaded() assets.js:1022
exports.load/onLoaded() assets.js:174
read/prepareResult() vapi-background.js:495
runStatement/<.handleCompletion() vapi-background.js:413

(Workaround: specify such filters as regular expression instead)

Your settings

[mostly listed elsewhere]

new profile
about:config > xpinstall.signatures.required;false

  • Browser/version: Firefox 45.2.0
  • uBlock Origin version: self build from 2d68c8e
Your filter lists

[none]

Your custom filters (if any)
||torrent*
||::1^
@gorhill gorhill closed this as completed in 0e244d9 Jul 1, 2016
@laniakea64
Copy link
Author

@gorhill The fix for this issue has caused a regression where uBlock Origin no longer rejects truly invalid filters such as

||||skiplimite.tv/full1.php

Steps-to-reproduce:

  1. start browser with new, clean profile
  2. install uBlock Origin with this fix included, restart browser
  3. add the above filter in custom filters

This is the error message uBlock Origin without this fix would give:

FilterContainer.compileFilter("|skiplimite.tv/full1.php"): invalid filter static-net-filtering.js

(I don't know if it's reasonable for uBlock Origin to distinguish invalid filters like this from valid-but-non-tokenizable filters like in the description, so if it comes down to that, personally I'd prefer to keep the fix.)

@gorhill
Copy link
Owner

gorhill commented Jul 12, 2016

A quick opinion: the filter should probably still be valid, but not parsed as |skiplimite.tv/full1.php as is currently happening, but as ||||skiplimite.tv/full1.php. I wonder what ABP does internally with this filter.

@laniakea64
Copy link
Author

laniakea64 commented Jul 12, 2016

Not sure how to find that out for sure. But I ran it through this function and got this regex:

^[\w\-]+:\/+(?!\/)(?:[^\/]+\.)?\|\|skiplimite\.tv\/full1\.php

Will that ever match any actual URLs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants