domain/blocker/blocking
Type Aliases
Section titled “Type Aliases”Blocking
Section titled “Blocking”Blocking =
"on"|"off"|"none"|"failed"
Defined in: app/src/domain/blocker/blocking.ts:5
Whether the content blocker works on a page: none for pages it never touches, and
failed where it should block but has no usable filter data.
Functions
Section titled “Functions”blockingFor()
Section titled “blockingFor()”blockingFor(
url,enabled,allowedSites):Blocking
Defined in: app/src/domain/blocker/blocking.ts:33
Tells whether the content blocker works on a page.
Parameters
Section titled “Parameters”string
The page’s address.
enabled
Section titled “enabled”boolean
Whether the blocker is on at all.
allowedSites
Section titled “allowedSites”readonly string[]
Sites on which it is off.
Returns
Section titled “Returns”exceptionFor()
Section titled “exceptionFor()”exceptionFor(
host,allowedSites):string|undefined
Defined in: app/src/domain/blocker/blocking.ts:23
The exception that covers a host: the entry for the host itself or for a domain it
belongs to, so an exception for example.com also covers www.example.com.
Parameters
Section titled “Parameters”string
The page’s host name.
allowedSites
Section titled “allowedSites”readonly string[]
Sites on which the blocker is off.
Returns
Section titled “Returns”string | undefined
exceptionSite()
Section titled “exceptionSite()”exceptionSite(
host,domain):string
Defined in: app/src/domain/blocker/blocking.ts:51
The entry that turns blocking off for a host: its registrable domain, or the host itself when the domain does not cover it, as for IPv6 addresses.
Parameters
Section titled “Parameters”string
The page’s host name.
domain
Section titled “domain”string
The registrable domain of the host, such as example.co.uk.
Returns
Section titled “Returns”string
siteOf()
Section titled “siteOf()”siteOf(
url):string|undefined
Defined in: app/src/domain/blocker/blocking.ts:12
The site of a web page, by host name, as the content blocker’s exceptions name it.
Parameters
Section titled “Parameters”string
The page’s address.
Returns
Section titled “Returns”string | undefined
The host name, or undefined for anything but http and https.
toggleSite()
Section titled “toggleSite()”toggleSite(
allowedSites,host,domain?):string[]
Defined in: app/src/domain/blocker/blocking.ts:63
Turns blocking on a page’s site off, for the whole registrable domain, or back on by removing every exception that covers the host.
Parameters
Section titled “Parameters”allowedSites
Section titled “allowedSites”readonly string[]
Sites on which the blocker is off.
string
The page’s host name.
domain?
Section titled “domain?”string = host
The registrable domain of the host, such as example.co.uk.
Returns
Section titled “Returns”string[]
The new list, sorted.