window.consentApi.unblock: Check if a given URL / string is blocked by a Content Blocker:
window.consentApi.unblock
Example (ES5):
(window.consentApi && window.consentApi.unblock("player.vimeo.com") || Promise.resolve()).then(function() { console.log("Consent for Vimeo given, unlock content...!");}); Copy
(window.consentApi && window.consentApi.unblock("player.vimeo.com") || Promise.resolve()).then(function() { console.log("Consent for Vimeo given, unlock content...!");});
Example (ES6, TS):
(window.consentApi?.unblock("player.vimeo.com") || Promise.resolve()).then(() => { console.log("Consent for Vimeo given, unlock content...!");}); Copy
(window.consentApi?.unblock("player.vimeo.com") || Promise.resolve()).then(() => { console.log("Consent for Vimeo given, unlock content...!");});
Optional
window.consentApi.unblock
: Check if a given URL / string is blocked by a Content Blocker:Example (ES5):
Example (ES6, TS):