Comments (2)
Sorry, missed this.
- What do the string fields mean, and when are they not
None
?
redirect
is used as per uBO's redirect syntax. If a rule has redirect
option, this returns the body of the redirect to be injected.
exception
is Some
when the blocker matched on an exception rule. Effectively this means that there was a mach, but the request should not be blocked. It is a non-empty string if the blocker was initialized from list of rules with debugging enabled, otherwise the original string representation is discarded to reduce memory use.
filter
similarly to exception, includes string representation of the rule when there is a match and debugging is enabled. Otherwise on a match contains Some("")
error
only used to signal that there was an error in parsing the provided URLs when using the simpler check_network_urls(url, frame_url, request_type)
method
- I guess that
redirect
is set toSome(url)
when the browser should redirect the request somewhere else?
explained above
- If
matched
istrue
, does that mean that the browser should block the request?
We found that returning 200 OK
with an empty body generally causes less pages to break, so that's the default with matched
is true
, except if...
- What are
explicit_cancel
andimportant
?
... explicit_cancel
is also true, in which case the request is cancelled.
important
is used to signal that a rule with important
option matched. important
match means that exceptions should not apply and no further checking is necessary - the request should be blocked (empty body or cancelled). We keep separate instances of blocker for default lists and regional ones, so important
here is used to maintain correct behaviour between them: checking should stop instead of moving to next instance iff important
rule matched
from adblock-rust.
Thank you for the detailed answer. In #87, I've added documentation to the struct using your comment.
from adblock-rust.
Related Issues (20)
- Adding swap image support HOT 5
- Ads in all youtube videos. HOT 1
- NodeJS bindings issue
- Feature Request: Support request/response header modification
- Some Scriptlet Injections Filters [from uBlock] can/will crash Brave and not work correctly, because they are not parsed correctly in Brave's Adblocker HOT 6
- Add ublock HOT 1
- Support single-quoted argument syntax
- How to update the data directory? HOT 2
- Filter list not fully working HOT 3
- `domain` regex syntax
- enforce values on network filter options when possible
- Possible to embed into Firefox ? HOT 2
- Proposal: Browser-level element hiding HOT 4
- Support for `Permissions-Policy` modifier
- Convert $all to $doc like uBO HOT 1
- support AdGuard scriptlet syntax HOT 1
- Will adblock-rust continue to work after Chrome Manifest V3? HOT 3
- `:style()` action operator doesn't work great with some `::-webkit-*` pseudo-classes, if other pseudo classes are used/need in the same rule.
- Support for `$specifichide`
- YouTube blocks default Brave now HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adblock-rust.