Scriptlets
Scriptlets copied to clipboard
Add scriptlet to trigger event - dispatchEvent()
It could be useful in this case - https://github.com/AdguardTeam/AdguardFilters/issues/166126
Instead of allowing cookie notice and closing it, we could use dispatchEvent() to load video player.
Something like:
function dispatchCustomEvent(event, element) {
if (!event) {
return;
}
const ev = new CustomEvent(event);
const el = element ? document.querySelector(element) : document;
if (el) {
el.dispatchEvent(ev);
}
}
and then:
dispatchCustomEvent('consentGranted')