@duckduckgo/privacy-dashboard
    Preparing search index...

    Class PrivacyDashboardJavascriptInterface

    This describes the JavaScript Interface, PrivacyDashboard, that gets added to the window object by Android.

    The Privacy Dashboard communicates with Android by calling methods on that global object.


    For example, to show the breakage form, we'd call:

    window.PrivacyDashboard.showBreakageForm()
    

    Each method documented below is intended

    Index

    Methods

    • Calling this method should close the dashboard and open the given URL in a new tab.

      Parameters

      • payload: { url: string }

      Returns void

    • Calling this method should open the settings at the 'target' provided

      Supported targets:

      • cpm - used from the Cookie Prompt Management screen when user taps 'disable in settings'

      Parameters

      • payload: { target: "cpm" }

      Returns void

    • Shows the native breakage form, instead of using the one embedded in the Privacy Dashboard

      Returns void

      window.PrivacyDashboard.showBreakageForm()
      
    • Parameters

      • params: SetProtectionParams

        Add the current domain to the 'allowlist'

        window.PrivacyDashboard.toggleAllowlist(JSON.stringify({
        "isProtected": true,
        "eventOrigin": { "screen": "primaryScreen" }
        }))

        Remove the current domain from the 'allowlist'

        window.PrivacyDashboard.toggleAllowlist(JSON.stringify({
        "isProtected": false,
        "eventOrigin": { "screen": "primaryScreen" }
        }))

      Returns void