code: 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;
  }
docs: Get web browser globals { window, document } in a blessed way, or error