[Utils > Win] Tweak internals
This commit is contained in:
		
							parent
							
								
									8bfca99053
								
							
						
					
					
						commit
						97e4fcf149
					
				
					 3 changed files with 10 additions and 10 deletions
				
			
		|  | @ -9,7 +9,7 @@ const open = exports.open = () => { | |||
|   const win = require('../utils/win')({ | ||||
|     width: 500, | ||||
|     height: 650 | ||||
|   }, join(__dirname, 'preload.js'), 'https://cdn.openasar.dev/config'); | ||||
|   }, join(__dirname, 'preload.js'), 'config'); | ||||
| 
 | ||||
|   let config = settings.get('openasar', {}); | ||||
|   config.setup = true; | ||||
|  |  | |||
|  | @ -68,7 +68,7 @@ const launchSplash = (startMin) => { | |||
|   win = require('../utils/win')({ | ||||
|     width: 300, | ||||
|     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()); | ||||
| 
 | ||||
|  |  | |||
|  | @ -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; | ||||
| }; | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue