Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "frontend-packages/cookie-consent-web-client/src/api/unblock"

Index

Type aliases

Functions

Type aliases

BlockerDefinition

BlockerDefinition: { id: string | number; rules: string[]; services: number[] }

Type declaration

  • id: string | number
  • rules: string[]
  • services: number[]

Functions

unblock

  • unblock(blocker: Array<BlockerDefinition>, url: string, ref?: HTMLDivElement): Promise<void>
  • window.consentApi.unblock: Check if a given URL / string is blocked by a Content Blocker:

    • When a Content Blocker exists, the Promise is only resolved after given consent
    • When no Content Blocker exists, the Promise is immediate resolved

    Example (ES5):

    (window.consentApi && window.consentApi.unblock("player.vimeo.com") || Promise.resolve()).then(function() {
        console.log("Consent for Vimeo given, unlock content...!");
    });
    

    Example (ES6, Babel, TS):

    (window.consentApi?.unblock("player.vimeo.com") || Promise.resolve()).then(() => {
        console.log("Consent for Vimeo given, unlock content...!");
    });
    

    Parameters

    • blocker: Array<BlockerDefinition>
    • url: string
    • Default value ref: HTMLDivElement = document.createElement("div")

      Create a visual content blocker to a given HTML element

    Returns Promise<void>

Generated using TypeDoc