\DevOwl\HeadlessContentBlockerAttributesHelper

Helper functionality for HTML attributes in association with `Constants`.

Summary

Methods
Properties
Constants
isAlreadyBlocked()
transformAttribute()
revertTransformAttribute()
isSkipped()
skipHtmlTagsInContentBlocker()
hasCssDocumentConsentRules()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

isAlreadyBlocked()

isAlreadyBlocked(array<mixed,string>  $attributes)

Check if a given set of HTML attributes already contains the "blocked"-attribute so we can skip duplicate blockages.

Parameters

array<mixed,string> $attributes

transformAttribute()

transformAttribute(string  $attribute,boolean  $useClickEvent = false)

Transform an attribute to `consent-original-%s_` attribute.

Parameters

string $attribute
boolean $useClickEvent

Uses consent-click-original instead of consent-original

revertTransformAttribute()

revertTransformAttribute(string  $attribute)

Transform an attribute from `consent-original-%s_` to original attribute name.

Parameters

string $attribute

isSkipped()

isSkipped(array<mixed,string>  $attributes)

Check if given HTML attributes contain a skipper.

Parameters

array<mixed,string> $attributes

skipHtmlTagsInContentBlocker()

skipHtmlTagsInContentBlocker(string  $html,string  $additionalTags = '')

Transform a set of given HTML tags to be skipped for the complete content blocker.

Parameters

string $html
string $additionalTags

hasCssDocumentConsentRules()

hasCssDocumentConsentRules(string  $document)

Check if a given string has blocked CSS rules.

Parameters

string $document