Coder Social home page Coder Social logo

Comments (2)

AndriusA avatar AndriusA commented on June 28, 2024 1

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 to Some(url) when the browser should redirect the request somewhere else?

explained above

  • If matched is true, 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 and important?

... 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.

ArniDagur avatar ArniDagur commented on June 28, 2024

Thank you for the detailed answer. In #87, I've added documentation to the struct using your comment.

from adblock-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.