\DevOwl\HeadlessContentBlocker\pluginsAttributeJsonBlocker

Block content deeply in JSON attributes instead of the whole element e.g. `<div class="et_pb_code_inner" data-et-multi-view ="{&quot;schema&quot;:{&quot;content&quot;:{&quot;desktop&quot;:&quot;&lt;div align=&#039;center&#039;&gt;\n&lt;iframe src=\&quot;https:\/\/www.google.com\/maps\/embed.

..`.

Please ensure that the attribute is registered as blockable attribute e.g. by addTagAttributeMap or by rule.

Summary

Methods
Properties
Constants
__construct()
afterSetup()
init()
modifyHtmlAfterProcessing()
beforeMatch()
blockedMatch()
notBlockedMatch()
checkResult()
keepAlwaysAttributes()
skipInlineScriptVariableAssignment()
inlineStyleShouldBeExtracted()
inlineStyleModifyDocuments()
inlineStyleBlockRule()
visualParent()
blockableStringExpression()
getHeadlessContentBlocker()
addAttributes()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$headlessContentBlocker
$attributes
N/A

Properties

$headlessContentBlocker

$headlessContentBlocker :

Type

$attributes

$attributes :array<mixed,string>

The attributes which should be deeply crawled.

Type

array<mixed,string>

Methods

afterSetup()

afterSetup()

The content blocker got setup completely.

init()

init()

Initialize your plugin add e.g. new visual parent definitions.

modifyHtmlAfterProcessing()

modifyHtmlAfterProcessing(string  $html)

Allows to modify the HTML after the content blocker has done its job.

Parameters

string $html

checkResult()

checkResult(\DevOwl\HeadlessContentBlocker\plugins\BlockedResult  $result,\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher  $matcher,\DevOwl\FastHtmlTag\finder\match\AbstractMatch  $match): \DevOwl\HeadlessContentBlocker\plugins\BlockedResult

Called after a match got found and the matcher decided, if it should be blocked or not.

Parameters

\DevOwl\HeadlessContentBlocker\plugins\BlockedResult $result
\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher $matcher
\DevOwl\FastHtmlTag\finder\match\AbstractMatch $match

Returns

\DevOwl\HeadlessContentBlocker\plugins\BlockedResult

inlineStyleShouldBeExtracted()

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.

Parameters

boolean $extract
\DevOwl\HeadlessContentBlocker\matcher\StyleInlineMatcher|\DevOwl\HeadlessContentBlocker\matcher\StyleInlineAttributeMatcher $matcher
\DevOwl\FastHtmlTag\finder\match\StyleInlineMatch|\DevOwl\HeadlessContentBlocker\finder\match\StyleInlineAttributeMatch $match

Returns

boolean

inlineStyleModifyDocuments()

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.

Parameters

\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

Returns

boolean

inlineStyleBlockRule()

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.

Parameters

\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

Returns

boolean

visualParent()

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.

Parameters

boolean|string|\DevOwl\HeadlessContentBlocker\number $visualParent
\DevOwl\HeadlessContentBlocker\matcher\AbstractMatcher $matcher
\DevOwl\FastHtmlTag\finder\match\AbstractMatch $match

Returns

boolean|string|\DevOwl\HeadlessContentBlocker\number

blockableStringExpression()

blockableStringExpression(string  $expression,\DevOwl\HeadlessContentBlocker\AbstractBlockable  $blockable): string

Allows to modify the passed string expression to a blockable.

Parameters

string $expression
\DevOwl\HeadlessContentBlocker\AbstractBlockable $blockable

Returns

string

getHeadlessContentBlocker()

getHeadlessContentBlocker()

Getter.

addAttributes()

addAttributes(array<mixed,string>  $attributes)

Add attribute which should be considered as "is-json".

Parameters

array<mixed,string> $attributes