From a97ac88bed9c9943e5ff8b0a1d77f9f34b98c9cb Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 2 Sep 2020 01:40:26 +0300 Subject: [PATCH] minor tweak + now firefox unbroken... Signed-off-by: Alex A. Naanou --- Viewer/cfg/requirejs.js | 9 ++++----- Viewer/e.js | 9 +++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Viewer/cfg/requirejs.js b/Viewer/cfg/requirejs.js index 6ce2aac5..185ea37d 100644 --- a/Viewer/cfg/requirejs.js +++ b/Viewer/cfg/requirejs.js @@ -5,14 +5,13 @@ **********************************************************************/ var requirejs_cfg = { - // NOTE: on electron v7+ the default seems to be '../', bug? - //baseUrl: './', - baseUrl: typeof(document) != 'undefined' ? + baseUrl: + // electron... + // NOTE: on electron v7+ the default seems to be '../', a bug? + typeof(process) != 'undefined' && 'electron' in process.versions ? document.baseURI .replace(/^[a-zA-Z]+:\/\/\/?/, '') .split(/[#&]/)[0].split(/[\\\/]/g).slice(0, -1).join('/') - : typeof(process) != 'undefined' ? - process.cwd().replace(/\\/g, '/')+'/' : './', // XXX this does not work on direct filesystem access... diff --git a/Viewer/e.js b/Viewer/e.js index fdebf18a..18e757f9 100644 --- a/Viewer/e.js +++ b/Viewer/e.js @@ -164,24 +164,21 @@ function createWindow(){ // Some APIs can only be used after this event occurs. app.on('ready', function(){ createSplash() - createWindow() -}) + createWindow() }) // Quit when all windows are closed. // On macOS it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q app.on('window-all-closed', function(){ process.platform !== 'darwin' - && app.quit() -}) + && app.quit() }) // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. // XXX needs testing... app.on('activate', function(){ win === null - && createWindow() -}) + && createWindow() })