|
|
|
@ -4,8 +4,8 @@ const paths = require('../paths');
|
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = (opts, preload, url) => {
|
|
|
|
|
const win = new BrowserWindow({
|
|
|
|
|
module.exports = (o, preload, u) => {
|
|
|
|
|
const w = new BrowserWindow({
|
|
|
|
|
center: true,
|
|
|
|
|
frame: false,
|
|
|
|
|
resizable: false,
|
|
|
|
@ -14,17 +14,17 @@ module.exports = (opts, preload, url) => {
|
|
|
|
|
webPreferences: {
|
|
|
|
|
preload
|
|
|
|
|
},
|
|
|
|
|
...opts
|
|
|
|
|
...o
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const wc = win.webContents;
|
|
|
|
|
wc.once('dom-ready', () => {
|
|
|
|
|
const c = w.webContents;
|
|
|
|
|
c.once('dom-ready', () => {
|
|
|
|
|
if (oaConfig.themeSync !== false) try {
|
|
|
|
|
wc.insertCSS(JSON.parse(fs.readFileSync(join(paths.getUserData(), 'userDataCache.json'), 'utf8')).openasarSplashCSS);
|
|
|
|
|
c.insertCSS(JSON.parse(fs.readFileSync(join(paths.getUserData(), 'userDataCache.json'), 'utf8')).openasarSplashCSS);
|
|
|
|
|
} catch { }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
win.loadURL(url);
|
|
|
|
|
w.loadURL('https://cdn.openasar.dev/' + u);
|
|
|
|
|
|
|
|
|
|
return win;
|
|
|
|
|
return w;
|
|
|
|
|
};
|