license / docs pass:
- add new docs for loading, exploring, sharing, embedding, and offline usage - add license file / license banner electron app: - for now, don't bundle docs, open in native browser embeds: - support 'embed' option, 'replayonly' or 'full' (default if no url) ui: - display package.json version in info menu package.json: - update scripts to match README - move electron entrypoint into extraMetadata - add scripts for packaging as module README: minor edits
This commit is contained in:
@@ -162,6 +162,10 @@ class App extends LitElement
|
||||
<div class="navbar-item">
|
||||
Collection Id: <b>${this.collInfo.coll}</b>
|
||||
</div>
|
||||
<hr class="navbar-divider">
|
||||
<div class="navbar-item">
|
||||
ReplayWeb.page Version: ${__VERSION__}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
` : ``}
|
||||
|
||||
+14
-5
@@ -3,7 +3,7 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { Headers } from 'node-fetch';
|
||||
|
||||
import {app, session, BrowserWindow, ipcMain} from 'electron';
|
||||
import {app, session, BrowserWindow, ipcMain, shell} from 'electron';
|
||||
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
@@ -20,9 +20,6 @@ const STATIC_PREFIX = "http://localhost:5471/";
|
||||
|
||||
const REPLAY_PREFIX = STATIC_PREFIX + "wabac/";
|
||||
|
||||
const HTML_TYPE = 'text/html; charset="utf-8"';
|
||||
const JS_TYPE = 'application/javascript; charset="utf-8"';
|
||||
|
||||
const URL_RX = /([^\/]+)\/([\d]+)(?:\w\w_)?\/(.*)$/;
|
||||
|
||||
const appPath = app.getAppPath();
|
||||
@@ -290,7 +287,8 @@ function createWindow () {
|
||||
plugins: true,
|
||||
preload: path.join(__dirname, 'preload.js'),
|
||||
nativeWindowOpen: true,
|
||||
contextIsolation: true
|
||||
contextIsolation: true,
|
||||
enableRemoteModule: false
|
||||
}
|
||||
}).once('ready-to-show', () => {
|
||||
|
||||
@@ -315,6 +313,17 @@ function createWindow () {
|
||||
}
|
||||
}
|
||||
|
||||
app.on('web-contents-created', (event, contents) => {
|
||||
contents.on('new-window', async (event, navigationUrl) => {
|
||||
|
||||
// load docs in native browser for now
|
||||
if (navigationUrl === STATIC_PREFIX + "docs") {
|
||||
event.preventDefault();
|
||||
await shell.openExternal("https://replayweb.page/docs/");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
|
||||
+8
-1
@@ -21,6 +21,7 @@ class Embed extends LitElement
|
||||
this.paramString = null;
|
||||
this.deepLink = false;
|
||||
this.swInited = false;
|
||||
this.embed = null;
|
||||
|
||||
this.doRegister();
|
||||
}
|
||||
@@ -30,6 +31,8 @@ class Embed extends LitElement
|
||||
url: { type: String },
|
||||
ts: { type: String },
|
||||
source: { type: String },
|
||||
view: { type: String },
|
||||
embed: { type: String },
|
||||
|
||||
replayBase: { type: String },
|
||||
swName: { type: String },
|
||||
@@ -101,11 +104,15 @@ class Embed extends LitElement
|
||||
changedProperties.has("ts") ||
|
||||
changedProperties.has("source")) {
|
||||
|
||||
if (this.embed === null) {
|
||||
this.embed = this.url ? "replayonly" : "";
|
||||
}
|
||||
|
||||
this.paramString = new URLSearchParams({
|
||||
source: this.source,
|
||||
customColl: this.coll,
|
||||
config: this.config,
|
||||
embed: "true"
|
||||
embed: this.embed,
|
||||
}).toString();
|
||||
|
||||
this.hashString = new URLSearchParams({
|
||||
|
||||
Reference in New Issue
Block a user