MCPcopy Index your code
hub / github.com/Soundnode/soundnode-app / initMainWindow

Function initMainWindow

main.js:82–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80}
81
82function initMainWindow() {
83 let mainWindowState = windowStateKeeper({
84 defaultWidth: 1180,
85 defaultHeight: 755
86 });
87
88 mainWindow = new BrowserWindow({
89 x: mainWindowState.x,
90 y: mainWindowState.y,
91 width: mainWindowState.width,
92 height: mainWindowState.height,
93 minWidth: 800,
94 minHeight: 640,
95 center: true,
96 frame: false
97 });
98
99 mainWindow.loadURL(`file://${__dirname}/app/index.html`);
100
101 if (process.env.NODE_ENV === 'development') {
102 mainWindow.webContents.openDevTools();
103 }
104
105 mainWindow.webContents.on('will-navigate', function (e, url) {
106 if (url.indexOf('build/index.html#') < 0) {
107 e.preventDefault();
108 }
109 });
110
111 mainWindow.webContents.on('did-finish-load', function () {
112 mainWindow.setTitle('Soundnode');
113 mainWindow.show();
114 mainWindow.focus();
115 });
116
117 mainWindowState.manage(mainWindow);
118 initializeMediaShortcuts();
119 menuBar();
120}
121
122app.on('will-quit', () => {
123 // Unregister all shortcuts.

Callers 2

checkUserConfigFunction · 0.85
setUserDataFunction · 0.85

Calls 2

initializeMediaShortcutsFunction · 0.85
menuBarFunction · 0.85

Tested by

no test coverage detected