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:
+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.
|
||||
|
||||
Reference in New Issue
Block a user