rmapi-js
    Preparing search index...

    Class SocketAuthorization

    the headers a Chrome extension's notification socket is opened with, which a browser's WebSocket cannot set itself: a declarativeNetRequest session rule adds them to the websocket requests of one host

    The manifest needs the declarativeNetRequestWithHostAccess permission and the notification host among its host_permissions, as https://eu.tectonic.remarkable.com/*.

    Index
    • Parameters

      • rules: SessionRules

        chrome.declarativeNetRequest

      • options: { initiator?: string; ruleId?: number } = {}

        ruleId, the id the rule goes under, if the default is taken; and initiator, chrome.runtime.id, to leave the sockets pages open to the same host alone

      Returns SocketAuthorization

    • add headers to every websocket request to the host of url, replacing what was installed before; call again whenever the session token changes

      Parameters

      • url: string
      • headers: [string, string][]

      Returns Promise<void>

    • take the rule out, when signing out

      Returns Promise<void>