tabs/src/main.ts

22 lines
650 B
TypeScript
Raw Normal View History

2020-05-21 07:38:44 +02:00
import SingleInstance from "single-instance";
2020-05-22 10:25:19 +02:00
import {app} from "electron";
import Meta from "./Meta";
2020-05-22 10:25:19 +02:00
import Application from "./Application";
// Fix for twitter (and others) in webviews - pending https://github.com/electron/electron/issues/25469
app.commandLine.appendSwitch('disable-features', 'CrossOriginOpenerPolicy');
2020-05-22 10:25:19 +02:00
const application = new Application(Meta.isDevMode());
2020-05-21 07:38:44 +02:00
// Check if application is already running
const lock = new SingleInstance('tabs-app');
lock.lock().then(() => {
app.on('ready', () => {
2020-05-22 10:25:19 +02:00
application.start().catch(console.error);
2020-05-21 07:38:44 +02:00
});
}).catch(err => {
console.error(err);
process.exit(0);
});