Files
koodo-reader/main.ts
troyeguo fdabfca004 fix bug
Former-commit-id: e73ddeb03809842360d9f3b8895ef083f197ad8e
2020-08-28 20:37:38 +08:00

35 lines
796 B
TypeScript

const { app, BrowserWindow, dialog, shell, remote } = require("electron");
const isDev = require("electron-is-dev");
const path = require("path");
const fontList = require("font-list");
fontList
.getFonts()
.then((fonts: any[]) => {
console.log(fonts);
})
.catch((err: any) => {
console.log("epub");
});
let mainWindow;
app.on("ready", () => {
// console.log("before message box");
mainWindow = new BrowserWindow({
width: 1030,
height: 660,
webPreferences: {
nodeIntegration: false,
},
});
if (!isDev) {
const { Menu } = require("electron");
Menu.setApplicationMenu(null);
}
const urlLocation = isDev
? "http://localhost:3000/"
: `file://${path.join(__dirname, "./build/index.html")}`;
mainWindow.loadURL(urlLocation);
});