misc fixes:
- import from '@webrecorder/wabac' package for sw.js, though using github overrides for now - replay: show loading spinner on beforeunload event in iframe - embed: support passing basePageUrl param as part of extraConfig for custom top-level page
This commit is contained in:
+9
-3
@@ -123,7 +123,7 @@ class Replay extends LitElement
|
||||
this.replayTS = event.data.ts;
|
||||
this.replayUrl = event.data.url;
|
||||
this.title = event.data.title || this.title;
|
||||
this.clearLoading();
|
||||
this.clearLoading(iframe.contentWindow);
|
||||
|
||||
if (event.data.icons) {
|
||||
const icons = event.data.icons;
|
||||
@@ -166,17 +166,23 @@ class Replay extends LitElement
|
||||
const iframe = this.renderRoot.querySelector("iframe");
|
||||
if (!iframe || !iframe.contentDocument || !iframe.contentWindow ||
|
||||
(iframe.contentDocument.readyState === "complete" && !iframe.contentWindow._WBWombat)) {
|
||||
this.clearLoading();
|
||||
this.clearLoading(iframe && iframe.contentWindow);
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
clearLoading() {
|
||||
clearLoading(iframeWin) {
|
||||
this.isLoading = false;
|
||||
if (this._loadPoll) {
|
||||
window.clearInterval(this._loadPoll);
|
||||
this._loadPoll = null;
|
||||
}
|
||||
|
||||
if (iframeWin) {
|
||||
iframeWin.addEventListener("beforeunload", () => {
|
||||
this.isLoading = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
static get styles() {
|
||||
|
||||
Reference in New Issue
Block a user