-
-
Save Happy-Ferret/6d2d9f49f653bad1925e179b3d5283ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var app = require('app'); | |
| var dockMenu = [ | |
| { label: 'New Window', click: () => newWindow() }, | |
| { label: 'New Private Window', click: () => newWindow({isPrivate:true}) }, | |
| ]; | |
| app.dock.setMenu(dockMenu); | |
| var BrowserWindow = require('browser-window'); | |
| app.on('window-all-closed', function() { | |
| app.quit(); | |
| }); | |
| let downloadCount = 0; | |
| function newWindow({isPrivate}) { | |
| var win = new BrowserWindow({ width: 800, height: 600, show: false }); | |
| win.on('closed', () => { | |
| win = null; | |
| }); | |
| win.loadUrl('./browser.html'); | |
| win.show(); | |
| win.maximise(); | |
| win.on('download-done', (progress) => { | |
| app.dock.bounce(); | |
| downloadCount++; | |
| app.dock.setBadge(downloadCount) | |
| }); | |
| } | |
| newWindow(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment