@freedomofpress/webcat
    Preparing search index...

    Class HookBuilder

    Builds hooks using unique cryptographic keys.

    Index
    • Parameters

      • store: KVStore

        A key-value store for persisting the builder's cryptographic key and salt.

      • ui: WebcatUI
      • config: { connectionName: string; staticHookPath: string }
        • connectionName: string

          The name of the connection that content script hooks use to communicate with the rest of the extension.

        • staticHookPath: string

          The path to the static hook content script file, relative to the extension root directory.

      Returns HookBuilder

    • Parameters

      • url: string

        A URL with an encrypted fragment added via a hook.

      Returns Promise<string>

      The decrypted fragment.

    • Parameters

      • wasm: string[]

        An array of hashes to validate WASM modules against.

      • firstParty: string

        The first-party origin of the associated page.

      • sameOrigin: boolean

        true if the target document is same-origin with the first party.

      Returns Promise<[func: (data: string) => void, args: [data: string]]>

      A Promise that resolves to hook code ready to be included in a content script.

    • Parameters

      • wasm: string[]

        An array of hashes to validate WASM modules against.

      • firstParty: string

        The first-party origin of the associated page.

      • sameOrigin: boolean

        true if the target document is same-origin with the first party.

      Returns Promise<string>

      A Promise that resolves to hook code ready to be injected directly to a script file.