Use this configuration to create an instance of Messaging for WebKit

import { fromConfig, WebkitMessagingConfig } from "@duckduckgo/content-scope-scripts/lib/messaging.js"

const config = new WebkitMessagingConfig({
hasModernWebkitAPI: true,
webkitMessageHandlerNames: ["foo", "bar", "baz"],
secret: "dax",
});

const messaging = new Messaging(config)
const resp = await messaging.request("debugConfig")

Hierarchy

  • WebkitMessagingConfig

Constructors

Properties

hasModernWebkitAPI: boolean

Whether or not the current WebKit Platform supports secure messaging by default (eg: macOS 11+)

secret: string

A string provided by native platforms to be sent with future outgoing messages

webkitMessageHandlerNames: string[]

A list of WebKit message handler names that a user script can send

Generated using TypeDoc