demos/epcp/browser-webworkers-demo/src/index.js
/** Get web browser globals { window, document } in a blessed way, or error */
Get web browser globals { window, document } in a blessed way, or error
Get web browser globals { window document } in a blessed way or error
function webContext() {
  const window = typeof global.window !== "undefined" && global.window;
  const document = typeof global.document !== "undefined" && global.document;
  const context = { document, window };
  if (!context.document) {
    throw new Error(
      "pubcontrol browser-demo must be run with a global document"
    );
  }
  return context;
}
function webContext ( ) { const window = typeof global . window !== "undefined" && global . window ; const document = typeof global . document !== "undefined" && global . document ; const context = { document , window } ; if ( ! context . document ) { throw new Error ( "pubcontrol browser-demo must be run with a global document" ) ; } return context ; }
Get web browser globals { window, document } in a blessed way, or error
Get web browser globals { window document } in a blessed way or error