ChemPal Documentation - v0.0.13-beta.5
    Preparing search index...

    Function isCookiesApiAvailable

    • Reports whether the chrome.cookies API is usable in the current context. It is undefined unless the extension has the "cookies" permission and the host permission for the origin, so callers guard with this to degrade gracefully (dev fallback, or when a user hasn't accepted the upgraded permission set yet).

      Returns boolean

      true when chrome.cookies is available, otherwise false

      isCookiesApiAvailable() // true inside the extension, false in unit tests
      
      export function isCookiesApiAvailable(): boolean {
      return typeof chrome !== "undefined" && Boolean(chrome.cookies);
      }