ChemPal Documentation - v1.18.0
    Preparing search index...

    Function runInBackgroundContext

    • Marks this context as the service worker, so backgroundFetch calls fetch directly. A worker's runtime.sendMessage is never delivered to itself. Set explicitly rather than detected, because Firefox runs the same script as an event page, which does have a window.

      Returns void

      runInBackgroundContext(); // once, from the service worker
      
      export function runInBackgroundContext(): void {
      inBackgroundContext = true;
      }