2023-07-06 08:20:34 +00:00
|
|
|
const { app, BrowserWindow } = require('electron');
|
|
|
|
|
|
|
|
app.whenReady().then(() => {
|
|
|
|
const win = new BrowserWindow({
|
|
|
|
webPreferences: {
|
|
|
|
webviewTag: true
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
win.loadFile('index.html');
|
|
|
|
|
|
|
|
win.webContents.on('did-attach-webview', (event, contents) => {
|
|
|
|
contents.on('render-process-gone', () => {
|
|
|
|
process.exit(1);
|
|
|
|
});
|
|
|
|
|
|
|
|
contents.on('destroyed', () => {
|
|
|
|
process.exit(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
contents.on('did-finish-load', () => {
|
2023-12-13 21:01:03 +00:00
|
|
|
win.webContents.executeJavaScript('closeBtn.click()');
|
2023-07-06 08:20:34 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
contents.on('will-prevent-unload', event => {
|
|
|
|
event.preventDefault();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|