update to wabac.js 2.9.0-beta.0, smaller file size, loading improvements
ruffle: support for ruffle for flash loading, both hosted and in app electron: update to latest beta (14) for latest chromium version embed error messages: better error message when service worker can not be found electron: build universal app for osx bump to 1.5.0!
This commit is contained in:
+2
-1
@@ -158,7 +158,8 @@ class ReplayWebApp extends LitElement
|
||||
|
||||
renderNavBar() {
|
||||
return html`
|
||||
<a href="#skip-main-target" @click=${this.skipMenu} class="skip-link">Skip main navigation</a>
|
||||
${IS_APP ? "" :
|
||||
html`<a href="#skip-main-target" @click=${this.skipMenu} class="skip-link">Skip main navigation</a>`}
|
||||
<nav class="navbar has-background-info" aria-label="main">
|
||||
<div class="navbar-brand">
|
||||
${!this.embed ? html`
|
||||
|
||||
@@ -180,13 +180,14 @@ class ElectronReplayApp
|
||||
this.screenSize = screen.getPrimaryDisplay().workAreaSize;
|
||||
|
||||
app.on("web-contents-created", (event, contents) => {
|
||||
contents.on("new-window", async (event, navigationUrl) => {
|
||||
|
||||
contents.setWindowOpenHandler(({url}) => {
|
||||
// load docs in native browser for now
|
||||
if (navigationUrl === STATIC_PREFIX + "docs") {
|
||||
event.preventDefault();
|
||||
await shell.openExternal("https://replayweb.page/docs/");
|
||||
if (url === STATIC_PREFIX + "docs") {
|
||||
shell.openExternal("https://replayweb.page/docs/");
|
||||
return { action: "deny"};
|
||||
}
|
||||
|
||||
return { action: "allow"};
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+6
-11
@@ -55,19 +55,18 @@ class Embed extends LitElement
|
||||
hashString: { type: String },
|
||||
|
||||
deepLink: { type: Boolean },
|
||||
noSW: { type: Boolean },
|
||||
noSandbox: { type: Boolean }
|
||||
noSandbox: { type: Boolean },
|
||||
|
||||
errorMessage: { type: String }
|
||||
};
|
||||
}
|
||||
|
||||
async doRegister() {
|
||||
try {
|
||||
await registerSW(this.swName, this.replaybase);
|
||||
console.log("done");
|
||||
this.swInited = true;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
this.noSW = true;
|
||||
this.errorMessage = e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,16 +183,12 @@ class Embed extends LitElement
|
||||
|
||||
` : html``}
|
||||
|
||||
${this.noSW ? html`
|
||||
${this.errorMessage ? html`
|
||||
<section class="full-width">
|
||||
<div class="has-text-centered">
|
||||
<fa-icon class="logo" id="wrlogo" size="2.5rem" .svg=${rwpLogo} aria-hidden="true"></fa-icon>
|
||||
</div>
|
||||
<div class="error">
|
||||
Sorry, ReplayWeb.page won't work in this browser as Service Workers are not supported.
|
||||
Please try a different browser.\n
|
||||
(Service Workers are disabled in Firefox in Private Mode. If Using Private Mode in Firefox, try regular mode).
|
||||
</div>
|
||||
<div class="error">${this.errorMessage}</div>
|
||||
</section>
|
||||
`: ""}`;
|
||||
}
|
||||
|
||||
+6
-3
@@ -11,8 +11,11 @@ function registerSW(name = "sw.js", scope = "./") {
|
||||
});
|
||||
|
||||
if (!navigator.serviceWorker) {
|
||||
console.error("Service Workers not supported");
|
||||
reject();
|
||||
const errMsg = `Sorry, ReplayWeb.page won't work in this browser as Service Workers are not supported.
|
||||
Please try a different browser.
|
||||
(Service Workers are disabled in Firefox in Private Mode. If Using Private Mode in Firefox, try regular mode)`;
|
||||
console.error(errMsg);
|
||||
reject(errMsg);
|
||||
}
|
||||
|
||||
register(scope + name, {
|
||||
@@ -24,7 +27,7 @@ function registerSW(name = "sw.js", scope = "./") {
|
||||
|
||||
error (error) {
|
||||
console.error("Error during service worker registration:", error);
|
||||
reject();
|
||||
reject(`ReplayWeb.page could not be loaded due to the following error:\n${error.toString()}`);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -11,6 +11,13 @@ staticData.set(prefix + "index.html", {type: "text/html", content: INDEX_HTML});
|
||||
//staticData.set(prefix + "ui.js", {type: "application/javascript", content: UI_JS});
|
||||
|
||||
//const { SWReplay } = require('@webrecorder/wabac/src/swmain');
|
||||
|
||||
const defaultConfig = {
|
||||
injectScripts: ["ruffle/ruffle.js"],
|
||||
};
|
||||
|
||||
self.ipfsCustomPreload = true;
|
||||
self.sw = new SWReplay({staticData});
|
||||
self.sw = new SWReplay({staticData, defaultConfig});
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user