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

    Module helpers/cookies

    Functions - Helpers

    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).

    setCookie

    Writes a cookie into the browser cookie jar so the storefront returns it on subsequent requests made with credentials: "include". No-ops with a warning when the API is unavailable, and swallows write failures (logging them) so a failed seed never aborts the surrounding query.

    getCookies

    Reads every cookie the jar holds for the given URL. Useful for verifying that session cookies are being stored/updated across requests. Returns an empty array when the API is unavailable or the read fails.

    getCookie

    Reads a single named cookie for the given URL. Returns null when the cookie is absent, the API is unavailable, or the read fails.