Add a 'noWebWorker=true' option to <replay-web-page> embed to disable loading in separate web worker (#102)
* add a 'noWebWorker' option to <replay-web-page> embed to disable the default webworker-based loading, and load via the service worker directly. this feature was previously available, but turned-off, as its less efficient (uses sw for what can be done in a separate web worker thread). however, service-worker based loading may be needed for certain edge cases (see #97), and this option enables this loading method to be turned back on for embedding. * docs: update guide to include 'noWebWorker', also use include attribute for boolean attributes * update CHANGES.md * bump to 1.5.12
This commit is contained in:
+10
-2
@@ -29,6 +29,7 @@ class Embed extends LitElement
|
||||
this.embed = null;
|
||||
this.reloadCount = 0;
|
||||
this.noSandbox = false;
|
||||
this.noWebWorker = false;
|
||||
}
|
||||
|
||||
static get properties() {
|
||||
@@ -56,6 +57,7 @@ class Embed extends LitElement
|
||||
|
||||
deepLink: { type: Boolean },
|
||||
noSandbox: { type: Boolean },
|
||||
noWebWorker: { type: Boolean },
|
||||
|
||||
errorMessage: { type: String }
|
||||
};
|
||||
@@ -126,13 +128,19 @@ class Embed extends LitElement
|
||||
|
||||
const source = new URL(this.source, document.baseURI);
|
||||
|
||||
this.paramString = new URLSearchParams({
|
||||
const params = {
|
||||
source,
|
||||
customColl: this.coll,
|
||||
config: this.config,
|
||||
basePageUrl: window.location.href.split("#")[0],
|
||||
embed: this.embed,
|
||||
}).toString();
|
||||
};
|
||||
|
||||
if (this.noWebWorker) {
|
||||
params.noWebWorker = "1";
|
||||
}
|
||||
|
||||
this.paramString = new URLSearchParams(params).toString();
|
||||
|
||||
this.hashString = new URLSearchParams({
|
||||
url: this.url,
|
||||
|
||||
Reference in New Issue
Block a user