Skip to content

Commit

Permalink
restore electron (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
heswell committed Jun 4, 2023
1 parent cd3edf2 commit c4fb04d
Show file tree
Hide file tree
Showing 4 changed files with 1,804 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vuu-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"build:packages:debug": "npm run build -- --cjs --debug && npm run type-defs -- --debug",
"build:salt": "node ./scripts/build-salt.mjs",
"launch:demo": "node ./scripts/launch-app.mjs",
"launch:demo:electron": "cd tools/electron && node ./node_modules/.bin/electron .",
"launch:showcase": " cd showcase && node scripts/launch.mjs",
"deploy:websocket-test": "node ./tools/deploy-websocket-test.mjs",
"view-bundle": "node ./scripts/visualize-bundle.mjs",
"type-defs": "node ./scripts/build-all-type-defs.mjs",
"start:electron": "cd packages/electron && node ./node_modules/.bin/electron .",
"showcase": "cd showcase && npm run showcase",
"showcase:preview": "cd showcase && npm run preview",
"showcase:build": " cd showcase && node scripts/build.mjs",
Expand Down
35 changes: 35 additions & 0 deletions vuu-ui/tools/electron/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const { app, BrowserWindow } = require('electron');

app.commandLine.appendSwitch('allow-insecure-localhost');

const createWindow = async () => {
const mainWindow = new BrowserWindow({
width: 1200,
height: 600,
webPreferences: {
webSecurity: true,
plugins: true
}
});

//mainWindow.webContents.openDevTools();

mainWindow.loadURL('https://localhost:8443/index.html');

mainWindow.maximize();

};

app.on('certificate-error', (event, webContents, url, error, cert, callback) => {
// Do some verification based on the URL to not allow potentially malicious certs:
//if (url.startsWith ("https://localhost:8443/index.html")) {
// Hint: For more security, you may actually perform some checks against
// the passed certificate (parameter "cert") right here
event.preventDefault(); // Stop Chromium from rejecting the certificate
callback(true); // Trust this certificate
//} else callback (false); // Let Chromium do its thing
});

app.whenReady().then(() => {
createWindow();
});
Loading

0 comments on commit c4fb04d

Please sign in to comment.