aboutsummaryrefslogtreecommitdiff
path: root/crash/wrapper.js
diff options
context:
space:
mode:
Diffstat (limited to 'crash/wrapper.js')
-rw-r--r--crash/wrapper.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/crash/wrapper.js b/crash/wrapper.js
new file mode 100644
index 0000000..ba5a8b9
--- /dev/null
+++ b/crash/wrapper.js
@@ -0,0 +1,41 @@
+const { app, BrowserWindow } = require('electron')
+
+if (require('fs').existsSync(require('os').userInfo().homedir + "/.kartik/config/lang.txt")) {
+ lp = require('fs').readFileSync(require('os').userInfo().homedir + "/.kartik/config/lang.txt").toString();
+}
+
+function createWindow () {
+ const win = new BrowserWindow({
+ width: 800,
+ height: 375,
+ resizeable: false,
+ resizable: false,
+ maximizable: false,
+ bgColor: "#ffffff",
+ title: "Kartik",
+ webPreferences: {
+ nodeIntegration: true,
+ contextIsolation: false,
+ enableRemoteModule: true,
+ webviewTag: true
+ }
+ })
+
+ win.lp = lp;
+ win.loadFile('crash.html')
+ win.setMenu(null);
+}
+
+app.whenReady().then(createWindow)
+
+app.on('window-all-closed', () => {
+ if (process.platform !== 'darwin') {
+ app.quit()
+ }
+})
+
+app.on('activate', () => {
+ if (BrowserWindow.getAllWindows().length === 0) {
+ createWindow()
+ }
+}) \ No newline at end of file