$headlessContentBlocker
$headlessContentBlocker :
Check if an inline script is a localized script via e.g. `wp_set_script_translations` and check if the JSON has blocked content.
__construct(\DevOwl\HeadlessContentBlocker\HeadlessContentBlocker $headlessContentBlocker)
C'tor.
\DevOwl\HeadlessContentBlocker\HeadlessContentBlocker | $headlessContentBlocker |
beforeMatch(\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\AbstractMatch $match)
Called before a match got found.
\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher | $matcher | |
\DevOwl\FastHtmlTag\finder\match\AbstractMatch | $match |
blockedMatch(\DevOwl\HeadlessContentBlocker\BlockedResult $result,\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\AbstractMatch $match)
Called after a match got blocked.
\DevOwl\HeadlessContentBlocker\BlockedResult | $result | |
\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher | $matcher | |
\DevOwl\FastHtmlTag\finder\match\AbstractMatch | $match |
notBlockedMatch(\DevOwl\HeadlessContentBlocker\BlockedResult $result,\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\AbstractMatch $match)
Called after a match got not blocked. Opposite of `blockedMatch`.
\DevOwl\HeadlessContentBlocker\BlockedResult | $result | |
\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher | $matcher | |
\DevOwl\FastHtmlTag\finder\match\AbstractMatch | $match |
checkResult(\DevOwl\HeadlessContentBlocker\BlockedResult $result,\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\AbstractMatch $match): \DevOwl\HeadlessContentBlocker\BlockedResult
See `AbstractPlugin`.
\DevOwl\HeadlessContentBlocker\BlockedResult | $result | |
\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher | $matcher | |
\DevOwl\FastHtmlTag\finder\match\AbstractMatch | $match |
keepAlwaysAttributes(array<mixed,string> $keepAttributes,\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\AbstractMatch $match): array<mixed,string>
Keep attributes for a specific match.
array<mixed,string> | $keepAttributes | |
\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher | $matcher | |
\DevOwl\FastHtmlTag\finder\match\AbstractMatch | $match |
skipInlineScriptVariableAssignment(array<mixed,string> $names,\DevOwl\HeadlessContentBlocker\matcher\ScriptInlineMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\ScriptInlineMatch $match): array<mixed,string>
Skip inline script by variable name.
array<mixed,string> | $names | |
\DevOwl\HeadlessContentBlocker\matcher\ScriptInlineMatcher | $matcher | |
\DevOwl\FastHtmlTag\finder\match\ScriptInlineMatch | $match |
inlineStyleShouldBeExtracted(boolean $extract,\DevOwl\HeadlessContentBlocker\matcher\StyleInlineMatcher|\DevOwl\HeadlessContentBlocker\matcher\StyleInlineAttributeMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\StyleInlineMatch|\DevOwl\HeadlessContentBlocker\finder\match\StyleInlineAttributeMatch $match): boolean
Do not extract blocked rules of a CSS inline script to a second document.
inlineStyleModifyDocuments(\Sabberworm\CSS\CSSList\Document $document,\Sabberworm\CSS\CSSList\Document $extractedDocument,\DevOwl\HeadlessContentBlocker\matcher\StyleInlineMatcher|\DevOwl\HeadlessContentBlocker\matcher\StyleInlineAttributeMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\StyleInlineMatch|\DevOwl\HeadlessContentBlocker\finder\match\StyleInlineAttributeMatch $match): boolean
Allows to modify blocked CSS documents.
\Sabberworm\CSS\CSSList\Document | $document | |
\Sabberworm\CSS\CSSList\Document | $extractedDocument | |
\DevOwl\HeadlessContentBlocker\matcher\StyleInlineMatcher|\DevOwl\HeadlessContentBlocker\matcher\StyleInlineAttributeMatcher | $matcher | |
\DevOwl\FastHtmlTag\finder\match\StyleInlineMatch|\DevOwl\HeadlessContentBlocker\finder\match\StyleInlineAttributeMatch | $match |
inlineStyleBlockRule(\DevOwl\HeadlessContentBlocker\BlockedResult $result,string $url,\DevOwl\HeadlessContentBlocker\matcher\StyleInlineMatcher|\DevOwl\HeadlessContentBlocker\matcher\StyleInlineAttributeMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\StyleInlineMatch|\DevOwl\HeadlessContentBlocker\finder\match\StyleInlineAttributeMatch $match): boolean
Decide if a URL in a CSS rule should be blocked.
visualParent(boolean|string|\DevOwl\HeadlessContentBlocker\number $visualParent,\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher $matcher,\DevOwl\FastHtmlTag\finder\match\AbstractMatch $match): boolean|string|\DevOwl\HeadlessContentBlocker\number
Set a visual parent for a specific match.
boolean|string|\DevOwl\HeadlessContentBlocker\number | $visualParent | |
\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher | $matcher | |
\DevOwl\FastHtmlTag\finder\match\AbstractMatch | $match |
blockableStringExpression(string $expression,\DevOwl\HeadlessContentBlocker\AbstractBlockable $blockable): string
Allows to modify the passed string expression to a blockable.
string | $expression | |
\DevOwl\HeadlessContentBlocker\AbstractBlockable | $blockable |
replaceScriptJsonContent(\DevOwl\FastHtmlTag\finder\match\ScriptInlineMatch $match,string $strpos,string $pattern,boolean|integer $result = null,string $appendToScript = '')
See class description.
\DevOwl\FastHtmlTag\finder\match\ScriptInlineMatch | $match | |
string | $strpos | Simple contains check before doing extensive preg replace |
string | $pattern | Pattern which results in a JSON string |
boolean|integer | $result |
|
string | $appendToScript |