platform/blocker/blocker-engine
Classes
Section titled “Classes”BlockerEngine
Section titled “BlockerEngine”Defined in: app/src/platform/blocker/blocker-engine.ts:46
The loaded filter engines and what the content blocker asks of them.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BlockerEngine(
loaded,options):BlockerEngine
Defined in: app/src/platform/blocker/blocker-engine.ts:57
Parameters
Section titled “Parameters”loaded
Section titled “loaded”LoadedEngine
The engines and the library’s request class.
options
Section titled “options”The options of the content blocker.
Returns
Section titled “Returns”Methods
Section titled “Methods”blocksPopup()
Section titled “blocksPopup()”blocksPopup(
url,openerUrl):boolean
Defined in: app/src/platform/blocker/blocker-engine.ts:193
Whether a popup that a page opens is one that the filter lists block.
Parameters
Section titled “Parameters”string
The address the popup would show.
openerUrl
Section titled “openerUrl”string
The address of the page that opens it.
Returns
Section titled “Returns”boolean
domainOf()
Section titled “domainOf()”domainOf(
url):string
Defined in: app/src/platform/blocker/blocker-engine.ts:183
The registrable domain of a page, such as example.co.uk for www.example.co.uk. Sites
on hosting platforms count as sites of their own, such as alice.github.io.
Parameters
Section titled “Parameters”string
The page’s address.
Returns
Section titled “Returns”string
elementRules()
Section titled “elementRules()”elementRules(
url,elements):string
Defined in: app/src/platform/blocker/blocker-engine.ts:157
The generic element hiding rules for the classes, ids and links of a frame.
Parameters
Section titled “Parameters”string
The frame’s address.
elements
Section titled “elements”What the frame reported.
Returns
Section titled “Returns”string
frameRules()
Section titled “frameRules()”frameRules(
url):FrameRules
Defined in: app/src/platform/blocker/blocker-engine.ts:134
The element hiding rules, procedural rules and scriptlets for a frame that starts.
Parameters
Section titled “Parameters”string
The frame’s address.
Returns
Section titled “Returns”headersReceived()
Section titled “headersReceived()”headersReceived(
details):Readonly<Record<string, readonlystring[]>> |undefined
Defined in: app/src/platform/blocker/blocker-engine.ts:108
Adds the content security policy that $csp filters set for a page.
Parameters
Section titled “Parameters”details
Section titled “details”OnHeadersReceivedListenerDetails
The response of a page.
Returns
Section titled “Returns”Readonly<Record<string, readonly string[]>> | undefined
loadExtras()
Section titled “loadExtras()”loadExtras():
Promise<void>
Defined in: app/src/platform/blocker/blocker-engine.ts:209
Loads the engines of the optional lists that are on, so that they apply from the next request on; a group whose engine has loaded already costs nothing.
Returns
Section titled “Returns”Promise<void>
mainFrame()
Section titled “mainFrame()”mainFrame(
url):RequestDecision|undefined
Defined in: app/src/platform/blocker/blocker-engine.ts:68
Takes the tracking parameters that the lists name out of the address of a page; pages themselves are never blocked.
Parameters
Section titled “Parameters”string
The page’s address.
Returns
Section titled “Returns”RequestDecision | undefined
resource()
Section titled “resource()”resource(
name):ReplacementResource|undefined
Defined in: app/src/platform/blocker/blocker-engine.ts:123
A replacement resource of the filter data by its file name, for the resource scheme.
Parameters
Section titled “Parameters”string
The file name.
Returns
Section titled “Returns”ReplacementResource | undefined
subresource()
Section titled “subresource()”subresource(
details,sourceUrl,type):RequestDecision|undefined
Defined in: app/src/platform/blocker/blocker-engine.ts:79
Decides about a request that a page makes.
Parameters
Section titled “Parameters”details
Section titled “details”OnBeforeRequestListenerDetails
The request.
sourceUrl
Section titled “sourceUrl”string
The page it belongs to.
RequestType
Its type for the filter engine.
Returns
Section titled “Returns”RequestDecision | undefined
Functions
Section titled “Functions”openBlockerEngine()
Section titled “openBlockerEngine()”openBlockerEngine(
options):Promise<BlockerEngine>
Defined in: app/src/platform/blocker/blocker-engine.ts:31
Reads the filter data and makes the engine of the content blocker. It loads with the first web page, together with this module, so the start of the browser does neither.
Parameters
Section titled “Parameters”options
Section titled “options”The options of the content blocker.
Returns
Section titled “Returns”Promise<BlockerEngine>
Throws
Section titled “Throws”When the data is missing or damaged.