platform/blocker/blocker-types
Interfaces
Section titled “Interfaces”ContentBlockerOptions
Section titled “ContentBlockerOptions”Defined in: app/src/platform/blocker/blocker-types.ts:42
Options of the content blocker.
Properties
Section titled “Properties”dataDir
Section titled “dataDir”
readonlydataDir:string
Defined in: app/src/platform/blocker/blocker-types.ts:44
Folder with engine.bin, built by tools/blocker/build.ts.
enabled
Section titled “enabled”
readonlyenabled: (pageUrl) =>boolean
Defined in: app/src/platform/blocker/blocker-types.ts:46
Whether blocking is on for a page, by its address; read for every request.
Parameters
Section titled “Parameters”pageUrl
Section titled “pageUrl”string
Returns
Section titled “Returns”boolean
extras?
Section titled “extras?”
readonlyoptionalextras?: () => readonlyExtraLists[]
Defined in: app/src/platform/blocker/blocker-types.ts:52
The groups of optional lists that are on; read for every request and frame.
Returns
Section titled “Returns”readonly ExtraLists[]
logger
Section titled “logger”
readonlylogger:Logger
Defined in: app/src/platform/blocker/blocker-types.ts:53
onBlocked?
Section titled “onBlocked?”
readonlyoptionalonBlocked?: (webContentsId) =>void
Defined in: app/src/platform/blocker/blocker-types.ts:48
Called for every blocked request, with the id of the tab’s web contents.
Parameters
Section titled “Parameters”webContentsId
Section titled “webContentsId”number
Returns
Section titled “Returns”void
onStatus?
Section titled “onStatus?”
readonlyoptionalonStatus?: (status) =>void
Defined in: app/src/platform/blocker/blocker-types.ts:50
Called when the status of the content blocker changes.
Parameters
Section titled “Parameters”status
Section titled “status”Returns
Section titled “Returns”void
ExtendedRule
Section titled “ExtendedRule”Defined in: app/src/platform/blocker/blocker-types.ts:7
A procedural rule, such as :has-text(): the frame finds its elements itself, then marks
them with the attribute that the style sheet hides, or runs the directive on them.
Properties
Section titled “Properties”
readonlyast:unknown
Defined in: app/src/platform/blocker/blocker-types.ts:9
The selector of the elements, parsed.
attribute?
Section titled “attribute?”
readonlyoptionalattribute?:string
Defined in: app/src/platform/blocker/blocker-types.ts:11
The attribute that hides an element, for hiding rules.
directive?
Section titled “directive?”
readonlyoptionaldirective?:unknown
Defined in: app/src/platform/blocker/blocker-types.ts:13
What to do with an element, such as removing it, for the other rules.
FrameElements
Section titled “FrameElements”Defined in: app/src/platform/blocker/blocker-types.ts:29
The classes, ids and link targets that a frame reported.
Properties
Section titled “Properties”classes
Section titled “classes”
readonlyclasses: readonlystring[]
Defined in: app/src/platform/blocker/blocker-types.ts:30
readonlyhrefs: readonlystring[]
Defined in: app/src/platform/blocker/blocker-types.ts:32
readonlyids: readonlystring[]
Defined in: app/src/platform/blocker/blocker-types.ts:31
FrameRules
Section titled “FrameRules”Defined in: app/src/platform/blocker/blocker-types.ts:17
The rules for a frame that starts.
Properties
Section titled “Properties”elements
Section titled “elements”
readonlyelements:boolean
Defined in: app/src/platform/blocker/blocker-types.ts:25
Whether the frame should report its elements for the generic hiding rules.
extended
Section titled “extended”
readonlyextended: readonlyExtendedRule[]
Defined in: app/src/platform/blocker/blocker-types.ts:23
Procedural rules of the frame’s address.
scripts
Section titled “scripts”
readonlyscripts: readonlystring[]
Defined in: app/src/platform/blocker/blocker-types.ts:21
Scriptlets that run in the page’s world before its own scripts.
styles
Section titled “styles”
readonlystyles:string
Defined in: app/src/platform/blocker/blocker-types.ts:19
Element hiding rules of the frame’s address, as a style sheet.
Type Aliases
Section titled “Type Aliases”BlockerStatus
Section titled “BlockerStatus”BlockerStatus =
"idle"|"loading"|"ready"|"failed"
Defined in: app/src/platform/blocker/blocker-types.ts:36
Where the content blocker is: not loaded yet, loading, working, or without usable data.
ExtraLists
Section titled “ExtraLists”ExtraLists =
"cookies"|"annoyances"
Defined in: app/src/platform/blocker/blocker-types.ts:39
A group of optional lists with an engine of its own: cookie notices or annoyances.