\DevOwl\HeadlessContentBlocker\matcherCssBlocker

Takes a match and checks for blocked URLs. If there got something blocked, you can extract two CSS documents.

Summary

Methods
Properties
Constants
__construct()
parse()
createResultForSingleUrl()
No public properties found
EXTRACT_COMPLETE_AT_RULE_INSTEAD_OF_SINGLE_PROPERTY
DEFAULT_DUMMY_URL
generateLocationChangeSet()
generateLocationChangeSetForSingleValue()
generateDummyUrl()
getStyle()
No protected properties found
N/A
No private methods found
$extract
$match
$matcher
$blockedUrls
N/A

Constants

EXTRACT_COMPLETE_AT_RULE_INSTEAD_OF_SINGLE_PROPERTY

EXTRACT_COMPLETE_AT_RULE_INSTEAD_OF_SINGLE_PROPERTY =array('font-face')

DEFAULT_DUMMY_URL

DEFAULT_DUMMY_URL ='https://assets.devowl.io/packages/devowl-wp/headless-content-blocker/'

Properties

$extract

$extract :

Type

$match

$match :

Type

$matcher

$matcher :

Type

$blockedUrls

$blockedUrls :array<mixed,string>

Blocked URLs.

Type

array<mixed,string>

Methods

parse()

parse()

Parse a CSS and remove blocked URLs.

createResultForSingleUrl()

createResultForSingleUrl(string  $url): \DevOwl\HeadlessContentBlocker\BlockedResult

Check if a given URL is blocked.

Parameters

string $url

Returns

\DevOwl\HeadlessContentBlocker\BlockedResult

generateLocationChangeSet()

generateLocationChangeSet(\Sabberworm\CSS\CSSList\Document  $document)

Generate a list of changed `URL`s with their new URL. It also respects rule sets which needs to be completely blocked and moved to the extracted document (e.g. `@font-face`).

Parameters

\Sabberworm\CSS\CSSList\Document $document

generateLocationChangeSetForSingleValue()

generateLocationChangeSetForSingleValue(\Sabberworm\CSS\CSSList\Document  $document,\DevOwl\HeadlessContentBlocker\matcher\Value  $val,boolean  $extract,array  $removed,array  $setUrlChanges)

Generate a list of changed `URL`s with their new URL for a single value inside our parsed document.

Parameters

\Sabberworm\CSS\CSSList\Document $document
\DevOwl\HeadlessContentBlocker\matcher\Value $val
boolean $extract
array $removed
array $setUrlChanges

generateDummyUrl()

generateDummyUrl(\DevOwl\HeadlessContentBlocker\BlockedResult  $result,string  $dummyFileName,string  $originalUrl)

Get the new URL for a blocked value.

Parameters

\DevOwl\HeadlessContentBlocker\BlockedResult $result
string $dummyFileName
string $originalUrl

getStyle()

getStyle()

Get the style as string from our match.