Skip to content

domain/blocker/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.

blockingFor(url, enabled, allowedSites): Blocking

Defined in: app/src/domain/blocker/blocking.ts:33

Tells whether the content blocker works on a page.

string

The page’s address.

boolean

Whether the blocker is on at all.

readonly string[]

Sites on which it is off.

Blocking


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.

string

The page’s host name.

readonly string[]

Sites on which the blocker is off.

string | undefined


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.

string

The page’s host name.

string

The registrable domain of the host, such as example.co.uk.

string


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.

string

The page’s address.

string | undefined

The host name, or undefined for anything but http and https.


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.

readonly string[]

Sites on which the blocker is off.

string

The page’s host name.

string = host

The registrable domain of the host, such as example.co.uk.

string[]

The new list, sorted.