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:
Ilya Kreymer
2022-06-15 11:38:04 -07:00
committed by GitHub
parent 789e5ba2b1
commit 36da7fa2c6
10 changed files with 234 additions and 198 deletions
+10 -2
View File
@@ -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,