Constants
in package
Common constants for the headless content blocker.
Table of Contents
Constants
- HTML_ATTRIBUTE_BLOCKER_ID = 'consent-id'
- The ID of the `Blockable` for which we need consent for.
- HTML_ATTRIBUTE_BY = 'consent-by'
- Usually, this is `cookie`, but you could also implement different types like `tcf-vendor` or similar. So, in frontend you can implement different "checking for consent"-mechanism.
- HTML_ATTRIBUTE_CAPTURE_CLICK_PREFIX = 'consent-click-original'
- HTML_ATTRIBUTE_CAPTURE_PREFIX = 'consent-original'
- When transforming a blocked attribute, it gets prefixed and suffixed.
- HTML_ATTRIBUTE_CAPTURE_SUFFIX = '_'
- HTML_ATTRIBUTE_CLICK_DISPATCH_RESIZE = 'consent-click-dispatch-resize'
- If set it will trigger a window resize event when the unblocked item got clicked (or delegated a click).
- HTML_ATTRIBUTE_CONFIRM = 'consent-confirm'
- See `Confirm`
- HTML_ATTRIBUTE_CONSENT_SKIP_BLOCKER = 'consent-skip-blocker'
- HTML tags with this attribute activated are ignored in the complete content blocker.
- HTML_ATTRIBUTE_CONSENT_SKIP_BLOCKER_VALUE = '1'
- HTML_ATTRIBUTE_COOKIE_IDS = 'consent-required'
- Comma separated list of IDs needed for `consent-by`.
- HTML_ATTRIBUTE_DELEGATE_CLICK = 'consent-delegate-click'
- See `DelegateClick`.
- HTML_ATTRIBUTE_EVALJS_PREFIX = 'consent-evaljs-'
- See `EvalJs`.
- HTML_ATTRIBUTE_HERO_DIALOG_DEFAULT_OPEN = 'consent-hero-dialog-default-open'
- This attribute is only used on client-side and allows to automatically open the hero dialog as soon as the visual content blocker is rendered. This is great to use in conjunction with `window.consentApi.unblock`.
- HTML_ATTRIBUTE_INLINE = 'consent-inline'
- HTML_ATTRIBUTE_INLINE_STYLE = 'consent-inline-style'
- Blocked styles are put into an own attribute instead of the `script` body to avoid that caching plugins like WP Rocket will bundle them in a minified file.
- HTML_ATTRIBUTE_JQUERY_HIJACK_EACH = 'consent-jquery-hijack-each'
- See `JQueryHijackEach`.
- HTML_ATTRIBUTE_NEGATE = 'consent-negate'
- See `NegatePlugin`
- HTML_ATTRIBUTE_REATTACH_DOM = 'consent-redom'
- See `ReattachDom`
- HTML_ATTRIBUTE_THUMBNAIL = 'consent-thumbnail'
- See `ImagePreview`.
- HTML_ATTRIBUTE_THUMBNAIL_SUGGESTION = 'consent-thumbnail-suggestion'
- HTML_ATTRIBUTE_TYPE_CSS = 'text/css'
- HTML_ATTRIBUTE_TYPE_FOR = ['script', 'style']
- Caching plugins compatibility e.g. WP Rocket. Adds this `type` to your `script` and `style` so it gets not combined to a combine-file for example.
- HTML_ATTRIBUTE_TYPE_JS = 'application/javascript'
- HTML_ATTRIBUTE_TYPE_NAME = 'type'
- HTML_ATTRIBUTE_TYPE_VALUE = 'application/consent'
- HTML_ATTRIBUTE_UNBLOCKED_TRANSACTION_COMPLETE = 'consent-transaction-complete'
- This constant is only used in frontend and is added afterwards a unblock transaction got completed.
- HTML_ATTRIBUTE_VISUAL_FORCE = 'consent-visual-force'
- When an individual node has the attribute it will behavior as the same setting known from the content blocker setting "Force visual content blocker for hidden elements".
- HTML_ATTRIBUTE_VISUAL_ID = 'consent-visual-id'
- See `CalculateUniqueKeys`.
- HTML_ATTRIBUTE_VISUAL_PARENT = 'consent-visual-use-parent'
- A tag got blocked, e. g. `iframe`. We can now determine the "Visual Parent". The visual parent is the closest parent where the content blocker should be placed to. The visual parent can be configured as follow:
- HTML_ATTRIBUTE_VISUAL_PARENT_HIDE = 'consent-visual-use-parent-hide'
- Use this together with `HTML_ATTRIBUTE_VISUAL_PARENT`. When the parent got found, it gets automatically hidden.
- HTML_POTENTIAL_SKIP_TAGS = ['script', 'link', 'style']
- INLINE_SCRIPT_CONTAINING_STRING_TO_SKIP_BLOCKER = 'CONTENT_BLOCKER_SKIP_THIS_INLINE_SCRIPT'
- Allow to skip an inline script to be blocked when it contains a given string. This is only necessary for found matches which do not have another indicator in the HTML tag.
- INLINE_SCRIPT_CONTAINING_STRING_TO_SKIP_BLOCKER_UNMINIFYABLE = 'if(window.CONTENT_BLOCKER_SKIP_THIS_INLINE_SCRIPT){};'
- URL_QUERY_ARG_ORIGINAL_URL_IN_STYLE = 'consent-original-url'
Constants
HTML_ATTRIBUTE_BLOCKER_ID
The ID of the `Blockable` for which we need consent for.
public
mixed
HTML_ATTRIBUTE_BLOCKER_ID
= 'consent-id'
HTML_ATTRIBUTE_BY
Usually, this is `cookie`, but you could also implement different types like `tcf-vendor` or similar. So, in frontend you can implement different "checking for consent"-mechanism.
public
mixed
HTML_ATTRIBUTE_BY
= 'consent-by'
HTML_ATTRIBUTE_CAPTURE_CLICK_PREFIX
public
mixed
HTML_ATTRIBUTE_CAPTURE_CLICK_PREFIX
= 'consent-click-original'
HTML_ATTRIBUTE_CAPTURE_PREFIX
When transforming a blocked attribute, it gets prefixed and suffixed.
public
mixed
HTML_ATTRIBUTE_CAPTURE_PREFIX
= 'consent-original'
HTML_ATTRIBUTE_CAPTURE_SUFFIX
public
mixed
HTML_ATTRIBUTE_CAPTURE_SUFFIX
= '_'
HTML_ATTRIBUTE_CLICK_DISPATCH_RESIZE
If set it will trigger a window resize event when the unblocked item got clicked (or delegated a click).
public
mixed
HTML_ATTRIBUTE_CLICK_DISPATCH_RESIZE
= 'consent-click-dispatch-resize'
This needs to be defined as number as it can be delayed. Use 0
for instant dispatch.
HTML_ATTRIBUTE_CONFIRM
See `Confirm`
public
mixed
HTML_ATTRIBUTE_CONFIRM
= 'consent-confirm'
HTML_ATTRIBUTE_CONSENT_SKIP_BLOCKER
HTML tags with this attribute activated are ignored in the complete content blocker.
public
mixed
HTML_ATTRIBUTE_CONSENT_SKIP_BLOCKER
= 'consent-skip-blocker'
HTML_ATTRIBUTE_CONSENT_SKIP_BLOCKER_VALUE
public
mixed
HTML_ATTRIBUTE_CONSENT_SKIP_BLOCKER_VALUE
= '1'
HTML_ATTRIBUTE_COOKIE_IDS
Comma separated list of IDs needed for `consent-by`.
public
mixed
HTML_ATTRIBUTE_COOKIE_IDS
= 'consent-required'
HTML_ATTRIBUTE_DELEGATE_CLICK
See `DelegateClick`.
public
mixed
HTML_ATTRIBUTE_DELEGATE_CLICK
= 'consent-delegate-click'
HTML_ATTRIBUTE_EVALJS_PREFIX
See `EvalJs`.
public
mixed
HTML_ATTRIBUTE_EVALJS_PREFIX
= 'consent-evaljs-'
HTML_ATTRIBUTE_HERO_DIALOG_DEFAULT_OPEN
This attribute is only used on client-side and allows to automatically open the hero dialog as soon as the visual content blocker is rendered. This is great to use in conjunction with `window.consentApi.unblock`.
public
mixed
HTML_ATTRIBUTE_HERO_DIALOG_DEFAULT_OPEN
= 'consent-hero-dialog-default-open'
HTML_ATTRIBUTE_INLINE
public
mixed
HTML_ATTRIBUTE_INLINE
= 'consent-inline'
HTML_ATTRIBUTE_INLINE_STYLE
Blocked styles are put into an own attribute instead of the `script` body to avoid that caching plugins like WP Rocket will bundle them in a minified file.
public
mixed
HTML_ATTRIBUTE_INLINE_STYLE
= 'consent-inline-style'
HTML_ATTRIBUTE_JQUERY_HIJACK_EACH
See `JQueryHijackEach`.
public
mixed
HTML_ATTRIBUTE_JQUERY_HIJACK_EACH
= 'consent-jquery-hijack-each'
HTML_ATTRIBUTE_NEGATE
See `NegatePlugin`
public
mixed
HTML_ATTRIBUTE_NEGATE
= 'consent-negate'
HTML_ATTRIBUTE_REATTACH_DOM
See `ReattachDom`
public
mixed
HTML_ATTRIBUTE_REATTACH_DOM
= 'consent-redom'
HTML_ATTRIBUTE_THUMBNAIL
See `ImagePreview`.
public
mixed
HTML_ATTRIBUTE_THUMBNAIL
= 'consent-thumbnail'
HTML_ATTRIBUTE_THUMBNAIL_SUGGESTION
public
mixed
HTML_ATTRIBUTE_THUMBNAIL_SUGGESTION
= 'consent-thumbnail-suggestion'
HTML_ATTRIBUTE_TYPE_CSS
public
mixed
HTML_ATTRIBUTE_TYPE_CSS
= 'text/css'
HTML_ATTRIBUTE_TYPE_FOR
Caching plugins compatibility e.g. WP Rocket. Adds this `type` to your `script` and `style` so it gets not combined to a combine-file for example.
public
mixed
HTML_ATTRIBUTE_TYPE_FOR
= ['script', 'style']
HTML_ATTRIBUTE_TYPE_JS
public
mixed
HTML_ATTRIBUTE_TYPE_JS
= 'application/javascript'
HTML_ATTRIBUTE_TYPE_NAME
public
mixed
HTML_ATTRIBUTE_TYPE_NAME
= 'type'
HTML_ATTRIBUTE_TYPE_VALUE
public
mixed
HTML_ATTRIBUTE_TYPE_VALUE
= 'application/consent'
HTML_ATTRIBUTE_UNBLOCKED_TRANSACTION_COMPLETE
This constant is only used in frontend and is added afterwards a unblock transaction got completed.
public
mixed
HTML_ATTRIBUTE_UNBLOCKED_TRANSACTION_COMPLETE
= 'consent-transaction-complete'
HTML_ATTRIBUTE_VISUAL_FORCE
When an individual node has the attribute it will behavior as the same setting known from the content blocker setting "Force visual content blocker for hidden elements".
public
mixed
HTML_ATTRIBUTE_VISUAL_FORCE
= 'consent-visual-force'
HTML_ATTRIBUTE_VISUAL_ID
See `CalculateUniqueKeys`.
public
mixed
HTML_ATTRIBUTE_VISUAL_ID
= 'consent-visual-id'
HTML_ATTRIBUTE_VISUAL_PARENT
A tag got blocked, e. g. `iframe`. We can now determine the "Visual Parent". The visual parent is the closest parent where the content blocker should be placed to. The visual parent can be configured as follow:
public
mixed
HTML_ATTRIBUTE_VISUAL_PARENT
= 'consent-visual-use-parent'
-
false
= Use original element -
true
= Use parent element -
number
= Go upwards x element (parentElement) -
string
= Go upwards until parentElement matches a selector -
string
= Starting withchildren:
you canquerySelector
down to create the visual parent for a children
HTML_ATTRIBUTE_VISUAL_PARENT_HIDE
Use this together with `HTML_ATTRIBUTE_VISUAL_PARENT`. When the parent got found, it gets automatically hidden.
public
mixed
HTML_ATTRIBUTE_VISUAL_PARENT_HIDE
= 'consent-visual-use-parent-hide'
HTML_POTENTIAL_SKIP_TAGS
public
mixed
HTML_POTENTIAL_SKIP_TAGS
= ['script', 'link', 'style']
INLINE_SCRIPT_CONTAINING_STRING_TO_SKIP_BLOCKER
Allow to skip an inline script to be blocked when it contains a given string. This is only necessary for found matches which do not have another indicator in the HTML tag.
public
mixed
INLINE_SCRIPT_CONTAINING_STRING_TO_SKIP_BLOCKER
= 'CONTENT_BLOCKER_SKIP_THIS_INLINE_SCRIPT'
INLINE_SCRIPT_CONTAINING_STRING_TO_SKIP_BLOCKER_UNMINIFYABLE
public
mixed
INLINE_SCRIPT_CONTAINING_STRING_TO_SKIP_BLOCKER_UNMINIFYABLE
= 'if(window.CONTENT_BLOCKER_SKIP_THIS_INLINE_SCRIPT){};'
URL_QUERY_ARG_ORIGINAL_URL_IN_STYLE
public
mixed
URL_QUERY_ARG_ORIGINAL_URL_IN_STYLE
= 'consent-original-url'