-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
1,804 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |
Oops, something went wrong.