[Utils > Win] Tweak internals
This commit is contained in:
parent
8bfca99053
commit
97e4fcf149
|
@ -9,7 +9,7 @@ const open = exports.open = () => {
|
||||||
const win = require('../utils/win')({
|
const win = require('../utils/win')({
|
||||||
width: 500,
|
width: 500,
|
||||||
height: 650
|
height: 650
|
||||||
}, join(__dirname, 'preload.js'), 'https://cdn.openasar.dev/config');
|
}, join(__dirname, 'preload.js'), 'config');
|
||||||
|
|
||||||
let config = settings.get('openasar', {});
|
let config = settings.get('openasar', {});
|
||||||
config.setup = true;
|
config.setup = true;
|
||||||
|
|
|
@ -68,7 +68,7 @@ const launchSplash = (startMin) => {
|
||||||
win = require('../utils/win')({
|
win = require('../utils/win')({
|
||||||
width: 300,
|
width: 300,
|
||||||
height: process.platform === 'darwin' ? 300 : 350
|
height: process.platform === 'darwin' ? 300 : 350
|
||||||
}, join(__dirname, 'preload.js'), 'https://cdn.openasar.dev/splash');
|
}, join(__dirname, 'preload.js'), 'splash');
|
||||||
|
|
||||||
if (process.platform !== 'darwin') win.on('closed', () => !launchedMainWindow && app.quit());
|
if (process.platform !== 'darwin') win.on('closed', () => !launchedMainWindow && app.quit());
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ const paths = require('../paths');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
|
||||||
module.exports = (opts, preload, url) => {
|
module.exports = (o, preload, u) => {
|
||||||
const win = new BrowserWindow({
|
const w = new BrowserWindow({
|
||||||
center: true,
|
center: true,
|
||||||
frame: false,
|
frame: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
|
@ -14,17 +14,17 @@ module.exports = (opts, preload, url) => {
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload
|
preload
|
||||||
},
|
},
|
||||||
...opts
|
...o
|
||||||
});
|
});
|
||||||
|
|
||||||
const wc = win.webContents;
|
const c = w.webContents;
|
||||||
wc.once('dom-ready', () => {
|
c.once('dom-ready', () => {
|
||||||
if (oaConfig.themeSync !== false) try {
|
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 { }
|
} catch { }
|
||||||
});
|
});
|
||||||
|
|
||||||
win.loadURL(url);
|
w.loadURL('https://cdn.openasar.dev/' + u);
|
||||||
|
|
||||||
return win;
|
return w;
|
||||||
};
|
};
|
Loading…
Reference in New Issue