diff --git a/demo.css b/demo.css new file mode 100644 index 0000000..123f069 --- /dev/null +++ b/demo.css @@ -0,0 +1,35 @@ +* { + box-sizing: border-box; + } + + body { + padding: 50px; + font-family: 'helvetica neue', helvetica, arial; + } + + #search-box input { + padding: 10px; + width: 100%; + } + + .ais-hits--item { + padding: 10px; + } + + .ais-hits--item em { + background-color: yellow; + } + + .ais-search-box--magnifier { + display: none; + } + + .ais-search-box--reset { + top: 12px; + width: 30px; + height: 30px; + border: none; + position: absolute; + right: 10px; + opacity: 0.2; + } \ No newline at end of file diff --git a/demo.js b/demo.js index 7bc3d1a..832db46 100644 --- a/demo.js +++ b/demo.js @@ -4,44 +4,6 @@ document.title = 'Electron Search' const $main = html`
- -
diff --git a/index.json b/index.json index 6e84a04..de91569 100644 --- a/index.json +++ b/index.json @@ -2,8 +2,9 @@ { "name": "will-finish-launching", "description": "Emitted when the application has finished basic startup. On Windows and Linux, the will-finish-launching event is the same as the ready event; on macOS, this event represents the applicationWillFinishLaunching notification of NSApplication. You would usually set up listeners for the open-file and open-url events here, and start the crash reporter and auto updater. In most cases, you should just do everything in the ready event handler.", + "type": "api", + "apiType": "event", "title": "app.on('will-finish-launching')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-will-finish-launching", "tldr": "Emitted when the application has finished basic startup." }, @@ -18,16 +19,18 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('ready')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-ready", "tldr": "Emitted when Electron has finished initializing." }, { "name": "window-all-closed", "description": "Emitted when all windows have been closed. If you do not subscribe to this event and all windows are closed, the default behavior is to quit the app; however, if you subscribe, you control whether the app quits or not. If the user pressed Cmd + Q, or the developer called app.quit(), Electron will first try to close all the windows and then emit the will-quit event, and in this case the window-all-closed event would not be emitted.", + "type": "api", + "apiType": "event", "title": "app.on('window-all-closed')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-window-all-closed", "tldr": "Emitted when all windows have been closed." }, @@ -42,8 +45,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('before-quit')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-before-quit", "tldr": "Emitted before the application starts closing its windows." }, @@ -58,8 +62,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('will-quit')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-will-quit", "tldr": "Emitted when all windows have been closed and the application will quit." }, @@ -80,8 +85,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('quit')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-quit", "tldr": "Emitted when the application is quitting.." }, @@ -105,8 +111,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('open-file')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-open-file", "tldr": "Emitted when the user wants to open a file with the application." }, @@ -130,8 +137,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('open-url')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-open-url", "tldr": "Emitted when the user wants to open a URL with the application." }, @@ -155,8 +163,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('activate')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-activate", "tldr": "Emitted when the application is activated." }, @@ -188,8 +197,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('continue-activity')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-continue-activity", "tldr": "Emitted during Handoff when an activity from a different device wants to be resumed." }, @@ -214,8 +224,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('will-continue-activity')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-will-continue-activity", "tldr": "Emitted during Handoff before an activity from a different device wants to be resumed." }, @@ -247,8 +258,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('continue-activity-error')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-continue-activity-error", "tldr": "Emitted during Handoff when an activity from a different device fails to be resumed.." }, @@ -280,8 +292,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('activity-was-continued')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-activity-was-continued", "tldr": "Emitted during Handoff after an activity from this device was successfully resumed on another one.." }, @@ -313,8 +326,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('update-activity-state')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-update-activity-state", "tldr": "Emitted when Handoff is about to be resumed on another device." }, @@ -332,8 +346,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('new-window-for-tab')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-new-window-for-tab", "tldr": "Emitted when the user clicks the native macOS new tab button." }, @@ -354,8 +369,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('browser-window-blur')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-browser-window-blur", "tldr": "Emitted when a browserWindow gets blurred.." }, @@ -376,8 +392,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('browser-window-focus')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-browser-window-focus", "tldr": "Emitted when a browserWindow gets focused.." }, @@ -398,8 +415,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('browser-window-created')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-browser-window-created", "tldr": "Emitted when a new browserWindow is created.." }, @@ -420,8 +438,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('web-contents-created')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-web-contents-created", "tldr": "Emitted when a new webContents is created.." }, @@ -476,8 +495,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "app.on('certificate-error')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-certificate-error", "tldr": "Emitted when failed to verify the certificate for url, to trust the certificate you should prevent the default behavior with event.preventDefault() and call callback(true).." }, @@ -525,8 +545,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "app.on('select-client-certificate')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-select-client-certificate", "tldr": "Emitted when a client certificate is requested." }, @@ -641,8 +662,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "app.on('login')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-login", "tldr": "Emitted when webContents wants to do basic auth." }, @@ -663,8 +685,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('gpu-process-crashed')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-gpu-process-crashed", "tldr": "Emitted when the gpu process crashes or is killed.." }, @@ -690,8 +713,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "app.on('accessibility-support-changed')", - "type": "event", "url": "https://electronjs.org/docs/api/app#event-accessibility-support-changed", "tldr": "Emitted when Chrome's accessibility support changes." }, @@ -706,32 +730,36 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "autoUpdater.on('error')", - "type": "event", "url": "https://electronjs.org/docs/api/auto-updater#event-error", "tldr": "Emitted when there is an error while updating.." }, { "name": "checking-for-update", "description": "Emitted when checking if an update has started.", + "type": "api", + "apiType": "event", "title": "autoUpdater.on('checking-for-update')", - "type": "event", "url": "https://electronjs.org/docs/api/auto-updater#event-checking-for-update", "tldr": "Emitted when checking if an update has started.." }, { "name": "update-available", "description": "Emitted when there is an available update. The update is downloaded automatically.", + "type": "api", + "apiType": "event", "title": "autoUpdater.on('update-available')", - "type": "event", "url": "https://electronjs.org/docs/api/auto-updater#event-update-available", "tldr": "Emitted when there is an available update." }, { "name": "update-not-available", "description": "Emitted when there is no available update.", + "type": "api", + "apiType": "event", "title": "autoUpdater.on('update-not-available')", - "type": "event", "url": "https://electronjs.org/docs/api/auto-updater#event-update-not-available", "tldr": "Emitted when there is no available update.." }, @@ -770,8 +798,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "autoUpdater.on('update-downloaded')", - "type": "event", "url": "https://electronjs.org/docs/api/auto-updater#event-update-downloaded", "tldr": "Emitted when an update has been downloaded." }, @@ -782,8 +811,9 @@ "collection": true, "description": "An array of all opened BrowserViews." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserView.getAllViews()", - "type": "staticMethod", "tldr": "Returns an array of all opened BrowserViews.", "url": "https://electronjs.org/docs/api/browser-view#browser-viewgetallviews" }, @@ -811,8 +841,9 @@ "collection": false, "description": "The BrowserView that owns the given webContents or null if the contents are not owned by a BrowserView." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserView.fromWebContents(webContents)", - "type": "staticMethod", "tldr": "Returns the BrowserView that owns the given webContents or null if the contents are not owned by a BrowserView.", "url": "https://electronjs.org/docs/api/browser-view#browser-viewfromwebcontents" }, @@ -831,16 +862,18 @@ "collection": false, "description": "The view with the given id." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserView.fromId(id)", - "type": "staticMethod", "tldr": "Returns the view with the given id.", "url": "https://electronjs.org/docs/api/browser-view#browser-viewfromid" }, { "name": "destroy", "description": "Force closing the view, the unload and beforeunload events won't be emitted for the web page. After you're done with a view, call this function in order to free memory and other resources as soon as possible.", + "type": "api", + "apiType": "instanceMethod", "title": "view.destroy()", - "type": "instanceMethod", "tldr": "Force closing the view, the unload and beforeunload events won't be emitted for the web page.", "url": "https://electronjs.org/docs/api/browser-view#browser-viewdestroy" }, @@ -851,8 +884,9 @@ "collection": false, "description": "Whether the view is destroyed." }, + "type": "api", + "apiType": "instanceMethod", "title": "view.isDestroyed()", - "type": "instanceMethod", "tldr": "Returns whether the view is destroyed.", "url": "https://electronjs.org/docs/api/browser-view#browser-viewisdestroyed" }, @@ -885,8 +919,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "view.setAutoResize(options)", - "type": "instanceMethod", "tldr": null, "url": "https://electronjs.org/docs/api/browser-view#browser-viewsetautoresize" }, @@ -904,8 +939,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "view.setBounds(bounds)", - "type": "instanceMethod", "tldr": "Resizes and moves the view to the supplied bounds relative to the window..", "url": "https://electronjs.org/docs/api/browser-view#browser-viewsetbounds" }, @@ -923,8 +959,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "view.setBackgroundColor(color)", - "type": "instanceMethod", "tldr": null, "url": "https://electronjs.org/docs/api/browser-view#browser-viewsetbackgroundcolor" }, @@ -935,8 +972,9 @@ "collection": true, "description": "An array of all opened browser windows." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.getAllWindows()", - "type": "staticMethod", "tldr": "Returns an array of all opened browser windows.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetallwindows" }, @@ -947,8 +985,9 @@ "collection": false, "description": "The window that is focused in this application, otherwise returns null." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.getFocusedWindow()", - "type": "staticMethod", "tldr": "Returns the window that is focused in this application, otherwise returns null.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetfocusedwindow" }, @@ -967,8 +1006,9 @@ "collection": false, "description": "The window that owns the given webContents." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.fromWebContents(webContents)", - "type": "staticMethod", "tldr": "Returns the window that owns the given webContents.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowfromwebcontents" }, @@ -996,8 +1036,9 @@ "collection": false, "description": "The window that owns the given browserView. If the given view is not attached to any window, returns null." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.fromBrowserView(browserView)", - "type": "staticMethod", "tldr": "Returns the window that owns the given browserView. If the given view is not attached to any window, returns null.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowfrombrowserview" }, @@ -1016,8 +1057,9 @@ "collection": false, "description": "The window with the given id." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.fromId(id)", - "type": "staticMethod", "tldr": "Returns the window with the given id.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowfromid" }, @@ -1032,8 +1074,9 @@ "required": true } ], + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.addExtension(path)", - "type": "staticMethod", "tldr": "Adds Chrome extension located at path, and returns extension's name.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowaddextension" }, @@ -1048,8 +1091,9 @@ "required": true } ], + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.removeExtension(name)", - "type": "staticMethod", "tldr": "Remove a Chrome extension by name.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowremoveextension" }, @@ -1061,8 +1105,9 @@ "collection": false, "description": "The keys are the extension names and each value is an Object containing name and version properties." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.getExtensions()", - "type": "staticMethod", "tldr": "Note: This API cannot be called before the ready event of the app module is emitted..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetextensions" }, @@ -1077,8 +1122,9 @@ "required": true } ], + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.addDevToolsExtension(path)", - "type": "staticMethod", "tldr": "Adds DevTools extension located at path, and returns extension's name.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowadddevtoolsextension" }, @@ -1093,8 +1139,9 @@ "required": true } ], + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.removeDevToolsExtension(name)", - "type": "staticMethod", "tldr": "Remove a DevTools extension by name.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowremovedevtoolsextension" }, @@ -1106,40 +1153,45 @@ "collection": false, "description": "The keys are the extension names and each value is an Object containing name and version properties." }, + "type": "api", + "apiType": "staticMethod", "title": "BrowserWindow.getDevToolsExtensions()", - "type": "staticMethod", "tldr": "To check if a DevTools extension is installed you can run the following: Note: This API cannot be called before the ready event of the app module is emitted..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetdevtoolsextensions" }, { "name": "destroy", "description": "Force closing the window, the unload and beforeunload event won't be emitted for the web page, and close event will also not be emitted for this window, but it guarantees the closed event will be emitted.", + "type": "api", + "apiType": "instanceMethod", "title": "win.destroy()", - "type": "instanceMethod", "tldr": "Force closing the window, the unload and beforeunload event won't be emitted for the web page, and close event will also not be emitted for this window, but it guarantees the closed event will be emitted..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowdestroy" }, { "name": "close", "description": "Try to close the window. This has the same effect as a user manually clicking the close button of the window. The web page may cancel the close though. See the close event.", + "type": "api", + "apiType": "instanceMethod", "title": "win.close()", - "type": "instanceMethod", "tldr": "Try to close the window.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowclose" }, { "name": "focus", "description": "Focuses on the window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.focus()", - "type": "instanceMethod", "tldr": "Focuses on the window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowfocus" }, { "name": "blur", "description": "Removes focus from the window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.blur()", - "type": "instanceMethod", "tldr": "Removes focus from the window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowblur" }, @@ -1150,8 +1202,9 @@ "collection": false, "description": "Whether the window is focused." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isFocused()", - "type": "instanceMethod", "tldr": "Returns whether the window is focused.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisfocused" }, @@ -1162,32 +1215,36 @@ "collection": false, "description": "Whether the window is destroyed." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isDestroyed()", - "type": "instanceMethod", "tldr": "Returns whether the window is destroyed.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisdestroyed" }, { "name": "show", "description": "Shows and gives focus to the window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.show()", - "type": "instanceMethod", "tldr": "Shows and gives focus to the window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowshow" }, { "name": "showInactive", "description": "Shows the window but doesn't focus on it.", + "type": "api", + "apiType": "instanceMethod", "title": "win.showInactive()", - "type": "instanceMethod", "tldr": "Shows the window but doesn't focus on it..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowshowinactive" }, { "name": "hide", "description": "Hides the window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.hide()", - "type": "instanceMethod", "tldr": "Hides the window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowhide" }, @@ -1198,8 +1255,9 @@ "collection": false, "description": "Whether the window is visible to the user." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isVisible()", - "type": "instanceMethod", "tldr": "Returns whether the window is visible to the user.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisvisible" }, @@ -1210,24 +1268,27 @@ "collection": false, "description": "Whether current window is a modal window." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isModal()", - "type": "instanceMethod", "tldr": "Returns whether current window is a modal window.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowismodal" }, { "name": "maximize", "description": "Maximizes the window. This will also show (but not focus) the window if it isn't being displayed already.", + "type": "api", + "apiType": "instanceMethod", "title": "win.maximize()", - "type": "instanceMethod", "tldr": "Maximizes the window.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowmaximize" }, { "name": "unmaximize", "description": "Unmaximizes the window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.unmaximize()", - "type": "instanceMethod", "tldr": "Unmaximizes the window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowunmaximize" }, @@ -1238,24 +1299,27 @@ "collection": false, "description": "Whether the window is maximized." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isMaximized()", - "type": "instanceMethod", "tldr": "Returns whether the window is maximized.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowismaximized" }, { "name": "minimize", "description": "Minimizes the window. On some platforms the minimized window will be shown in the Dock.", + "type": "api", + "apiType": "instanceMethod", "title": "win.minimize()", - "type": "instanceMethod", "tldr": "Minimizes the window.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowminimize" }, { "name": "restore", "description": "Restores the window from minimized state to its previous state.", + "type": "api", + "apiType": "instanceMethod", "title": "win.restore()", - "type": "instanceMethod", "tldr": "Restores the window from minimized state to its previous state..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowrestore" }, @@ -1266,8 +1330,9 @@ "collection": false, "description": "Whether the window is minimized." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isMinimized()", - "type": "instanceMethod", "tldr": "Returns whether the window is minimized.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisminimized" }, @@ -1282,8 +1347,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setFullScreen(flag)", - "type": "instanceMethod", "tldr": "Sets whether the window should be in fullscreen mode..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetfullscreen" }, @@ -1294,8 +1360,9 @@ "collection": false, "description": "Whether the window is in fullscreen mode." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isFullScreen()", - "type": "instanceMethod", "tldr": "Returns whether the window is in fullscreen mode.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisfullscreen" }, @@ -1313,8 +1380,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setSimpleFullScreen(flag)", - "type": "instanceMethod", "tldr": "Enters or leaves simple fullscreen mode.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetsimplefullscreen" }, @@ -1328,8 +1396,9 @@ "collection": false, "description": "Whether the window is in simple (pre-Lion) fullscreen mode." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isSimpleFullScreen()", - "type": "instanceMethod", "tldr": "Returns whether the window is in simple (pre-Lion) fullscreen mode.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowissimplefullscreen" }, @@ -1355,8 +1424,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setAspectRatio(aspectRatio[, extraSize])", - "type": "instanceMethod", "tldr": "This will make a window maintain an aspect ratio.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetaspectratio" }, @@ -1382,8 +1452,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.previewFile(path[, displayName])", - "type": "instanceMethod", "tldr": "Uses Quick Look to preview a file at a given path..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowpreviewfile" }, @@ -1393,8 +1464,9 @@ "macOS" ], "description": "Closes the currently open Quick Look panel.", + "type": "api", + "apiType": "instanceMethod", "title": "win.closeFilePreview()", - "type": "instanceMethod", "tldr": "Closes the currently open Quick Look panel..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowclosefilepreview" }, @@ -1415,8 +1487,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setBounds(bounds[, animate])", - "type": "instanceMethod", "tldr": "Resizes and moves the window to the supplied bounds.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetbounds" }, @@ -1426,8 +1499,9 @@ "type": "Rectangle", "collection": false }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getBounds()", - "type": "instanceMethod", "tldr": null, "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetbounds" }, @@ -1448,8 +1522,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setContentBounds(bounds[, animate])", - "type": "instanceMethod", "tldr": "Resizes and moves the window's client area (e.g.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetcontentbounds" }, @@ -1459,8 +1534,9 @@ "type": "Rectangle", "collection": false }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getContentBounds()", - "type": "instanceMethod", "tldr": null, "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetcontentbounds" }, @@ -1475,8 +1551,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setEnabled(enable)", - "type": "instanceMethod", "tldr": "Disable or enable the window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetenabled" }, @@ -1503,8 +1580,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setSize(width, height[, animate])", - "type": "instanceMethod", "tldr": "Resizes the window to width and height..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetsize" }, @@ -1515,8 +1593,9 @@ "collection": true, "description": "Contains the window's width and height." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getSize()", - "type": "instanceMethod", "tldr": "Returns contains the window's width and height.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetsize" }, @@ -1543,8 +1622,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setContentSize(width, height[, animate])", - "type": "instanceMethod", "tldr": "Resizes the window's client area (e.g.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetcontentsize" }, @@ -1555,8 +1635,9 @@ "collection": true, "description": "Contains the window's client area's width and height." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getContentSize()", - "type": "instanceMethod", "tldr": "Returns contains the window's client area's width and height.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetcontentsize" }, @@ -1577,8 +1658,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setMinimumSize(width, height)", - "type": "instanceMethod", "tldr": "Sets the minimum size of window to width and height..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetminimumsize" }, @@ -1589,8 +1671,9 @@ "collection": true, "description": "Contains the window's minimum width and height." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getMinimumSize()", - "type": "instanceMethod", "tldr": "Returns contains the window's minimum width and height.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetminimumsize" }, @@ -1611,8 +1694,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setMaximumSize(width, height)", - "type": "instanceMethod", "tldr": "Sets the maximum size of window to width and height..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetmaximumsize" }, @@ -1623,8 +1707,9 @@ "collection": true, "description": "Contains the window's maximum width and height." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getMaximumSize()", - "type": "instanceMethod", "tldr": "Returns contains the window's maximum width and height.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetmaximumsize" }, @@ -1639,8 +1724,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setResizable(resizable)", - "type": "instanceMethod", "tldr": "Sets whether the window can be manually resized by user..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetresizable" }, @@ -1651,8 +1737,9 @@ "collection": false, "description": "Whether the window can be manually resized by user." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isResizable()", - "type": "instanceMethod", "tldr": "Returns whether the window can be manually resized by user.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisresizable" }, @@ -1671,8 +1758,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setMovable(movable)", - "type": "instanceMethod", "tldr": "Sets whether the window can be moved by user.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetmovable" }, @@ -1688,8 +1776,9 @@ "collection": false, "description": "Whether the window can be moved by user." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isMovable()", - "type": "instanceMethod", "tldr": "On Linux always returns true..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowismovable" }, @@ -1708,8 +1797,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setMinimizable(minimizable)", - "type": "instanceMethod", "tldr": "Sets whether the window can be manually minimized by user.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetminimizable" }, @@ -1725,8 +1815,9 @@ "collection": false, "description": "Whether the window can be manually minimized by user" }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isMinimizable()", - "type": "instanceMethod", "tldr": "On Linux always returns true..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisminimizable" }, @@ -1745,8 +1836,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setMaximizable(maximizable)", - "type": "instanceMethod", "tldr": "Sets whether the window can be manually maximized by user.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetmaximizable" }, @@ -1762,8 +1854,9 @@ "collection": false, "description": "Whether the window can be manually maximized by user." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isMaximizable()", - "type": "instanceMethod", "tldr": "On Linux always returns true..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowismaximizable" }, @@ -1778,8 +1871,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setFullScreenable(fullscreenable)", - "type": "instanceMethod", "tldr": "Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetfullscreenable" }, @@ -1790,8 +1884,9 @@ "collection": false, "description": "Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isFullScreenable()", - "type": "instanceMethod", "tldr": "Returns whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisfullscreenable" }, @@ -1810,8 +1905,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setClosable(closable)", - "type": "instanceMethod", "tldr": "Sets whether the window can be manually closed by user.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetclosable" }, @@ -1827,8 +1923,9 @@ "collection": false, "description": "Whether the window can be manually closed by user." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isClosable()", - "type": "instanceMethod", "tldr": "On Linux always returns true..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisclosable" }, @@ -1883,8 +1980,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setAlwaysOnTop(flag[, level][, relativeLevel])", - "type": "instanceMethod", "tldr": "Sets whether the window should show always on top of other windows.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetalwaysontop" }, @@ -1895,16 +1993,18 @@ "collection": false, "description": "Whether the window is always on top of other windows." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isAlwaysOnTop()", - "type": "instanceMethod", "tldr": "Returns whether the window is always on top of other windows.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisalwaysontop" }, { "name": "center", "description": "Moves window to the center of the screen.", + "type": "api", + "apiType": "instanceMethod", "title": "win.center()", - "type": "instanceMethod", "tldr": "Moves window to the center of the screen..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowcenter" }, @@ -1931,8 +2031,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setPosition(x, y[, animate])", - "type": "instanceMethod", "tldr": "Moves window to x and y..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetposition" }, @@ -1943,8 +2044,9 @@ "collection": true, "description": "Contains the window's current position." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getPosition()", - "type": "instanceMethod", "tldr": "Returns contains the window's current position.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetposition" }, @@ -1959,8 +2061,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setTitle(title)", - "type": "instanceMethod", "tldr": "Changes the title of native window to title..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsettitle" }, @@ -1972,8 +2075,9 @@ "collection": false, "description": "The title of the native window." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getTitle()", - "type": "instanceMethod", "tldr": "Note: The title of web page can be different from the title of the native window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgettitle" }, @@ -1997,8 +2101,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setSheetOffset(offsetY[, offsetX])", - "type": "instanceMethod", "tldr": "Changes the attachment point for sheets on macOS.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetsheetoffset" }, @@ -2013,8 +2118,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.flashFrame(flag)", - "type": "instanceMethod", "tldr": "Starts or stops flashing the window to attract user's attention..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowflashframe" }, @@ -2029,8 +2135,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setSkipTaskbar(skip)", - "type": "instanceMethod", "tldr": "Makes the window not show in the taskbar..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetskiptaskbar" }, @@ -2045,8 +2152,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setKiosk(flag)", - "type": "instanceMethod", "tldr": "Enters or leaves the kiosk mode..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetkiosk" }, @@ -2057,8 +2165,9 @@ "collection": false, "description": "Whether the window is in kiosk mode." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isKiosk()", - "type": "instanceMethod", "tldr": "Returns whether the window is in kiosk mode.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowiskiosk" }, @@ -2070,8 +2179,9 @@ "collection": false, "description": "The platform-specific handle of the window." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getNativeWindowHandle()", - "type": "instanceMethod", "tldr": "The native type of the handle is HWND on Windows, NSView* on macOS, and Window (unsigned long) on Linux..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetnativewindowhandle" }, @@ -2095,8 +2205,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.hookWindowMessage(message, callback)", - "type": "instanceMethod", "tldr": "Hooks a windows message.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowhookwindowmessage" }, @@ -2118,8 +2229,9 @@ "collection": false, "description": "true or false depending on whether the message is hooked." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isWindowMessageHooked(message)", - "type": "instanceMethod", "tldr": "Returns true or false depending on whether the message is hooked.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowiswindowmessagehooked" }, @@ -2137,8 +2249,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.unhookWindowMessage(message)", - "type": "instanceMethod", "tldr": "Unhook the window message..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowunhookwindowmessage" }, @@ -2148,8 +2261,9 @@ "Windows" ], "description": "Unhooks all of the window messages.", + "type": "api", + "apiType": "instanceMethod", "title": "win.unhookAllWindowMessages()", - "type": "instanceMethod", "tldr": "Unhooks all of the window messages..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowunhookallwindowmessages" }, @@ -2167,8 +2281,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setRepresentedFilename(filename)", - "type": "instanceMethod", "tldr": "Sets the pathname of the file the window represents, and the icon of the file will show in window's title bar..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetrepresentedfilename" }, @@ -2182,8 +2297,9 @@ "collection": false, "description": "The pathname of the file the window represents." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getRepresentedFilename()", - "type": "instanceMethod", "tldr": "Returns the pathname of the file the window represents.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetrepresentedfilename" }, @@ -2201,8 +2317,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setDocumentEdited(edited)", - "type": "instanceMethod", "tldr": "Specifies whether the window’s document has been edited, and the icon in title bar will become gray when set to true..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetdocumentedited" }, @@ -2216,22 +2333,25 @@ "collection": false, "description": "Whether the window's document has been edited." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isDocumentEdited()", - "type": "instanceMethod", "tldr": "Returns whether the window's document has been edited.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisdocumentedited" }, { "name": "focusOnWebView", + "type": "api", + "apiType": "instanceMethod", "title": "win.focusOnWebView()", - "type": "instanceMethod", "tldr": null, "url": "https://electronjs.org/docs/api/browser-window#browser-windowfocusonwebview" }, { "name": "blurWebView", + "type": "api", + "apiType": "instanceMethod", "title": "win.blurWebView()", - "type": "instanceMethod", "tldr": null, "url": "https://electronjs.org/docs/api/browser-window#browser-windowblurwebview" }, @@ -2262,8 +2382,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.capturePage([rect, ]callback)", - "type": "instanceMethod", "tldr": "Same as webContents.capturePage([rect, ]callback)..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowcapturepage" }, @@ -2338,8 +2459,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.loadURL(url[, options])", - "type": "instanceMethod", "tldr": "Same as webContents.loadURL(url[, options]).", "url": "https://electronjs.org/docs/api/browser-window#browser-windowloadurl" }, @@ -2354,16 +2476,18 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.loadFile(filePath)", - "type": "instanceMethod", "tldr": "Same as webContents.loadFile, filePath should be a path to an HTML file relative to the root of your application.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowloadfile" }, { "name": "reload", "description": "Same as webContents.reload.", + "type": "api", + "apiType": "instanceMethod", "title": "win.reload()", - "type": "instanceMethod", "tldr": "Same as webContents.reload..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowreload" }, @@ -2391,8 +2515,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setMenu(menu)", - "type": "instanceMethod", "tldr": "Sets the menu as the window's menu bar, setting it to null will remove the menu bar..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetmenu" }, @@ -2439,8 +2564,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setProgressBar(progress[, options])", - "type": "instanceMethod", "tldr": "Sets progress value in progress bar.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetprogressbar" }, @@ -2466,8 +2592,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setOverlayIcon(overlay, description)", - "type": "instanceMethod", "tldr": "Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetoverlayicon" }, @@ -2485,8 +2612,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setHasShadow(hasShadow)", - "type": "instanceMethod", "tldr": "Sets whether the window should have a shadow.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsethasshadow" }, @@ -2501,8 +2629,9 @@ "collection": false, "description": "Whether the window has a shadow." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.hasShadow()", - "type": "instanceMethod", "tldr": "On Windows and Linux always returns true..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowhasshadow" }, @@ -2522,8 +2651,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setOpacity(opacity)", - "type": "instanceMethod", "tldr": "Sets the opacity of the window.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetopacity" }, @@ -2538,8 +2668,9 @@ "collection": false, "description": "between 0.0 (fully transparent) and 1.0 (fully opaque)" }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getOpacity()", - "type": "instanceMethod", "tldr": "Returns between 0.0 (fully transparent) and 1.0 (fully opaque)", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetopacity" }, @@ -2562,8 +2693,9 @@ "collection": false, "description": "Whether the buttons were added successfully" }, + "type": "api", + "apiType": "instanceMethod", "title": "win.setThumbarButtons(buttons)", - "type": "instanceMethod", "tldr": "Add a thumbnail toolbar with a specified set of buttons to the thumbnail image of a window in a taskbar button layout.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetthumbarbuttons" }, @@ -2582,8 +2714,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setThumbnailClip(region)", - "type": "instanceMethod", "tldr": "Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetthumbnailclip" }, @@ -2601,8 +2734,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setThumbnailToolTip(toolTip)", - "type": "instanceMethod", "tldr": "Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetthumbnailtooltip" }, @@ -2657,8 +2791,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setAppDetails(options)", - "type": "instanceMethod", "tldr": "Sets the properties for the window's taskbar button.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetappdetails" }, @@ -2668,8 +2803,9 @@ "macOS" ], "description": "Same as webContents.showDefinitionForSelection().", + "type": "api", + "apiType": "instanceMethod", "title": "win.showDefinitionForSelection()", - "type": "instanceMethod", "tldr": "Same as webContents.showDefinitionForSelection()..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowshowdefinitionforselection" }, @@ -2688,8 +2824,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setIcon(icon)", - "type": "instanceMethod", "tldr": "Changes window icon..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowseticon" }, @@ -2704,8 +2841,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setAutoHideMenuBar(hide)", - "type": "instanceMethod", "tldr": "Sets whether the window menu bar should hide itself automatically.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetautohidemenubar" }, @@ -2716,8 +2854,9 @@ "collection": false, "description": "Whether menu bar automatically hides itself." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isMenuBarAutoHide()", - "type": "instanceMethod", "tldr": "Returns whether menu bar automatically hides itself.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowismenubarautohide" }, @@ -2736,8 +2875,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setMenuBarVisibility(visible)", - "type": "instanceMethod", "tldr": "Sets whether the menu bar should be visible.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetmenubarvisibility" }, @@ -2748,8 +2888,9 @@ "collection": false, "description": "Whether the menu bar is visible." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isMenuBarVisible()", - "type": "instanceMethod", "tldr": "Returns whether the menu bar is visible.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowismenubarvisible" }, @@ -2764,8 +2905,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setVisibleOnAllWorkspaces(visible)", - "type": "instanceMethod", "tldr": "Sets whether the window should be visible on all workspaces.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetvisibleonallworkspaces" }, @@ -2777,8 +2919,9 @@ "collection": false, "description": "Whether the window is visible on all workspaces." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.isVisibleOnAllWorkspaces()", - "type": "instanceMethod", "tldr": "Note: This API always returns false on Windows..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowisvisibleonallworkspaces" }, @@ -2808,8 +2951,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setIgnoreMouseEvents(ignore[, options])", - "type": "instanceMethod", "tldr": "Makes the window ignore all mouse events.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetignoremouseevents" }, @@ -2828,8 +2972,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setContentProtection(enable)", - "type": "instanceMethod", "tldr": "Prevents the window contents from being captured by other apps.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetcontentprotection" }, @@ -2847,8 +2992,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setFocusable(focusable)", - "type": "instanceMethod", "tldr": "Changes whether the window can be focused..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetfocusable" }, @@ -2867,8 +3013,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setParentWindow(parent)", - "type": "instanceMethod", "tldr": "Sets parent as current window's parent window, passing null will turn current window into a top-level window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetparentwindow" }, @@ -2879,8 +3026,9 @@ "collection": false, "description": "The parent window." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getParentWindow()", - "type": "instanceMethod", "tldr": "Returns the parent window.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetparentwindow" }, @@ -2891,8 +3039,9 @@ "collection": true, "description": "All child windows." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getChildWindows()", - "type": "instanceMethod", "tldr": "Returns all child windows.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetchildwindows" }, @@ -2910,8 +3059,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setAutoHideCursor(autoHide)", - "type": "instanceMethod", "tldr": "Controls whether to hide cursor when typing..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetautohidecursor" }, @@ -2921,8 +3071,9 @@ "macOS" ], "description": "Selects the previous tab when native tabs are enabled and there are other tabs in the window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.selectPreviousTab()", - "type": "instanceMethod", "tldr": "Selects the previous tab when native tabs are enabled and there are other tabs in the window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowselectprevioustab" }, @@ -2932,8 +3083,9 @@ "macOS" ], "description": "Selects the next tab when native tabs are enabled and there are other tabs in the window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.selectNextTab()", - "type": "instanceMethod", "tldr": "Selects the next tab when native tabs are enabled and there are other tabs in the window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowselectnexttab" }, @@ -2943,8 +3095,9 @@ "macOS" ], "description": "Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.mergeAllWindows()", - "type": "instanceMethod", "tldr": "Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowmergeallwindows" }, @@ -2954,8 +3107,9 @@ "macOS" ], "description": "Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.moveTabToNewWindow()", - "type": "instanceMethod", "tldr": "Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowmovetabtonewwindow" }, @@ -2965,8 +3119,9 @@ "macOS" ], "description": "Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.toggleTabBar()", - "type": "instanceMethod", "tldr": "Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowtoggletabbar" }, @@ -2984,8 +3139,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.addTabbedWindow(browserWindow)", - "type": "instanceMethod", "tldr": "Adds a window as a tab on this window, after the tab for the window instance..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowaddtabbedwindow" }, @@ -3036,8 +3192,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setVibrancy(type)", - "type": "instanceMethod", "tldr": "Adds a vibrancy effect to the browser window.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetvibrancy" }, @@ -3056,8 +3213,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setTouchBar(touchBar)", - "type": "instanceMethod", "tldr": "Sets the touchBar layout for the current window.", "url": "https://electronjs.org/docs/api/browser-window#browser-windowsettouchbar" }, @@ -3074,8 +3232,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.setBrowserView(browserView)", - "type": "instanceMethod", "tldr": null, "url": "https://electronjs.org/docs/api/browser-window#browser-windowsetbrowserview" }, @@ -3099,8 +3258,9 @@ "collection": false, "description": "an attached BrowserView. Returns null if none is attached." }, + "type": "api", + "apiType": "instanceMethod", "title": "win.getBrowserView()", - "type": "instanceMethod", "tldr": "Note: The BrowserView API is currently experimental and may change or be removed in future Electron releases..", "url": "https://electronjs.org/docs/api/browser-window#browser-windowgetbrowserview" }, @@ -3121,8 +3281,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "win.on('page-title-updated')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-page-title-updated", "tldr": "Emitted when the document changed its title, calling event.preventDefault() will prevent the native window's title from changing.." }, @@ -3137,16 +3298,18 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "win.on('close')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-close", "tldr": "Emitted when the window is going to be closed." }, { "name": "closed", "description": "Emitted when the window is closed. After you have received this event you should remove the reference to the window and avoid using it any more.", + "type": "api", + "apiType": "event", "title": "win.on('closed')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-closed", "tldr": "Emitted when the window is closed." }, @@ -3156,112 +3319,126 @@ "platforms": [ "Windows" ], + "type": "api", + "apiType": "event", "title": "win.on('session-end')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-session-end", "tldr": "Emitted when window session is going to end due to force shutdown or machine restart or session log off.." }, { "name": "unresponsive", "description": "Emitted when the web page becomes unresponsive.", + "type": "api", + "apiType": "event", "title": "win.on('unresponsive')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-unresponsive", "tldr": "Emitted when the web page becomes unresponsive.." }, { "name": "responsive", "description": "Emitted when the unresponsive web page becomes responsive again.", + "type": "api", + "apiType": "event", "title": "win.on('responsive')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-responsive", "tldr": "Emitted when the unresponsive web page becomes responsive again.." }, { "name": "blur", "description": "Emitted when the window loses focus.", + "type": "api", + "apiType": "event", "title": "win.on('blur')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-blur", "tldr": "Emitted when the window loses focus.." }, { "name": "focus", "description": "Emitted when the window gains focus.", + "type": "api", + "apiType": "event", "title": "win.on('focus')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-focus", "tldr": "Emitted when the window gains focus.." }, { "name": "show", "description": "Emitted when the window is shown.", + "type": "api", + "apiType": "event", "title": "win.on('show')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-show", "tldr": "Emitted when the window is shown.." }, { "name": "hide", "description": "Emitted when the window is hidden.", + "type": "api", + "apiType": "event", "title": "win.on('hide')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-hide", "tldr": "Emitted when the window is hidden.." }, { "name": "ready-to-show", "description": "Emitted when the web page has been rendered (while not being shown) and window can be displayed without a visual flash.", + "type": "api", + "apiType": "event", "title": "win.on('ready-to-show')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-ready-to-show", "tldr": "Emitted when the web page has been rendered (while not being shown) and window can be displayed without a visual flash.." }, { "name": "maximize", "description": "Emitted when window is maximized.", + "type": "api", + "apiType": "event", "title": "win.on('maximize')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-maximize", "tldr": "Emitted when window is maximized.." }, { "name": "unmaximize", "description": "Emitted when the window exits from a maximized state.", + "type": "api", + "apiType": "event", "title": "win.on('unmaximize')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-unmaximize", "tldr": "Emitted when the window exits from a maximized state.." }, { "name": "minimize", "description": "Emitted when the window is minimized.", + "type": "api", + "apiType": "event", "title": "win.on('minimize')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-minimize", "tldr": "Emitted when the window is minimized.." }, { "name": "restore", "description": "Emitted when the window is restored from a minimized state.", + "type": "api", + "apiType": "event", "title": "win.on('restore')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-restore", "tldr": "Emitted when the window is restored from a minimized state.." }, { "name": "resize", "description": "Emitted when the window is being resized.", + "type": "api", + "apiType": "event", "title": "win.on('resize')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-resize", "tldr": "Emitted when the window is being resized.." }, { "name": "move", "description": "Emitted when the window is being moved to a new position. Note: On macOS this event is just an alias of moved.", + "type": "api", + "apiType": "event", "title": "win.on('move')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-move", "tldr": "Emitted when the window is being moved to a new position." }, @@ -3271,40 +3448,45 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "win.on('moved')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-moved", "tldr": "Emitted once when the window is moved to a new position.." }, { "name": "enter-full-screen", "description": "Emitted when the window enters a full-screen state.", + "type": "api", + "apiType": "event", "title": "win.on('enter-full-screen')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-enter-full-screen", "tldr": "Emitted when the window enters a full-screen state.." }, { "name": "leave-full-screen", "description": "Emitted when the window leaves a full-screen state.", + "type": "api", + "apiType": "event", "title": "win.on('leave-full-screen')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-leave-full-screen", "tldr": "Emitted when the window leaves a full-screen state.." }, { "name": "enter-html-full-screen", "description": "Emitted when the window enters a full-screen state triggered by HTML API.", + "type": "api", + "apiType": "event", "title": "win.on('enter-html-full-screen')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-enter-html-full-screen", "tldr": "Emitted when the window enters a full-screen state triggered by HTML API.." }, { "name": "leave-html-full-screen", "description": "Emitted when the window leaves a full-screen state triggered by HTML API.", + "type": "api", + "apiType": "event", "title": "win.on('leave-html-full-screen')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-leave-html-full-screen", "tldr": "Emitted when the window leaves a full-screen state triggered by HTML API.." }, @@ -3328,8 +3510,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "win.on('app-command')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-app-command", "tldr": "Emitted when an App Command is invoked." }, @@ -3339,8 +3522,9 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "win.on('scroll-touch-begin')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-scroll-touch-begin", "tldr": "Emitted when scroll wheel event phase has begun.." }, @@ -3350,8 +3534,9 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "win.on('scroll-touch-end')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-scroll-touch-end", "tldr": "Emitted when scroll wheel event phase has ended.." }, @@ -3361,8 +3546,9 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "win.on('scroll-touch-edge')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-scroll-touch-edge", "tldr": "Emitted when scroll wheel event phase filed upon reaching the edge of element.." }, @@ -3386,8 +3572,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "win.on('swipe')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-swipe", "tldr": "Emitted on 3-finger swipe." }, @@ -3397,8 +3584,9 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "win.on('sheet-begin')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-sheet-begin", "tldr": "Emitted when the window opens a sheet.." }, @@ -3408,8 +3596,9 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "win.on('sheet-end')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-sheet-end", "tldr": "Emitted when the window has closed a sheet.." }, @@ -3419,24 +3608,27 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "win.on('new-window-for-tab')", - "type": "event", "url": "https://electronjs.org/docs/api/browser-window#event-new-window-for-tab", "tldr": "Emitted when the native new tab button is clicked.." }, { "name": "blur", "description": "Removes focus from the child window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.blur()", - "type": "instanceMethod", "tldr": "Removes focus from the child window..", "url": "https://electronjs.org/docs/api/browser-window-proxy#browser-window-proxyblur" }, { "name": "close", "description": "Forcefully closes the child window without calling its unload event.", + "type": "api", + "apiType": "instanceMethod", "title": "win.close()", - "type": "instanceMethod", "tldr": "Forcefully closes the child window without calling its unload event..", "url": "https://electronjs.org/docs/api/browser-window-proxy#browser-window-proxyclose" }, @@ -3451,24 +3643,27 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.eval(code)", - "type": "instanceMethod", "tldr": "Evaluates the code in the child window..", "url": "https://electronjs.org/docs/api/browser-window-proxy#browser-window-proxyeval" }, { "name": "focus", "description": "Focuses the child window (brings the window to front).", + "type": "api", + "apiType": "instanceMethod", "title": "win.focus()", - "type": "instanceMethod", "tldr": "Focuses the child window (brings the window to front)..", "url": "https://electronjs.org/docs/api/browser-window-proxy#browser-window-proxyfocus" }, { "name": "print", "description": "Invokes the print dialog on the child window.", + "type": "api", + "apiType": "instanceMethod", "title": "win.print()", - "type": "instanceMethod", "tldr": "Invokes the print dialog on the child window..", "url": "https://electronjs.org/docs/api/browser-window-proxy#browser-window-proxyprint" }, @@ -3489,8 +3684,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "win.postMessage(message, targetOrigin)", - "type": "instanceMethod", "tldr": "Sends a message to the child window with the specified origin or * for no origin preference.", "url": "https://electronjs.org/docs/api/browser-window-proxy#browser-window-proxypostmessage" }, @@ -3513,8 +3709,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "request.setHeader(name, value)", - "type": "instanceMethod", "tldr": "Adds an extra HTTP header.", "url": "https://electronjs.org/docs/api/client-request#client-requestsetheader" }, @@ -3543,8 +3740,9 @@ } ] }, + "type": "api", + "apiType": "instanceMethod", "title": "request.getHeader(name)", - "type": "instanceMethod", "tldr": "Returns the value of a previously set extra header name.", "url": "https://electronjs.org/docs/api/client-request#client-requestgetheader" }, @@ -3560,8 +3758,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "request.removeHeader(name)", - "type": "instanceMethod", "tldr": "Removes a previously set extra header name.", "url": "https://electronjs.org/docs/api/client-request#client-requestremoveheader" }, @@ -3600,8 +3799,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "request.write(chunk[, encoding][, callback])", - "type": "instanceMethod", "tldr": "callback is essentially a dummy function introduced in the purpose of keeping similarity with the Node.js API.", "url": "https://electronjs.org/docs/api/client-request#client-requestwrite" }, @@ -3637,24 +3837,27 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "request.end([chunk][, encoding][, callback])", - "type": "instanceMethod", "tldr": "Sends the last chunk of the request data.", "url": "https://electronjs.org/docs/api/client-request#client-requestend" }, { "name": "abort", "description": "Cancels an ongoing HTTP transaction. If the request has already emitted the close event, the abort operation will have no effect. Otherwise an ongoing event will emit abort and close events. Additionally, if there is an ongoing response object,it will emit the aborted event.", + "type": "api", + "apiType": "instanceMethod", "title": "request.abort()", - "type": "instanceMethod", "tldr": "Cancels an ongoing HTTP transaction.", "url": "https://electronjs.org/docs/api/client-request#client-requestabort" }, { "name": "followRedirect", "description": "Continues any deferred redirection request when the redirection mode is manual.", + "type": "api", + "apiType": "instanceMethod", "title": "request.followRedirect()", - "type": "instanceMethod", "tldr": "Continues any deferred redirection request when the redirection mode is manual..", "url": "https://electronjs.org/docs/api/client-request#client-requestfollowredirect" }, @@ -3669,8 +3872,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "request.on('response')", - "type": "event", "url": "https://electronjs.org/docs/api/client-request#event-response", "tldr": null }, @@ -3744,24 +3948,27 @@ ] } ], + "type": "api", + "apiType": "event", "title": "request.on('login')", - "type": "event", "url": "https://electronjs.org/docs/api/client-request#event-login", "tldr": "Emitted when an authenticating proxy is asking for user credentials." }, { "name": "finish", "description": "Emitted just after the last chunk of the request's data has been written into the request object.", + "type": "api", + "apiType": "event", "title": "request.on('finish')", - "type": "event", "url": "https://electronjs.org/docs/api/client-request#event-finish", "tldr": "Emitted just after the last chunk of the request's data has been written into the request object.." }, { "name": "abort", "description": "Emitted when the request is aborted. The abort event will not be fired if the request is already closed.", + "type": "api", + "apiType": "event", "title": "request.on('abort')", - "type": "event", "url": "https://electronjs.org/docs/api/client-request#event-abort", "tldr": "Emitted when the request is aborted." }, @@ -3777,16 +3984,18 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "request.on('error')", - "type": "event", "url": "https://electronjs.org/docs/api/client-request#event-error", "tldr": "Emitted when the net module fails to issue a network request." }, { "name": "close", "description": "Emitted as the last event in the HTTP request-response transaction. The close event indicates that no more events will be emitted on either the request or response objects.", + "type": "api", + "apiType": "event", "title": "request.on('close')", - "type": "event", "url": "https://electronjs.org/docs/api/client-request#event-close", "tldr": "Emitted as the last event in the HTTP request-response transaction." }, @@ -3819,8 +4028,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "request.on('redirect')", - "type": "event", "url": "https://electronjs.org/docs/api/client-request#event-redirect", "tldr": "Emitted when there is redirection and the mode is manual." }, @@ -3901,8 +4111,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "cookies.get(filter, callback)", - "type": "instanceMethod", "tldr": "Sends a request to get all cookies matching filter, callback will be called with callback(error, cookies) on complete..", "url": "https://electronjs.org/docs/api/cookies#cookiesget" }, @@ -3990,8 +4201,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "cookies.set(details, callback)", - "type": "instanceMethod", "tldr": "Sets a cookie with details, callback will be called with callback(error) on complete..", "url": "https://electronjs.org/docs/api/cookies#cookiesset" }, @@ -4020,8 +4232,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "cookies.remove(url, name, callback)", - "type": "instanceMethod", "tldr": "Removes the cookies matching url and name, callback will called with callback() on complete..", "url": "https://electronjs.org/docs/api/cookies#cookiesremove" }, @@ -4036,8 +4249,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "cookies.flushStore(callback)", - "type": "instanceMethod", "tldr": "Writes any unwritten cookies data to disk..", "url": "https://electronjs.org/docs/api/cookies#cookiesflushstore" }, @@ -4095,8 +4309,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "cookies.on('changed')", - "type": "event", "url": "https://electronjs.org/docs/api/cookies#event-changed", "tldr": "Emitted when a cookie is changed because it was added, edited, removed, or expired.." }, @@ -4112,8 +4327,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "debugger.attach([protocolVersion])", - "type": "instanceMethod", "tldr": "Attaches the debugger to the webContents..", "url": "https://electronjs.org/docs/api/debugger#debuggerattach" }, @@ -4124,16 +4340,18 @@ "collection": false, "description": "Whether a debugger is attached to the webContents." }, + "type": "api", + "apiType": "instanceMethod", "title": "debugger.isAttached()", - "type": "instanceMethod", "tldr": "Returns whether a debugger is attached to the webContents.", "url": "https://electronjs.org/docs/api/debugger#debuggerisattached" }, { "name": "detach", "description": "Detaches the debugger from the webContents.", + "type": "api", + "apiType": "instanceMethod", "title": "debugger.detach()", - "type": "instanceMethod", "tldr": "Detaches the debugger from the webContents..", "url": "https://electronjs.org/docs/api/debugger#debuggerdetach" }, @@ -4180,8 +4398,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "debugger.sendCommand(method[, commandParams, callback])", - "type": "instanceMethod", "tldr": "Send given command to the debugging target..", "url": "https://electronjs.org/docs/api/debugger#debuggersendcommand" }, @@ -4203,8 +4422,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "debugger.on('detach')", - "type": "event", "url": "https://electronjs.org/docs/api/debugger#event-detach", "tldr": "Emitted when debugging session is terminated." }, @@ -4233,8 +4453,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "debugger.on('message')", - "type": "event", "url": "https://electronjs.org/docs/api/debugger#event-message", "tldr": "Emitted whenever debugging target issues instrumentation event.." }, @@ -4250,8 +4471,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.setSavePath(path)", - "type": "instanceMethod", "tldr": "The API is only available in session's will-download callback function.", "url": "https://electronjs.org/docs/api/download-item#download-itemsetsavepath" }, @@ -4262,16 +4484,18 @@ "collection": false, "description": "The save path of the download item. This will be either the path set via downloadItem.setSavePath(path) or the path selected from the shown save dialog." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getSavePath()", - "type": "instanceMethod", "tldr": "Returns the save path of the download item. This will be either the path set via downloadItem.setSavePath(path) or the path selected from the shown save dialog.", "url": "https://electronjs.org/docs/api/download-item#download-itemgetsavepath" }, { "name": "pause", "description": "Pauses the download.", + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.pause()", - "type": "instanceMethod", "tldr": "Pauses the download..", "url": "https://electronjs.org/docs/api/download-item#download-itempause" }, @@ -4282,16 +4506,18 @@ "collection": false, "description": "Whether the download is paused." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.isPaused()", - "type": "instanceMethod", "tldr": "Returns whether the download is paused.", "url": "https://electronjs.org/docs/api/download-item#download-itemispaused" }, { "name": "resume", "description": "Resumes the download that has been paused. Note: To enable resumable downloads the server you are downloading from must support range requests and provide both Last-Modified and ETag header values. Otherwise resume() will dismiss previously received bytes and restart the download from the beginning.", + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.resume()", - "type": "instanceMethod", "tldr": "Resumes the download that has been paused.", "url": "https://electronjs.org/docs/api/download-item#download-itemresume" }, @@ -4302,16 +4528,18 @@ "collection": false, "description": "Whether the download can resume." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.canResume()", - "type": "instanceMethod", "tldr": "Returns whether the download can resume.", "url": "https://electronjs.org/docs/api/download-item#download-itemcanresume" }, { "name": "cancel", "description": "Cancels the download operation.", + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.cancel()", - "type": "instanceMethod", "tldr": "Cancels the download operation..", "url": "https://electronjs.org/docs/api/download-item#download-itemcancel" }, @@ -4322,8 +4550,9 @@ "collection": false, "description": "The origin url where the item is downloaded from." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getURL()", - "type": "instanceMethod", "tldr": "Returns the origin url where the item is downloaded from.", "url": "https://electronjs.org/docs/api/download-item#download-itemgeturl" }, @@ -4334,8 +4563,9 @@ "collection": false, "description": "The files mime type." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getMimeType()", - "type": "instanceMethod", "tldr": "Returns the files mime type.", "url": "https://electronjs.org/docs/api/download-item#download-itemgetmimetype" }, @@ -4346,8 +4576,9 @@ "collection": false, "description": "Whether the download has user gesture." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.hasUserGesture()", - "type": "instanceMethod", "tldr": "Returns whether the download has user gesture.", "url": "https://electronjs.org/docs/api/download-item#download-itemhasusergesture" }, @@ -4359,8 +4590,9 @@ "collection": false, "description": "The file name of the download item." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getFilename()", - "type": "instanceMethod", "tldr": "Note: The file name is not always the same as the actual one saved in local disk.", "url": "https://electronjs.org/docs/api/download-item#download-itemgetfilename" }, @@ -4372,8 +4604,9 @@ "collection": false, "description": "The total size in bytes of the download item." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getTotalBytes()", - "type": "instanceMethod", "tldr": "If the size is unknown, it returns 0..", "url": "https://electronjs.org/docs/api/download-item#download-itemgettotalbytes" }, @@ -4384,8 +4617,9 @@ "collection": false, "description": "The received bytes of the download item." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getReceivedBytes()", - "type": "instanceMethod", "tldr": "Returns the received bytes of the download item.", "url": "https://electronjs.org/docs/api/download-item#download-itemgetreceivedbytes" }, @@ -4396,8 +4630,9 @@ "collection": false, "description": "The Content-Disposition field from the response header." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getContentDisposition()", - "type": "instanceMethod", "tldr": "Returns the Content-Disposition field from the response header.", "url": "https://electronjs.org/docs/api/download-item#download-itemgetcontentdisposition" }, @@ -4423,8 +4658,9 @@ } ] }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getState()", - "type": "instanceMethod", "tldr": "Note: The following methods are useful specifically to resume a cancelled item when session is restarted..", "url": "https://electronjs.org/docs/api/download-item#download-itemgetstate" }, @@ -4435,8 +4671,9 @@ "collection": true, "description": "The complete url chain of the item including any redirects." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getURLChain()", - "type": "instanceMethod", "tldr": "Returns the complete url chain of the item including any redirects.", "url": "https://electronjs.org/docs/api/download-item#download-itemgeturlchain" }, @@ -4447,8 +4684,9 @@ "collection": false, "description": "Last-Modified header value." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getLastModifiedTime()", - "type": "instanceMethod", "tldr": "Returns last-Modified header value.", "url": "https://electronjs.org/docs/api/download-item#download-itemgetlastmodifiedtime" }, @@ -4459,8 +4697,9 @@ "collection": false, "description": "ETag header value." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getETag()", - "type": "instanceMethod", "tldr": "Returns eTag header value.", "url": "https://electronjs.org/docs/api/download-item#download-itemgetetag" }, @@ -4471,8 +4710,9 @@ "collection": false, "description": "Number of seconds since the UNIX epoch when the download was started." }, + "type": "api", + "apiType": "instanceMethod", "title": "downloadItem.getStartTime()", - "type": "instanceMethod", "tldr": "Returns number of seconds since the UNIX epoch when the download was started.", "url": "https://electronjs.org/docs/api/download-item#download-itemgetstarttime" }, @@ -4502,8 +4742,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "downloadItem.on('updated')", - "type": "event", "url": "https://electronjs.org/docs/api/download-item#event-updated", "tldr": "Emitted when the download has been updated and is not done." }, @@ -4536,8 +4777,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "downloadItem.on('done')", - "type": "event", "url": "https://electronjs.org/docs/api/download-item#event-done", "tldr": "Emitted when the download is in a terminal state." }, @@ -4559,8 +4801,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "inAppPurchase.on('transactions-updated')", - "type": "event", "url": "https://electronjs.org/docs/api/in-app-purchase#event-transactions-updated", "tldr": "Emitted when one or more transactions have been updated.." }, @@ -4576,32 +4819,36 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "response.on('data')", - "type": "event", "url": "https://electronjs.org/docs/api/incoming-message#event-data", "tldr": "The data event is the usual method of transferring response data into applicative code.." }, { "name": "end", "description": "Indicates that response body has ended.", + "type": "api", + "apiType": "event", "title": "response.on('end')", - "type": "event", "url": "https://electronjs.org/docs/api/incoming-message#event-end", "tldr": "Indicates that response body has ended.." }, { "name": "aborted", "description": "Emitted when a request has been canceled during an ongoing HTTP transaction.", + "type": "api", + "apiType": "event", "title": "response.on('aborted')", - "type": "event", "url": "https://electronjs.org/docs/api/incoming-message#event-aborted", "tldr": "Emitted when a request has been canceled during an ongoing HTTP transaction.." }, { "name": "error", "description": "error Error - Typically holds an error string identifying failure root cause. Emitted when an error was encountered while streaming response data events. For instance, if the server closes the underlying while the response is still streaming, an error event will be emitted on the response object and a close event will subsequently follow on the request object.", + "type": "api", + "apiType": "event", "title": "response.on('error')", - "type": "event", "url": "https://electronjs.org/docs/api/incoming-message#event-error", "tldr": "error Error - Typically holds an error string identifying failure root cause." }, @@ -4625,8 +4872,9 @@ "required": true } ], + "type": "api", + "apiType": "staticMethod", "title": "Menu.setApplicationMenu(menu)", - "type": "staticMethod", "tldr": "Sets menu as the application menu on macOS.", "url": "https://electronjs.org/docs/api/menu#menusetapplicationmenu" }, @@ -4647,8 +4895,9 @@ "collection": false, "description": "The application menu, if set, or null, if not set." }, + "type": "api", + "apiType": "staticMethod", "title": "Menu.getApplicationMenu()", - "type": "staticMethod", "tldr": "Note: The returned Menu instance doesn't support dynamic addition or removal of menu items.", "url": "https://electronjs.org/docs/api/menu#menugetapplicationmenu" }, @@ -4666,8 +4915,9 @@ "required": true } ], + "type": "api", + "apiType": "staticMethod", "title": "Menu.sendActionToFirstResponder(action)", - "type": "staticMethod", "tldr": "Sends the action to the first responder of application.", "url": "https://electronjs.org/docs/api/menu#menusendactiontofirstresponder" }, @@ -4686,8 +4936,9 @@ "type": "Menu", "collection": false }, + "type": "api", + "apiType": "staticMethod", "title": "Menu.buildFromTemplate(template)", - "type": "staticMethod", "tldr": "Generally, the template is just an array of options for constructing a MenuItem.", "url": "https://electronjs.org/docs/api/menu#menubuildfromtemplate" }, @@ -4740,8 +4991,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "menu.popup(options)", - "type": "instanceMethod", "tldr": "Pops up this menu as a context menu in the BrowserWindow..", "url": "https://electronjs.org/docs/api/menu#menupopup" }, @@ -4757,8 +5009,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "menu.closePopup([browserWindow])", - "type": "instanceMethod", "tldr": "Closes the context menu in the browserWindow..", "url": "https://electronjs.org/docs/api/menu#menuclosepopup" }, @@ -4773,8 +5026,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "menu.append(menuItem)", - "type": "instanceMethod", "tldr": "Appends the menuItem to the menu..", "url": "https://electronjs.org/docs/api/menu#menuappend" }, @@ -4793,8 +5047,9 @@ "collection": false, "description": "the item with the specified id" }, + "type": "api", + "apiType": "instanceMethod", "title": "menu.getMenuItemById(id)", - "type": "instanceMethod", "tldr": "Returns the item with the specified id", "url": "https://electronjs.org/docs/api/menu#menugetmenuitembyid" }, @@ -4815,8 +5070,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "menu.insert(pos, menuItem)", - "type": "instanceMethod", "tldr": "Inserts the menuItem to the pos position of the menu..", "url": "https://electronjs.org/docs/api/menu#menuinsert" }, @@ -4831,8 +5087,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "menu.on('menu-will-show')", - "type": "event", "url": "https://electronjs.org/docs/api/menu#event-menu-will-show", "tldr": "Emitted when menu.popup() is called.." }, @@ -4847,8 +5104,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "menu.on('menu-will-close')", - "type": "event", "url": "https://electronjs.org/docs/api/menu#event-menu-will-close", "tldr": "Emitted when a popup is closed either manually or with menu.closePopup().." }, @@ -4876,8 +5134,9 @@ "collection": false, "description": "A Buffer that contains the image's PNG encoded data." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.toPNG([options])", - "type": "instanceMethod", "tldr": "Returns a Buffer that contains the image's PNG encoded data.", "url": "https://electronjs.org/docs/api/native-image#native-imagetopng" }, @@ -4897,8 +5156,9 @@ "collection": false, "description": "A Buffer that contains the image's JPEG encoded data." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.toJPEG(quality)", - "type": "instanceMethod", "tldr": "Returns a Buffer that contains the image's JPEG encoded data.", "url": "https://electronjs.org/docs/api/native-image#native-imagetojpeg" }, @@ -4926,8 +5186,9 @@ "collection": false, "description": "A Buffer that contains a copy of the image's raw bitmap pixel data." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.toBitmap([options])", - "type": "instanceMethod", "tldr": "Returns a Buffer that contains a copy of the image's raw bitmap pixel data.", "url": "https://electronjs.org/docs/api/native-image#native-imagetobitmap" }, @@ -4955,8 +5216,9 @@ "collection": false, "description": "The data URL of the image." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.toDataURL([options])", - "type": "instanceMethod", "tldr": "Returns the data URL of the image.", "url": "https://electronjs.org/docs/api/native-image#native-imagetodataurl" }, @@ -4985,8 +5247,9 @@ "collection": false, "description": "A Buffer that contains the image's raw bitmap pixel data." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.getBitmap([options])", - "type": "instanceMethod", "tldr": "The difference between getBitmap() and toBitmap() is, getBitmap() does not copy the bitmap data, so you have to use the returned Buffer immediately in current event loop tick, otherwise the data might be changed or destroyed..", "url": "https://electronjs.org/docs/api/native-image#native-imagegetbitmap" }, @@ -5001,8 +5264,9 @@ "collection": false, "description": "A Buffer that stores C pointer to underlying native handle of the image. On macOS, a pointer to NSImage instance would be returned." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.getNativeHandle()", - "type": "instanceMethod", "tldr": "Notice that the returned pointer is a weak pointer to the underlying native image instead of a copy, so you must ensure that the associated nativeImage instance is kept around..", "url": "https://electronjs.org/docs/api/native-image#native-imagegetnativehandle" }, @@ -5013,8 +5277,9 @@ "collection": false, "description": "Whether the image is empty." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.isEmpty()", - "type": "instanceMethod", "tldr": "Returns whether the image is empty.", "url": "https://electronjs.org/docs/api/native-image#native-imageisempty" }, @@ -5024,8 +5289,9 @@ "type": "Size", "collection": false }, + "type": "api", + "apiType": "instanceMethod", "title": "image.getSize()", - "type": "instanceMethod", "tldr": null, "url": "https://electronjs.org/docs/api/native-image#native-imagegetsize" }, @@ -5040,8 +5306,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "image.setTemplateImage(option)", - "type": "instanceMethod", "tldr": "Marks the image as a template image..", "url": "https://electronjs.org/docs/api/native-image#native-imagesettemplateimage" }, @@ -5052,8 +5319,9 @@ "collection": false, "description": "Whether the image is a template image." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.isTemplateImage()", - "type": "instanceMethod", "tldr": "Returns whether the image is a template image.", "url": "https://electronjs.org/docs/api/native-image#native-imageistemplateimage" }, @@ -5073,8 +5341,9 @@ "collection": false, "description": "The cropped image." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.crop(rect)", - "type": "instanceMethod", "tldr": "Returns the cropped image.", "url": "https://electronjs.org/docs/api/native-image#native-imagecrop" }, @@ -5117,8 +5386,9 @@ "collection": false, "description": "The resized image." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.resize(options)", - "type": "instanceMethod", "tldr": "If only the height or the width are specified then the current aspect ratio will be preserved in the resized image..", "url": "https://electronjs.org/docs/api/native-image#native-imageresize" }, @@ -5129,8 +5399,9 @@ "collection": false, "description": "The image's aspect ratio." }, + "type": "api", + "apiType": "instanceMethod", "title": "image.getAspectRatio()", - "type": "instanceMethod", "tldr": "Returns the image's aspect ratio.", "url": "https://electronjs.org/docs/api/native-image#native-imagegetaspectratio" }, @@ -5182,8 +5453,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "image.addRepresentation(options)", - "type": "instanceMethod", "tldr": "Add an image representation for a specific scale factor.", "url": "https://electronjs.org/docs/api/native-image#native-imageaddrepresentation" }, @@ -5194,24 +5466,27 @@ "collection": false, "description": "Whether or not desktop notifications are supported on the current system" }, + "type": "api", + "apiType": "staticMethod", "title": "Notification.isSupported()", - "type": "staticMethod", "tldr": "Returns whether or not desktop notifications are supported on the current system", "url": "https://electronjs.org/docs/api/notification#notificationissupported" }, { "name": "show", "description": "Immediately shows the notification to the user, please note this means unlike the HTML5 Notification implementation, simply instantiating a new Notification does not immediately show it to the user, you need to call this method before the OS will display it. If the notification has been shown before, this method will dismiss the previously shown notification and create a new one with identical properties.", + "type": "api", + "apiType": "instanceMethod", "title": "notification.show()", - "type": "instanceMethod", "tldr": "Immediately shows the notification to the user, please note this means unlike the HTML5 Notification implementation, simply instantiating a new Notification does not immediately show it to the user, you need to call this method before the OS will display it.", "url": "https://electronjs.org/docs/api/notification#notificationshow" }, { "name": "close", "description": "Dismisses the notification.", + "type": "api", + "apiType": "instanceMethod", "title": "notification.close()", - "type": "instanceMethod", "tldr": "Dismisses the notification..", "url": "https://electronjs.org/docs/api/notification#notificationclose" }, @@ -5226,8 +5501,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "notification.on('show')", - "type": "event", "url": "https://electronjs.org/docs/api/notification#event-show", "tldr": "Emitted when the notification is shown to the user, note this could be fired multiple times as a notification can be shown multiple times through the show() method.." }, @@ -5242,8 +5518,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "notification.on('click')", - "type": "event", "url": "https://electronjs.org/docs/api/notification#event-click", "tldr": "Emitted when the notification is clicked by the user.." }, @@ -5258,8 +5535,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "notification.on('close')", - "type": "event", "url": "https://electronjs.org/docs/api/notification#event-close", "tldr": "Emitted when the notification is closed by manual intervention from the user." }, @@ -5284,8 +5562,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "notification.on('reply')", - "type": "event", "url": "https://electronjs.org/docs/api/notification#event-reply", "tldr": "Emitted when the user clicks the \"Reply\" button on a notification with hasReply: true.." }, @@ -5309,24 +5588,27 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "notification.on('action')", - "type": "event", "url": "https://electronjs.org/docs/api/notification#event-action", "tldr": null }, { "name": "suspend", "description": "Emitted when the system is suspending.", + "type": "api", + "apiType": "event", "title": "powerMonitor.on('suspend')", - "type": "event", "url": "https://electronjs.org/docs/api/power-monitor#event-suspend", "tldr": "Emitted when the system is suspending.." }, { "name": "resume", "description": "Emitted when system is resuming.", + "type": "api", + "apiType": "event", "title": "powerMonitor.on('resume')", - "type": "event", "url": "https://electronjs.org/docs/api/power-monitor#event-resume", "tldr": "Emitted when system is resuming.." }, @@ -5336,8 +5618,9 @@ "platforms": [ "Windows" ], + "type": "api", + "apiType": "event", "title": "powerMonitor.on('on-ac')", - "type": "event", "url": "https://electronjs.org/docs/api/power-monitor#event-on-ac", "tldr": "Emitted when the system changes to AC power.." }, @@ -5347,8 +5630,9 @@ "platforms": [ "Windows" ], + "type": "api", + "apiType": "event", "title": "powerMonitor.on('on-battery')", - "type": "event", "url": "https://electronjs.org/docs/api/power-monitor#event-on-battery", "tldr": "Emitted when system changes to battery power.." }, @@ -5359,16 +5643,18 @@ "Linux", "macOS" ], + "type": "api", + "apiType": "event", "title": "powerMonitor.on('shutdown')", - "type": "event", "url": "https://electronjs.org/docs/api/power-monitor#event-shutdown", "tldr": "Emitted when the system is about to reboot or shut down." }, { "name": "loaded", "description": "Emitted when Electron has loaded its internal initialization script and is beginning to load the web page or the main script. It can be used by the preload script to add removed Node global symbols back to the global scope when node integration is turned off:", + "type": "api", + "apiType": "event", "title": "process.on('loaded')", - "type": "event", "url": "https://electronjs.org/docs/api/process#event-loaded", "tldr": "Emitted when Electron has loaded its internal initialization script and is beginning to load the web page or the main script." }, @@ -5389,8 +5675,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "screen.on('display-added')", - "type": "event", "url": "https://electronjs.org/docs/api/screen#event-display-added", "tldr": "Emitted when newDisplay has been added.." }, @@ -5411,8 +5698,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "screen.on('display-removed')", - "type": "event", "url": "https://electronjs.org/docs/api/screen#event-display-removed", "tldr": "Emitted when oldDisplay has been removed.." }, @@ -5439,8 +5727,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "screen.on('display-metrics-changed')", - "type": "event", "url": "https://electronjs.org/docs/api/screen#event-display-metrics-changed", "tldr": "Emitted when one or more metrics change in a display." }, @@ -5464,8 +5753,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.getCacheSize(callback)", - "type": "instanceMethod", "tldr": "Callback is invoked with the session's current cache size..", "url": "https://electronjs.org/docs/api/session#sessiongetcachesize" }, @@ -5481,8 +5771,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.clearCache(callback)", - "type": "instanceMethod", "tldr": "Clears the session’s HTTP cache..", "url": "https://electronjs.org/docs/api/session#sessionclearcache" }, @@ -5527,16 +5818,18 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.clearStorageData([options, callback])", - "type": "instanceMethod", "tldr": "Clears the data of web storages..", "url": "https://electronjs.org/docs/api/session#sessionclearstoragedata" }, { "name": "flushStorageData", "description": "Writes any unwritten DOMStorage data to disk.", + "type": "api", + "apiType": "instanceMethod", "title": "ses.flushStorageData()", - "type": "instanceMethod", "tldr": "Writes any unwritten DOMStorage data to disk..", "url": "https://electronjs.org/docs/api/session#sessionflushstoragedata" }, @@ -5581,8 +5874,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.setProxy(config, callback)", - "type": "instanceMethod", "tldr": "Sets the proxy settings.", "url": "https://electronjs.org/docs/api/session#sessionsetproxy" }, @@ -5612,8 +5906,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.resolveProxy(url, callback)", - "type": "instanceMethod", "tldr": "Resolves the proxy information for url.", "url": "https://electronjs.org/docs/api/session#sessionresolveproxy" }, @@ -5629,8 +5924,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.setDownloadPath(path)", - "type": "instanceMethod", "tldr": "Sets download saving directory.", "url": "https://electronjs.org/docs/api/session#sessionsetdownloadpath" }, @@ -5675,16 +5971,18 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.enableNetworkEmulation(options)", - "type": "instanceMethod", "tldr": "Emulates network with the given configuration for the session..", "url": "https://electronjs.org/docs/api/session#sessionenablenetworkemulation" }, { "name": "disableNetworkEmulation", "description": "Disables any network emulation already active for the session. Resets to the original network configuration.", + "type": "api", + "apiType": "instanceMethod", "title": "ses.disableNetworkEmulation()", - "type": "instanceMethod", "tldr": "Disables any network emulation already active for the session.", "url": "https://electronjs.org/docs/api/session#sessiondisablenetworkemulation" }, @@ -5754,8 +6052,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.setCertificateVerifyProc(proc)", - "type": "instanceMethod", "tldr": "Sets the certificate verify proc for session, the proc will be called with proc(request, callback) whenever a server certificate verification is requested.", "url": "https://electronjs.org/docs/api/session#sessionsetcertificateverifyproc" }, @@ -5827,8 +6126,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.setPermissionRequestHandler(handler)", - "type": "instanceMethod", "tldr": "Sets the handler which can be used to respond to permission requests for the session.", "url": "https://electronjs.org/docs/api/session#sessionsetpermissionrequesthandler" }, @@ -5844,8 +6144,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.clearHostResolverCache([callback])", - "type": "instanceMethod", "tldr": "Clears the host resolver cache..", "url": "https://electronjs.org/docs/api/session#sessionclearhostresolvercache" }, @@ -5861,8 +6162,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.allowNTLMCredentialsForDomains(domains)", - "type": "instanceMethod", "tldr": "Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication..", "url": "https://electronjs.org/docs/api/session#sessionallowntlmcredentialsfordomains" }, @@ -5883,8 +6185,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.setUserAgent(userAgent[, acceptLanguages])", - "type": "instanceMethod", "tldr": "Overrides the userAgent and acceptLanguages for this session.", "url": "https://electronjs.org/docs/api/session#sessionsetuseragent" }, @@ -5895,8 +6198,9 @@ "collection": false, "description": "The user agent for this session." }, + "type": "api", + "apiType": "instanceMethod", "title": "ses.getUserAgent()", - "type": "instanceMethod", "tldr": "Returns the user agent for this session.", "url": "https://electronjs.org/docs/api/session#sessiongetuseragent" }, @@ -5926,8 +6230,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.getBlobData(identifier, callback)", - "type": "instanceMethod", "tldr": null, "url": "https://electronjs.org/docs/api/session#sessiongetblobdata" }, @@ -6000,8 +6305,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.createInterruptedDownload(options)", - "type": "instanceMethod", "tldr": "Allows resuming cancelled or interrupted downloads from previous Session.", "url": "https://electronjs.org/docs/api/session#sessioncreateinterrupteddownload" }, @@ -6032,8 +6338,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.clearAuthCache(options[, callback])", - "type": "instanceMethod", "tldr": "Clears the session’s HTTP authentication cache..", "url": "https://electronjs.org/docs/api/session#sessionclearauthcache" }, @@ -6049,8 +6356,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "ses.setPreloads(preloads)", - "type": "instanceMethod", "tldr": "Adds scripts that will be executed on ALL web contents that are associated with this session just before normal preload scripts run..", "url": "https://electronjs.org/docs/api/session#sessionsetpreloads" }, @@ -6061,8 +6369,9 @@ "collection": true, "description": "an array of paths to preload scripts that have been registered." }, + "type": "api", + "apiType": "instanceMethod", "title": "ses.getPreloads()", - "type": "instanceMethod", "tldr": "Returns an array of paths to preload scripts that have been registered.", "url": "https://electronjs.org/docs/api/session#sessiongetpreloads" }, @@ -6089,8 +6398,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "ses.on('will-download')", - "type": "event", "url": "https://electronjs.org/docs/api/session#event-will-download", "tldr": "Emitted when Electron is about to download item in webContents." }, @@ -6114,8 +6424,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "systemPreferences.on('accent-color-changed')", - "type": "event", "url": "https://electronjs.org/docs/api/system-preferences#event-accent-color-changed", "tldr": null }, @@ -6132,8 +6443,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "systemPreferences.on('color-changed')", - "type": "event", "url": "https://electronjs.org/docs/api/system-preferences#event-color-changed", "tldr": null }, @@ -6157,16 +6469,18 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "systemPreferences.on('inverted-color-scheme-changed')", - "type": "event", "url": "https://electronjs.org/docs/api/system-preferences#event-inverted-color-scheme-changed", "tldr": null }, { "name": "destroy", "description": "Destroys the tray icon immediately.", + "type": "api", + "apiType": "instanceMethod", "title": "tray.destroy()", - "type": "instanceMethod", "tldr": "Destroys the tray icon immediately..", "url": "https://electronjs.org/docs/api/tray#traydestroy" }, @@ -6190,8 +6504,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "tray.setImage(image)", - "type": "instanceMethod", "tldr": "Sets the image associated with this tray icon..", "url": "https://electronjs.org/docs/api/tray#traysetimage" }, @@ -6209,8 +6524,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "tray.setPressedImage(image)", - "type": "instanceMethod", "tldr": "Sets the image associated with this tray icon when pressed on macOS..", "url": "https://electronjs.org/docs/api/tray#traysetpressedimage" }, @@ -6225,8 +6541,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "tray.setToolTip(toolTip)", - "type": "instanceMethod", "tldr": "Sets the hover text for this tray icon..", "url": "https://electronjs.org/docs/api/tray#traysettooltip" }, @@ -6244,8 +6561,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "tray.setTitle(title)", - "type": "instanceMethod", "tldr": "Sets the title displayed aside of the tray icon in the status bar (Support ANSI colors)..", "url": "https://electronjs.org/docs/api/tray#traysettitle" }, @@ -6278,8 +6596,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "tray.setHighlightMode(mode)", - "type": "instanceMethod", "tldr": "Sets when the tray's icon background becomes highlighted (in blue).", "url": "https://electronjs.org/docs/api/tray#traysethighlightmode" }, @@ -6329,8 +6648,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "tray.displayBalloon(options)", - "type": "instanceMethod", "tldr": "Displays a tray balloon..", "url": "https://electronjs.org/docs/api/tray#traydisplayballoon" }, @@ -6356,8 +6676,9 @@ "required": false } ], + "type": "api", + "apiType": "instanceMethod", "title": "tray.popUpContextMenu([menu, position])", - "type": "instanceMethod", "tldr": "Pops up the context menu of the tray icon.", "url": "https://electronjs.org/docs/api/tray#traypopupcontextmenu" }, @@ -6372,8 +6693,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "tray.setContextMenu(menu)", - "type": "instanceMethod", "tldr": "Sets the context menu for this icon..", "url": "https://electronjs.org/docs/api/tray#traysetcontextmenu" }, @@ -6388,8 +6710,9 @@ "type": "Rectangle", "collection": false }, + "type": "api", + "apiType": "instanceMethod", "title": "tray.getBounds()", - "type": "instanceMethod", "tldr": "The bounds of this tray icon as Object..", "url": "https://electronjs.org/docs/api/tray#traygetbounds" }, @@ -6400,8 +6723,9 @@ "collection": false, "description": "Whether the tray icon is destroyed." }, + "type": "api", + "apiType": "instanceMethod", "title": "tray.isDestroyed()", - "type": "instanceMethod", "tldr": "Returns whether the tray icon is destroyed.", "url": "https://electronjs.org/docs/api/tray#trayisdestroyed" }, @@ -6430,8 +6754,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "tray.on('click')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-click", "tldr": "Emitted when the tray icon is clicked.." }, @@ -6457,8 +6782,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "tray.on('right-click')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-right-click", "tldr": "Emitted when the tray icon is right clicked.." }, @@ -6484,8 +6810,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "tray.on('double-click')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-double-click", "tldr": "Emitted when the tray icon is double clicked.." }, @@ -6495,8 +6822,9 @@ "platforms": [ "Windows" ], + "type": "api", + "apiType": "event", "title": "tray.on('balloon-show')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-balloon-show", "tldr": "Emitted when the tray balloon shows.." }, @@ -6506,8 +6834,9 @@ "platforms": [ "Windows" ], + "type": "api", + "apiType": "event", "title": "tray.on('balloon-click')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-balloon-click", "tldr": "Emitted when the tray balloon is clicked.." }, @@ -6517,8 +6846,9 @@ "platforms": [ "Windows" ], + "type": "api", + "apiType": "event", "title": "tray.on('balloon-closed')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-balloon-closed", "tldr": "Emitted when the tray balloon is closed because of timeout or user manually closes it.." }, @@ -6528,8 +6858,9 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "tray.on('drop')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-drop", "tldr": "Emitted when any dragged items are dropped on the tray icon.." }, @@ -6554,8 +6885,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "tray.on('drop-files')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-drop-files", "tldr": "Emitted when dragged files are dropped in the tray icon.." }, @@ -6580,8 +6912,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "tray.on('drop-text')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-drop-text", "tldr": "Emitted when dragged text is dropped in the tray icon.." }, @@ -6591,8 +6924,9 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "tray.on('drag-enter')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-drag-enter", "tldr": "Emitted when a drag operation enters the tray icon.." }, @@ -6602,8 +6936,9 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "tray.on('drag-leave')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-drag-leave", "tldr": "Emitted when a drag operation exits the tray icon.." }, @@ -6613,8 +6948,9 @@ "platforms": [ "macOS" ], + "type": "api", + "apiType": "event", "title": "tray.on('drag-end')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-drag-end", "tldr": "Emitted when a drag operation ends on the tray or ends at another location.." }, @@ -6639,8 +6975,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "tray.on('mouse-enter')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-mouse-enter", "tldr": "Emitted when the mouse enters the tray icon.." }, @@ -6665,8 +7002,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "tray.on('mouse-leave')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-mouse-leave", "tldr": "Emitted when the mouse exits the tray icon.." }, @@ -6691,8 +7029,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "tray.on('mouse-move')", - "type": "event", "url": "https://electronjs.org/docs/api/tray#event-mouse-move", "tldr": "Emitted when the mouse moves in the tray icon.." }, @@ -6767,8 +7106,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.loadURL(url[, options])", - "type": "instanceMethod", "tldr": "Loads the url in the window.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsloadurl" }, @@ -6783,8 +7123,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.loadFile(filePath)", - "type": "instanceMethod", "tldr": "Loads the given file in the window, filePath should be a path to an HTML file relative to the root of your application.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsloadfile" }, @@ -6799,8 +7140,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.downloadURL(url)", - "type": "instanceMethod", "tldr": "Initiates a download of the resource at url without navigating.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsdownloadurl" }, @@ -6811,8 +7153,9 @@ "collection": false, "description": "The URL of the current web page." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.getURL()", - "type": "instanceMethod", "tldr": "Returns the URL of the current web page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgeturl" }, @@ -6823,8 +7166,9 @@ "collection": false, "description": "The title of the current web page." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.getTitle()", - "type": "instanceMethod", "tldr": "Returns the title of the current web page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgettitle" }, @@ -6835,16 +7179,18 @@ "collection": false, "description": "Whether the web page is destroyed." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isDestroyed()", - "type": "instanceMethod", "tldr": "Returns whether the web page is destroyed.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsisdestroyed" }, { "name": "focus", "description": "Focuses the web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.focus()", - "type": "instanceMethod", "tldr": "Focuses the web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsfocus" }, @@ -6855,8 +7201,9 @@ "collection": false, "description": "Whether the web page is focused." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isFocused()", - "type": "instanceMethod", "tldr": "Returns whether the web page is focused.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsisfocused" }, @@ -6867,8 +7214,9 @@ "collection": false, "description": "Whether web page is still loading resources." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isLoading()", - "type": "instanceMethod", "tldr": "Returns whether web page is still loading resources.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsisloading" }, @@ -6879,8 +7227,9 @@ "collection": false, "description": "Whether the main frame (and not just iframes or frames within it) is still loading." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isLoadingMainFrame()", - "type": "instanceMethod", "tldr": "Returns whether the main frame (and not just iframes or frames within it) is still loading.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsisloadingmainframe" }, @@ -6891,32 +7240,36 @@ "collection": false, "description": "Whether the web page is waiting for a first-response from the main resource of the page." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isWaitingForResponse()", - "type": "instanceMethod", "tldr": "Returns whether the web page is waiting for a first-response from the main resource of the page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsiswaitingforresponse" }, { "name": "stop", "description": "Stops any pending navigation.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.stop()", - "type": "instanceMethod", "tldr": "Stops any pending navigation..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsstop" }, { "name": "reload", "description": "Reloads the current web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.reload()", - "type": "instanceMethod", "tldr": "Reloads the current web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsreload" }, { "name": "reloadIgnoringCache", "description": "Reloads current page and ignores cache.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.reloadIgnoringCache()", - "type": "instanceMethod", "tldr": "Reloads current page and ignores cache..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsreloadignoringcache" }, @@ -6927,8 +7280,9 @@ "collection": false, "description": "Whether the browser can go back to previous web page." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.canGoBack()", - "type": "instanceMethod", "tldr": "Returns whether the browser can go back to previous web page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentscangoback" }, @@ -6939,8 +7293,9 @@ "collection": false, "description": "Whether the browser can go forward to next web page." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.canGoForward()", - "type": "instanceMethod", "tldr": "Returns whether the browser can go forward to next web page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentscangoforward" }, @@ -6959,32 +7314,36 @@ "collection": false, "description": "Whether the web page can go to offset." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.canGoToOffset(offset)", - "type": "instanceMethod", "tldr": "Returns whether the web page can go to offset.", "url": "https://electronjs.org/docs/api/web-contents#web-contentscangotooffset" }, { "name": "clearHistory", "description": "Clears the navigation history.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.clearHistory()", - "type": "instanceMethod", "tldr": "Clears the navigation history..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsclearhistory" }, { "name": "goBack", "description": "Makes the browser go back a web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.goBack()", - "type": "instanceMethod", "tldr": "Makes the browser go back a web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgoback" }, { "name": "goForward", "description": "Makes the browser go forward a web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.goForward()", - "type": "instanceMethod", "tldr": "Makes the browser go forward a web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgoforward" }, @@ -6999,8 +7358,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.goToIndex(index)", - "type": "instanceMethod", "tldr": "Navigates browser to the specified absolute web page index..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgotoindex" }, @@ -7015,8 +7375,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.goToOffset(offset)", - "type": "instanceMethod", "tldr": "Navigates to the specified offset from the \"current entry\"..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgotooffset" }, @@ -7027,8 +7388,9 @@ "collection": false, "description": "Whether the renderer process has crashed." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isCrashed()", - "type": "instanceMethod", "tldr": "Returns whether the renderer process has crashed.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsiscrashed" }, @@ -7043,8 +7405,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setUserAgent(userAgent)", - "type": "instanceMethod", "tldr": "Overrides the user agent for this web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetuseragent" }, @@ -7055,8 +7418,9 @@ "collection": false, "description": "The user agent for this web page." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.getUserAgent()", - "type": "instanceMethod", "tldr": "Returns the user agent for this web page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgetuseragent" }, @@ -7071,8 +7435,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.insertCSS(css)", - "type": "instanceMethod", "tldr": "Injects CSS into the current web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsinsertcss" }, @@ -7115,8 +7480,9 @@ "collection": false, "description": "A promise that resolves with the result of the executed code or is rejected if the result of the code is a rejected promise." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.executeJavaScript(code[, userGesture, callback])", - "type": "instanceMethod", "tldr": "Evaluates code in page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsexecutejavascript" }, @@ -7134,8 +7500,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setIgnoreMenuShortcuts(ignore)", - "type": "instanceMethod", "tldr": "Ignore application menu shortcuts while this web contents is focused..", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetignoremenushortcuts" }, @@ -7150,8 +7517,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setAudioMuted(muted)", - "type": "instanceMethod", "tldr": "Mute the audio on the current web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetaudiomuted" }, @@ -7162,8 +7530,9 @@ "collection": false, "description": "Whether this page has been muted." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isAudioMuted()", - "type": "instanceMethod", "tldr": "Returns whether this page has been muted.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsisaudiomuted" }, @@ -7179,8 +7548,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setZoomFactor(factor)", - "type": "instanceMethod", "tldr": "Changes the zoom factor to the specified factor.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetzoomfactor" }, @@ -7204,8 +7574,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.getZoomFactor(callback)", - "type": "instanceMethod", "tldr": "Sends a request to get current zoom factor, the callback will be called with callback(zoomFactor)..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgetzoomfactor" }, @@ -7221,8 +7592,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setZoomLevel(level)", - "type": "instanceMethod", "tldr": "Changes the zoom level to the specified level.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetzoomlevel" }, @@ -7246,8 +7618,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.getZoomLevel(callback)", - "type": "instanceMethod", "tldr": "Sends a request to get current zoom level, the callback will be called with callback(zoomLevel)..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgetzoomlevel" }, @@ -7268,8 +7641,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setVisualZoomLevelLimits(minimumLevel, maximumLevel)", - "type": "instanceMethod", "tldr": "Sets the maximum and minimum pinch-to-zoom level..", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetvisualzoomlevellimits" }, @@ -7290,40 +7664,45 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setLayoutZoomLevelLimits(minimumLevel, maximumLevel)", - "type": "instanceMethod", "tldr": "Sets the maximum and minimum layout-based (i.e.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetlayoutzoomlevellimits" }, { "name": "undo", "description": "Executes the editing command undo in web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.undo()", - "type": "instanceMethod", "tldr": "Executes the editing command undo in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsundo" }, { "name": "redo", "description": "Executes the editing command redo in web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.redo()", - "type": "instanceMethod", "tldr": "Executes the editing command redo in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsredo" }, { "name": "cut", "description": "Executes the editing command cut in web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.cut()", - "type": "instanceMethod", "tldr": "Executes the editing command cut in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentscut" }, { "name": "copy", "description": "Executes the editing command copy in web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.copy()", - "type": "instanceMethod", "tldr": "Executes the editing command copy in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentscopy" }, @@ -7344,48 +7723,54 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.copyImageAt(x, y)", - "type": "instanceMethod", "tldr": "Copy the image at the given position to the clipboard..", "url": "https://electronjs.org/docs/api/web-contents#web-contentscopyimageat" }, { "name": "paste", "description": "Executes the editing command paste in web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.paste()", - "type": "instanceMethod", "tldr": "Executes the editing command paste in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentspaste" }, { "name": "pasteAndMatchStyle", "description": "Executes the editing command pasteAndMatchStyle in web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.pasteAndMatchStyle()", - "type": "instanceMethod", "tldr": "Executes the editing command pasteAndMatchStyle in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentspasteandmatchstyle" }, { "name": "delete", "description": "Executes the editing command delete in web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.delete()", - "type": "instanceMethod", "tldr": "Executes the editing command delete in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsdelete" }, { "name": "selectAll", "description": "Executes the editing command selectAll in web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.selectAll()", - "type": "instanceMethod", "tldr": "Executes the editing command selectAll in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsselectall" }, { "name": "unselect", "description": "Executes the editing command unselect in web page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.unselect()", - "type": "instanceMethod", "tldr": "Executes the editing command unselect in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsunselect" }, @@ -7400,8 +7785,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.replace(text)", - "type": "instanceMethod", "tldr": "Executes the editing command replace in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsreplace" }, @@ -7416,8 +7802,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.replaceMisspelling(text)", - "type": "instanceMethod", "tldr": "Executes the editing command replaceMisspelling in web page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsreplacemisspelling" }, @@ -7432,8 +7819,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.insertText(text)", - "type": "instanceMethod", "tldr": "Inserts text to the focused element..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsinserttext" }, @@ -7497,8 +7885,9 @@ "collection": false, "description": "The request id used for the request." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.findInPage(text[, options])", - "type": "instanceMethod", "tldr": "Starts a request to find all matches for the text in the web page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsfindinpage" }, @@ -7528,8 +7917,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.stopFindInPage(action)", - "type": "instanceMethod", "tldr": "Stops any findInPage request for the webContents with the provided action..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsstopfindinpage" }, @@ -7560,8 +7950,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.capturePage([rect, ]callback)", - "type": "instanceMethod", "tldr": "Captures a snapshot of the page within rect.", "url": "https://electronjs.org/docs/api/web-contents#web-contentscapturepage" }, @@ -7585,8 +7976,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.hasServiceWorker(callback)", - "type": "instanceMethod", "tldr": "Checks if any ServiceWorker is registered and returns a boolean as response to callback..", "url": "https://electronjs.org/docs/api/web-contents#web-contentshasserviceworker" }, @@ -7610,8 +8002,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.unregisterServiceWorker(callback)", - "type": "instanceMethod", "tldr": "Unregisters any ServiceWorker if present and returns a boolean as response to callback when the JS promise is fulfilled or false when the JS promise is rejected..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsunregisterserviceworker" }, @@ -7623,8 +8016,9 @@ "collection": true, "description": "." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.getPrinters()", - "type": "instanceMethod", "tldr": "Get the system printer list..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgetprinters" }, @@ -7677,8 +8071,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.print([options], [callback])", - "type": "instanceMethod", "tldr": "Prints window's web page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsprint" }, @@ -7752,8 +8147,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.printToPDF(options, callback)", - "type": "instanceMethod", "tldr": "Prints window's web page as PDF with Chromium's preview printing custom settings.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsprinttopdf" }, @@ -7768,8 +8164,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.addWorkSpace(path)", - "type": "instanceMethod", "tldr": "Adds the specified path to DevTools workspace.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsaddworkspace" }, @@ -7784,8 +8181,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.removeWorkSpace(path)", - "type": "instanceMethod", "tldr": "Removes the specified path from DevTools workspace..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsremoveworkspace" }, @@ -7800,8 +8198,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setDevToolsWebContents(devToolsWebContents)", - "type": "instanceMethod", "tldr": "Uses the devToolsWebContents as the target WebContents to show devtools.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetdevtoolswebcontents" }, @@ -7839,16 +8238,18 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.openDevTools([options])", - "type": "instanceMethod", "tldr": "Opens the devtools.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsopendevtools" }, { "name": "closeDevTools", "description": "Closes the devtools.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.closeDevTools()", - "type": "instanceMethod", "tldr": "Closes the devtools..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsclosedevtools" }, @@ -7859,8 +8260,9 @@ "collection": false, "description": "Whether the devtools is opened." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isDevToolsOpened()", - "type": "instanceMethod", "tldr": "Returns whether the devtools is opened.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsisdevtoolsopened" }, @@ -7871,16 +8273,18 @@ "collection": false, "description": "Whether the devtools view is focused ." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isDevToolsFocused()", - "type": "instanceMethod", "tldr": "Returns whether the devtools view is focused .", "url": "https://electronjs.org/docs/api/web-contents#web-contentsisdevtoolsfocused" }, { "name": "toggleDevTools", "description": "Toggles the developer tools.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.toggleDevTools()", - "type": "instanceMethod", "tldr": "Toggles the developer tools..", "url": "https://electronjs.org/docs/api/web-contents#web-contentstoggledevtools" }, @@ -7901,16 +8305,18 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.inspectElement(x, y)", - "type": "instanceMethod", "tldr": "Starts inspecting element at position (x, y)..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsinspectelement" }, { "name": "inspectServiceWorker", "description": "Opens the developer tools for the service worker context.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.inspectServiceWorker()", - "type": "instanceMethod", "tldr": "Opens the developer tools for the service worker context..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsinspectserviceworker" }, @@ -7931,8 +8337,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.send(channel[, arg1][, arg2][, ...])", - "type": "instanceMethod", "tldr": "Send an asynchronous message to renderer process via channel, you can also send arbitrary arguments.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssend" }, @@ -8001,16 +8408,18 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.enableDeviceEmulation(parameters)", - "type": "instanceMethod", "tldr": "Enable device emulation with the given parameters..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsenabledeviceemulation" }, { "name": "disableDeviceEmulation", "description": "Disable device emulation enabled by webContents.enableDeviceEmulation.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.disableDeviceEmulation()", - "type": "instanceMethod", "tldr": "Disable device emulation enabled by webContents.enableDeviceEmulation..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsdisabledeviceemulation" }, @@ -8073,8 +8482,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.sendInputEvent(event)", - "type": "instanceMethod", "tldr": "Sends an input event to the page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssendinputevent" }, @@ -8112,16 +8522,18 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.beginFrameSubscription([onlyDirty ,]callback)", - "type": "instanceMethod", "tldr": "Begin subscribing for presentation events and captured frames, the callback will be called with callback(frameBuffer, dirtyRect) when there is a presentation event.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsbeginframesubscription" }, { "name": "endFrameSubscription", "description": "End subscribing for frame presentation events.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.endFrameSubscription()", - "type": "instanceMethod", "tldr": "End subscribing for frame presentation events..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsendframesubscription" }, @@ -8152,8 +8564,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.startDrag(item)", - "type": "instanceMethod", "tldr": "Sets the item as dragging item for current drag-drop operation, file is the absolute path of the file to be dragged, and icon is the image showing under the cursor when dragging..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsstartdrag" }, @@ -8210,8 +8623,9 @@ "collection": false, "description": "true if the process of saving page has been initiated successfully." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.savePage(fullPath, saveType, callback)", - "type": "instanceMethod", "tldr": "Returns true if the process of saving page has been initiated successfully.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssavepage" }, @@ -8221,8 +8635,9 @@ "macOS" ], "description": "Shows pop-up dictionary that searches the selected word on the page.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.showDefinitionForSelection()", - "type": "instanceMethod", "tldr": "Shows pop-up dictionary that searches the selected word on the page..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsshowdefinitionforselection" }, @@ -8262,8 +8677,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setSize(options)", - "type": "instanceMethod", "tldr": "Set the size of the page.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetsize" }, @@ -8274,24 +8690,27 @@ "collection": false, "description": "Indicates whether offscreen rendering is enabled." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isOffscreen()", - "type": "instanceMethod", "tldr": "Returns indicates whether offscreen rendering is enabled.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsisoffscreen" }, { "name": "startPainting", "description": "If offscreen rendering is enabled and not painting, start painting.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.startPainting()", - "type": "instanceMethod", "tldr": "If offscreen rendering is enabled and not painting, start painting..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsstartpainting" }, { "name": "stopPainting", "description": "If offscreen rendering is enabled and painting, stop painting.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.stopPainting()", - "type": "instanceMethod", "tldr": "If offscreen rendering is enabled and painting, stop painting..", "url": "https://electronjs.org/docs/api/web-contents#web-contentsstoppainting" }, @@ -8302,8 +8721,9 @@ "collection": false, "description": "If offscreen rendering is enabled returns whether it is currently painting." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.isPainting()", - "type": "instanceMethod", "tldr": "Returns if offscreen rendering is enabled returns whether it is currently painting.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsispainting" }, @@ -8318,8 +8738,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setFrameRate(fps)", - "type": "instanceMethod", "tldr": "If offscreen rendering is enabled sets the frame rate to the specified number.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetframerate" }, @@ -8330,16 +8751,18 @@ "collection": false, "description": "If offscreen rendering is enabled returns the current frame rate." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.getFrameRate()", - "type": "instanceMethod", "tldr": "Returns if offscreen rendering is enabled returns the current frame rate.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgetframerate" }, { "name": "invalidate", "description": "Schedules a full repaint of the window this web contents is in. If offscreen rendering is enabled invalidates the frame and generates a new one through the 'paint' event.", + "type": "api", + "apiType": "instanceMethod", "title": "contents.invalidate()", - "type": "instanceMethod", "tldr": "Schedules a full repaint of the window this web contents is in.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsinvalidate" }, @@ -8350,8 +8773,9 @@ "collection": false, "description": "Returns the WebRTC IP Handling Policy." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.getWebRTCIPHandlingPolicy()", - "type": "instanceMethod", "tldr": "Returns returns the WebRTC IP Handling Policy.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgetwebrtciphandlingpolicy" }, @@ -8385,8 +8809,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "contents.setWebRTCIPHandlingPolicy(policy)", - "type": "instanceMethod", "tldr": "Setting the WebRTC IP handling policy allows you to control which IPs are exposed via WebRTC.", "url": "https://electronjs.org/docs/api/web-contents#web-contentssetwebrtciphandlingpolicy" }, @@ -8397,16 +8822,18 @@ "collection": false, "description": "The pid of the associated renderer process." }, + "type": "api", + "apiType": "instanceMethod", "title": "contents.getOSProcessId()", - "type": "instanceMethod", "tldr": "Returns the pid of the associated renderer process.", "url": "https://electronjs.org/docs/api/web-contents#web-contentsgetosprocessid" }, { "name": "did-finish-load", "description": "Emitted when the navigation is done, i.e. the spinner of the tab has stopped spinning, and the onload event was dispatched.", + "type": "api", + "apiType": "event", "title": "contents.on('did-finish-load')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-finish-load", "tldr": "Emitted when the navigation is done, i.e." }, @@ -8445,8 +8872,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('did-fail-load')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-fail-load", "tldr": "This event is like did-finish-load but emitted when the load failed or was cancelled, e.g." }, @@ -8467,24 +8895,27 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('did-frame-finish-load')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-frame-finish-load", "tldr": "Emitted when a frame has done navigation.." }, { "name": "did-start-loading", "description": "Corresponds to the points in time when the spinner of the tab started spinning.", + "type": "api", + "apiType": "event", "title": "contents.on('did-start-loading')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-start-loading", "tldr": "Corresponds to the points in time when the spinner of the tab started spinning.." }, { "name": "did-stop-loading", "description": "Corresponds to the points in time when the spinner of the tab stopped spinning.", + "type": "api", + "apiType": "event", "title": "contents.on('did-stop-loading')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-stop-loading", "tldr": "Corresponds to the points in time when the spinner of the tab stopped spinning.." }, @@ -8547,8 +8978,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('did-get-response-details')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-get-response-details", "tldr": "Emitted when details regarding a requested resource are available." }, @@ -8605,8 +9037,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('did-get-redirect-request')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-get-redirect-request", "tldr": "Emitted when a redirect is received while requesting a resource.." }, @@ -8621,8 +9054,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('dom-ready')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-dom-ready", "tldr": "Emitted when the document in the given frame is loaded.." }, @@ -8644,8 +9078,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('page-favicon-updated')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-page-favicon-updated", "tldr": "Emitted when page receives favicon urls.." }, @@ -8713,8 +9148,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('new-window')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-new-window", "tldr": "Emitted when the page requests to open a new window for a url." }, @@ -8735,8 +9171,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('will-navigate')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-will-navigate", "tldr": "Emitted when a user or the page wants to start navigation." }, @@ -8757,8 +9194,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('did-navigate')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-navigate", "tldr": "Emitted when a navigation is done." }, @@ -8785,8 +9223,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('did-navigate-in-page')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-navigate-in-page", "tldr": "Emitted when an in-page navigation happened." }, @@ -8801,8 +9240,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('will-prevent-unload')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-will-prevent-unload", "tldr": "Emitted when a beforeunload event handler is attempting to cancel a page unload." }, @@ -8823,8 +9263,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('crashed')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-crashed", "tldr": "Emitted when the renderer process crashes or is killed.." }, @@ -8851,16 +9292,18 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('plugin-crashed')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-plugin-crashed", "tldr": "Emitted when a plugin process has crashed.." }, { "name": "destroyed", "description": "Emitted when webContents is destroyed.", + "type": "api", + "apiType": "event", "title": "contents.on('destroyed')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-destroyed", "tldr": "Emitted when webContents is destroyed.." }, @@ -8940,32 +9383,36 @@ ] } ], + "type": "api", + "apiType": "event", "title": "contents.on('before-input-event')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-before-input-event", "tldr": "Emitted before dispatching the keydown and keyup events in the page." }, { "name": "devtools-opened", "description": "Emitted when DevTools is opened.", + "type": "api", + "apiType": "event", "title": "contents.on('devtools-opened')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-devtools-opened", "tldr": "Emitted when DevTools is opened.." }, { "name": "devtools-closed", "description": "Emitted when DevTools is closed.", + "type": "api", + "apiType": "event", "title": "contents.on('devtools-closed')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-devtools-closed", "tldr": "Emitted when DevTools is closed.." }, { "name": "devtools-focused", "description": "Emitted when DevTools is focused / opened.", + "type": "api", + "apiType": "event", "title": "contents.on('devtools-focused')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-devtools-focused", "tldr": "Emitted when DevTools is focused / opened.." }, @@ -9014,8 +9461,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "contents.on('certificate-error')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-certificate-error", "tldr": "Emitted when failed to verify the certificate for url." }, @@ -9057,8 +9505,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "contents.on('select-client-certificate')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-select-client-certificate", "tldr": "Emitted when a client certificate is requested." }, @@ -9167,8 +9616,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "contents.on('login')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-login", "tldr": "Emitted when webContents wants to do basic auth." }, @@ -9227,24 +9677,27 @@ ] } ], + "type": "api", + "apiType": "event", "title": "contents.on('found-in-page')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-found-in-page", "tldr": "Emitted when a result is available for [webContents.findInPage] request.." }, { "name": "media-started-playing", "description": "Emitted when media starts playing.", + "type": "api", + "apiType": "event", "title": "contents.on('media-started-playing')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-media-started-playing", "tldr": "Emitted when media starts playing.." }, { "name": "media-paused", "description": "Emitted when media is paused or done playing.", + "type": "api", + "apiType": "event", "title": "contents.on('media-paused')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-media-paused", "tldr": "Emitted when media is paused or done playing.." }, @@ -9275,8 +9728,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('did-change-theme-color')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-change-theme-color", "tldr": "Emitted when a page's theme color changes." }, @@ -9297,8 +9751,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('update-target-url')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-update-target-url", "tldr": "Emitted when mouse moves over a link or the keyboard moves the focus to a link.." }, @@ -9346,8 +9801,9 @@ "required": false } ], + "type": "api", + "apiType": "event", "title": "contents.on('cursor-changed')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-cursor-changed", "tldr": "Emitted when the cursor's type changes." }, @@ -9645,8 +10101,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "contents.on('context-menu')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-context-menu", "tldr": "Emitted when there is a new context menu that needs to be handled.." }, @@ -9682,8 +10139,9 @@ ] } ], + "type": "api", + "apiType": "event", "title": "contents.on('select-bluetooth-device')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-select-bluetooth-device", "tldr": "Emitted when bluetooth device needs to be selected on call to navigator.bluetooth.requestDevice." }, @@ -9711,16 +10169,18 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('paint')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-paint", "tldr": "Emitted when a new frame is generated." }, { "name": "devtools-reload-page", "description": "Emitted when the devtools window instructs the webContents to reload", + "type": "api", + "apiType": "event", "title": "contents.on('devtools-reload-page')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-devtools-reload-page", "tldr": "Emitted when the devtools window instructs the webContents to reload." }, @@ -9749,8 +10209,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('will-attach-webview')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-will-attach-webview", "tldr": "Emitted when a 's web contents is being attached to this web contents." }, @@ -9772,8 +10233,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('did-attach-webview')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-did-attach-webview", "tldr": "Emitted when a has been attached to this web contents.." }, @@ -9806,8 +10268,9 @@ "required": true } ], + "type": "api", + "apiType": "event", "title": "contents.on('console-message')", - "type": "event", "url": "https://electronjs.org/docs/api/web-contents#event-console-message", "tldr": "Emitted when the associated window logs a console message." }, @@ -9929,8 +10392,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "webRequest.onBeforeRequest([filter, ]listener)", - "type": "instanceMethod", "tldr": "The listener will be called with listener(details, callback) when a request is about to occur.", "url": "https://electronjs.org/docs/api/web-request#web-requestonbeforerequest" }, @@ -9960,8 +10424,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "webRequest.onBeforeSendHeaders([filter, ]listener)", - "type": "instanceMethod", "tldr": "The listener will be called with listener(details, callback) before sending an HTTP request, once the request headers are available.", "url": "https://electronjs.org/docs/api/web-request#web-requestonbeforesendheaders" }, @@ -10052,8 +10517,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "webRequest.onSendHeaders([filter, ]listener)", - "type": "instanceMethod", "tldr": "The listener will be called with listener(details) just before a request is going to be sent to the server, modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired..", "url": "https://electronjs.org/docs/api/web-request#web-requestonsendheaders" }, @@ -10083,8 +10549,9 @@ "required": true } ], + "type": "api", + "apiType": "instanceMethod", "title": "webRequest.onHeadersReceived([filter, ]listener)", - "type": "instanceMethod", "tldr": "The listener will be called with listener(details, callback) when HTTP response headers of a request have been received.", "url": "https://electronjs.org/docs/api/web-request#web-requestonheadersreceived" }, @@ -10196,8 +10663,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "webRequest.onResponseStarted([filter, ]listener)", - "type": "instanceMethod", "tldr": "The listener will be called with listener(details) when first byte of the response body is received.", "url": "https://electronjs.org/docs/api/web-request#web-requestonresponsestarted" }, @@ -10316,8 +10784,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "webRequest.onBeforeRedirect([filter, ]listener)", - "type": "instanceMethod", "tldr": "The listener will be called with listener(details) when a server initiated redirect is about to occur..", "url": "https://electronjs.org/docs/api/web-request#web-requestonbeforeredirect" }, @@ -10429,8 +10898,9 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "webRequest.onCompleted([filter, ]listener)", - "type": "instanceMethod", "tldr": "The listener will be called with listener(details) when a request is completed..", "url": "https://electronjs.org/docs/api/web-request#web-requestoncompleted" }, @@ -10527,9 +10997,570 @@ ] } ], + "type": "api", + "apiType": "instanceMethod", "title": "webRequest.onErrorOccurred([filter, ]listener)", - "type": "instanceMethod", "tldr": "The listener will be called with listener(details) when an error occurs..", "url": "https://electronjs.org/docs/api/web-request#web-requestonerroroccurred" + }, + { + "type": "tutorial", + "title": "About Electron", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/about.md", + "url": "https://electronjs.org/docs/tutorial/about", + "slug": "about", + "body": "About Electron\nElectron is an open source library developed by GitHub for building cross-platform desktop applications with HTML, CSS, and JavaScript. Electron accomplishes this by combining Chromium and Node.js into a single runtime and apps can be packaged for Mac, Windows, and Linux.\nElectron began in 2013 as the framework on which Atom, GitHub's hackable text editor, would be built. The two were open sourced in the Spring of 2014.\nIt has since become a popular tool used by open source developers, startups, and established companies. See who is building on Electron.\nRead on to learn more about the contributors and releases of Electron or get started building with Electron in the Quick Start Guide.\n\n\nCore Team and Contributors\nElectron is maintained by a team at GitHub as well as a group of active contributors from the community. Some of the contributors are individuals and some work at larger companies who are developing on Electron. We're happy to add frequent contributors to the project as maintainers. Read more about contributing to Electron.\n\n\nReleases\nElectron releases frequently. We release when there are significant bug fixes, new APIs or are updating versions of Chromium or Node.js.\n\n\nUpdating Dependencies\nElectron's version of Chromium is usually updated within one or two weeks after a new stable Chromium version is released, depending on the effort involved in the upgrade.\nWhen a new version of Node.js is released, Electron usually waits about a month before upgrading in order to bring in a more stable version.\nIn Electron, Node.js and Chromium share a single V8 instance—usually the version that Chromium is using. Most of the time this just works but sometimes it means patching Node.js.\n\n\nVersioning\nAs of version 2.0 Electron follows semver.\nFor most applications, and using any recent version of npm,\nrunning $ npm install electron will do the right thing.\nThe version update process is detailed explicitly in our Versioning Doc.\n\n\nLTS\nLong term support of older versions of Electron does not currently exist. If your current version of Electron works for you, you can stay on it for as long as you'd like. If you want to make use of new features as they come in you should upgrade to a newer version.\nA major update came with version v1.0.0. If you're not yet using this version, you should read more about the v1.0.0 changes.\n\n\nCore Philosophy\nIn order to keep Electron small (file size) and sustainable (the spread of dependencies and APIs) the project limits the scope of the core project.\nFor instance, Electron uses Chromium's rendering library rather than all of Chromium. This makes it easier to upgrade Chromium but also means some browser features found in Google Chrome do not exist in Electron.\nNew features added to Electron should primarily be native APIs. If a feature can be its own Node.js module, it probably should be. See the Electron tools built by the community.\n\n\nHistory\nBelow are milestones in Electron's history.\n\n\n\n:calendar:\n:tada:\n\n\n\n\nApril 2013\nAtom Shell is started\n.\n\n\nMay 2014\nAtom Shell is open sourced\n.\n\n\nApril 2015\nAtom Shell is re-named Electron\n.\n\n\nMay 2016\nElectron releases v1.0.0\n.\n\n\nMay 2016\nElectron apps compatible with Mac App Store\n.\n\n\nAugust 2016\nWindows Store support for Electron apps\n.\n\n\n\n" + }, + { + "type": "tutorial", + "title": "Accessibility", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/accessibility.md", + "url": "https://electronjs.org/docs/tutorial/accessibility", + "slug": "accessibility", + "body": "Accessibility\nMaking accessible applications is important and we're happy to introduce new\nfunctionality to Devtron and Spectron that gives\ndevelopers the opportunity to make their apps better for everyone.\n\nAccessibility concerns in Electron applications are similar to those of\nwebsites because they're both ultimately HTML. With Electron apps, however,\nyou can't use the online resources for accessibility audits because your app\ndoesn't have a URL to point the auditor to.\nThese new features bring those auditing tools to your Electron app. You can\nchoose to add audits to your tests with Spectron or use them within DevTools\nwith Devtron. Read on for a summary of the tools.\n\n\nSpectron\nIn the testing framework Spectron, you can now audit each window and \ntag in your application. For example:\napp.client.auditAccessibility().then(function (audit) {\n if (audit.failed) {\n console.error(audit.message)\n }\n})\nYou can read more about this feature in Spectron's documentation.\n\n\nDevtron\nIn Devtron, there is a new accessibility tab which will allow you to audit a\npage in your app, sort and filter the results.\n\nBoth of these tools are using the Accessibility Developer Tools\nlibrary built by Google for Chrome. You can learn more about the accessibility\naudit rules this library uses on that repository's wiki.\nIf you know of other great accessibility tools for Electron, add them to the\naccessibility documentation with a pull request.\n\n\nEnabling Accessibility\nElectron applications keep accessibility disabled by default for performance\nreasons but there are multiple ways to enable it.\n\n\nInside Application\nBy using app.setAccessibilitySupportEnabled(enabled),\nyou can expose accessibility switch to users in the application preferences.\nUser's system assistive utilities have priority over this setting and will\noverride it.\n\n\nAssistive Technology\nElectron application will enable accessibility automatically when it detects\nassistive technology (Windows) or VoiceOver (macOS). See Chrome's\naccessibility documentation for more details.\nOn macOS, third-party assistive technology can switch accessibility inside\nElectron applications by setting the attribute AXManualAccessibility\nprogrammatically:\nCFStringRef kAXManualAccessibility = CFSTR(\"AXManualAccessibility\");\n\n+ (void)enableAccessibility:(BOOL)enable inElectronApplication:(NSRunningApplication *)app\n{\n AXUIElementRef appRef = AXUIElementCreateApplication(app.processIdentifier);\n if (appRef == nil)\n return;\n\n CFBooleanRef value = enable ? kCFBooleanTrue : kCFBooleanFalse;\n AXUIElementSetAttributeValue(appRef, kAXManualAccessibility, value);\n CFRelease(appRef);\n}\n" + }, + { + "type": "tutorial", + "title": "Electron Application Architecture", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/application-architecture.md", + "url": "https://electronjs.org/docs/tutorial/application-architecture", + "slug": "application-architecture", + "body": "Electron Application Architecture\nBefore we can dive into Electron's APIs, we need to discuss the two process\ntypes available in Electron. They are fundamentally different and important to\nunderstand.\n\n\nMain and Renderer Processes\nIn Electron, the process that runs package.json's main script is called\nthe main process. The script that runs in the main process can display a\nGUI by creating web pages. An Electron app always has one main process, but\nnever more.\nSince Electron uses Chromium for displaying web pages, Chromium's\nmulti-process architecture is also used. Each web page in Electron runs in\nits own process, which is called the renderer process.\nIn normal browsers, web pages usually run in a sandboxed environment and are not\nallowed access to native resources. Electron users, however, have the power to\nuse Node.js APIs in web pages allowing lower level operating system\ninteractions.\n\n\nDifferences Between Main Process and Renderer Process\nThe main process creates web pages by creating BrowserWindow instances. Each\nBrowserWindow instance runs the web page in its own renderer process. When a\nBrowserWindow instance is destroyed, the corresponding renderer process\nis also terminated.\nThe main process manages all web pages and their corresponding renderer\nprocesses. Each renderer process is isolated and only cares about the web page\nrunning in it.\nIn web pages, calling native GUI related APIs is not allowed because managing\nnative GUI resources in web pages is very dangerous and it is easy to leak\nresources. If you want to perform GUI operations in a web page, the renderer\nprocess of the web page must communicate with the main process to request that\nthe main process perform those operations.\n\nAside: Communication Between Processes\nIn Electron, we have several ways to communicate between the main process\nand renderer processes. Like ipcRenderer and\nipcMain modules for sending messages, and the\nremote module for RPC style communication. There is also\nan FAQ entry on how to share data between web pages.\n\n\n\nUsing Electron APIs\nElectron offers a number of APIs that support the development of a desktop\napplication in both the main process and the renderer process. In both\nprocesses, you'd access Electron's APIs by requiring its included module:\nconst electron = require('electron')\nAll Electron APIs are assigned a process type. Many of them can only be\nused from the main process, some of them only from a renderer process,\nsome from both. The documentation for each individual API will\nstate which process it can be used from.\nA window in Electron is for instance created using the BrowserWindow\nclass. It is only available in the main process.\n// This will work in the main process, but be `undefined` in a\n// renderer process:\nconst { BrowserWindow } = require('electron')\n\nconst win = new BrowserWindow()\nSince communication between the processes is possible, a renderer process\ncan call upon the main process to perform tasks. Electron comes with a\nmodule called remote that exposes APIs usually only available on the\nmain process. In order to create a BrowserWindow from a renderer process,\nwe'd use the remote as a middle-man:\n// This will work in a renderer process, but be `undefined` in the\n// main process:\nconst { remote } = require('electron')\nconst { BrowserWindow } = remote\n\nconst win = new BrowserWindow()\n\n\nUsing Node.js APIs\nElectron exposes full access to Node.js both in the main and the renderer\nprocess. This has two important implications:\n1) All APIs available in Node.js are available in Electron. Calling the\nfollowing code from an Electron app works:\nconst fs = require('fs')\n\nconst root = fs.readdirSync('/')\n\n// This will print all files at the root-level of the disk,\n// either '/' or 'C:\\'.\nconsole.log(root)\nAs you might already be able to guess, this has important security implications\nif you ever attempt to load remote content. You can find more information and\nguidance on loading remote content in our security documentation.\n2) You can use Node.js modules in your application. Pick your favorite npm\nmodule. npm offers currently the world's biggest repository of open-source\ncode – the ability to use well-maintained and tested code that used to be\nreserved for server applications is one of the key features of Electron.\nAs an example, to use the official AWS SDK in your application, you'd first\ninstall it as a dependency:\nnpm install --save aws-sdk\nThen, in your Electron app, require and use the module as if you were\nbuilding a Node.js application:\n// A ready-to-use S3 Client\nconst S3 = require('aws-sdk/clients/s3')\nThere is one important caveat: Native Node.js modules (that is, modules that\nrequire compilation of native code before they can be used) will need to be\ncompiled to be used with Electron.\nThe vast majority of Node.js modules are not native. Only 400 out of the\n~650.000 modules are native. However, if you do need native modules, please\nconsult this guide on how to recompile them for Electron.\n" + }, + { + "type": "tutorial", + "title": "Application Debugging", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/application-debugging.md", + "url": "https://electronjs.org/docs/tutorial/application-debugging", + "slug": "application-debugging", + "body": "Application Debugging\nWhenever your Electron application is not behaving the way you wanted it to,\nan array of debugging tools might help you find coding errors, performance\nbottlenecks, or optimization opportunities.\n\n\nRenderer Process\nThe most comprehensive tool to debug individual renderer processes is the\nChromium Developer Toolset. It is available for all renderer processes,\nincluding instances of BrowserWindow, BrowserView, and WebView. You\ncan open them programmatically by calling the openDevTools() API on the\nwebContents of the instance:\nconst { BrowserWindow } = require('electron')\n\nlet win = new BrowserWindow()\nwin.webContents.openDevTools()\nGoogle offers excellent documentation for their developer tools.\nWe recommend that you make yourself familiar with them - they are usually one\nof the most powerful utilities in any Electron Developer's tool belt.\n\n\nMain Process\nDebugging the main process is a bit trickier, since you cannot open\ndeveloper tools for them. The Chromium Developer Tools can be used\nto debug Electron's main process thanks to a closer collaboration\nbetween Google / Chrome and Node.js, but you might encounter oddities like\nrequire not being present in the console.\nFor more information, see the Debugging the Main Process documentation.\n" + }, + { + "type": "tutorial", + "title": "Application Distribution", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/application-distribution.md", + "url": "https://electronjs.org/docs/tutorial/application-distribution", + "slug": "application-distribution", + "body": "Application Distribution\nTo distribute your app with Electron, you need to download Electron's prebuilt\nbinaries. Next, the folder\ncontaining your app should be named app and placed in Electron's resources\ndirectory as shown in the following examples. Note that the location of\nElectron's prebuilt binaries is indicated with electron/ in the examples\nbelow.\nOn macOS:\nelectron/Electron.app/Contents/Resources/app/\n├── package.json\n├── main.js\n└── index.html\nOn Windows and Linux:\nelectron/resources/app\n├── package.json\n├── main.js\n└── index.html\nThen execute Electron.app (or electron on Linux, electron.exe on Windows),\nand Electron will start as your app. The electron directory will then be\nyour distribution to deliver to final users.\n\n\nPackaging Your App into a File\nApart from shipping your app by copying all of its source files, you can also\npackage your app into an asar archive to avoid\nexposing your app's source code to users.\nTo use an asar archive to replace the app folder, you need to rename the\narchive to app.asar, and put it under Electron's resources directory like\nbelow, and Electron will then try to read the archive and start from it.\nOn macOS:\nelectron/Electron.app/Contents/Resources/\n└── app.asar\nOn Windows and Linux:\nelectron/resources/\n└── app.asar\nMore details can be found in Application packaging.\n\n\nRebranding with Downloaded Binaries\nAfter bundling your app into Electron, you will want to rebrand Electron\nbefore distributing it to users.\n\n\nWindows\nYou can rename electron.exe to any name you like, and edit its icon and other\ninformation with tools like rcedit.\n\n\nmacOS\nYou can rename Electron.app to any name you want, and you also have to rename\nthe CFBundleDisplayName, CFBundleIdentifier and CFBundleName fields in the\nfollowing files:\n\nElectron.app/Contents/Info.plist\nElectron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist\n\nYou can also rename the helper app to avoid showing Electron Helper in the\nActivity Monitor, but make sure you have renamed the helper app's executable\nfile's name.\nThe structure of a renamed app would be like:\nMyApp.app/Contents\n├── Info.plist\n├── MacOS/\n│   └── MyApp\n└── Frameworks/\n ├── MyApp Helper EH.app\n | ├── Info.plist\n | └── MacOS/\n |    └── MyApp Helper EH\n ├── MyApp Helper NP.app\n | ├── Info.plist\n | └── MacOS/\n |    └── MyApp Helper NP\n └── MyApp Helper.app\n ├── Info.plist\n └── MacOS/\n    └── MyApp Helper\n\n\nLinux\nYou can rename the electron executable to any name you like.\n\n\nPackaging Tools\nApart from packaging your app manually, you can also choose to use third party\npackaging tools to do the work for you:\n\nelectron-forge\nelectron-builder\nelectron-packager\n\n\n\nRebranding by Rebuilding Electron from Source\nIt is also possible to rebrand Electron by changing the product name and\nbuilding it from source. To do this you need to modify the atom.gyp file and\nhave a clean rebuild.\n\n\nCreating a Custom Electron Fork\nCreating a custom fork of Electron is almost certainly not something you will\nneed to do in order to build your app, even for \"Production Level\" applications.\nUsing a tool such as electron-packager or electron-forge will allow you to\n\"Rebrand\" Electron without having to do these steps.\nYou need to fork Electron when you have custom C++ code that you have patched\ndirectly into Electron, that either cannot be upstreamed, or has been rejected\nfrom the official version. As maintainers of Electron, we very much would like\nto make your scenario work, so please try as hard as you can to get your changes\ninto the official version of Electron, it will be much much easier on you, and\nwe appreciate your help.\n\n\nCreating a Custom Release with surf-build\n\n\nInstall Surf, via npm:\nnpm install -g surf-build@latest\n\n\nCreate a new S3 bucket and create the following empty directory structure:\n- atom-shell/\n - symbols/\n - dist/\n\n\nSet the following Environment Variables:\n\n\n\nELECTRON_GITHUB_TOKEN - a token that can create releases on GitHub\nELECTRON_S3_ACCESS_KEY, ELECTRON_S3_BUCKET, ELECTRON_S3_SECRET_KEY -\nthe place where you'll upload node.js headers as well as symbols\nELECTRON_RELEASE - Set to true and the upload part will run, leave unset\nand surf-build will do CI-type checks, appropriate to run for every\npull request.\nCI - Set to true or else it will fail\nGITHUB_TOKEN - set it to the same as ELECTRON_GITHUB_TOKEN\nSURF_TEMP - set to C:\\Temp on Windows to prevent path too long issues\nTARGET_ARCH - set to ia32 or x64\n\n\n\nIn script/upload.py, you must set ELECTRON_REPO to your fork (MYORG/electron),\nespecially if you are a contributor to Electron proper.\n\n\nsurf-build -r https://github.com/MYORG/electron -s YOUR_COMMIT -n 'surf-PLATFORM-ARCH'\n\n\nWait a very, very long time for the build to complete.\n\n\n" + }, + { + "type": "tutorial", + "title": "Application Packaging", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/application-packaging.md", + "url": "https://electronjs.org/docs/tutorial/application-packaging", + "slug": "application-packaging", + "body": "Application Packaging\nTo mitigate issues around long\npath names on Windows, slightly speed up require and conceal your source code\nfrom cursory inspection, you can choose to package your app into an asar\narchive with little changes to your source code.\nMost users will get this feature for free, since it's supported out of the box\nby electron-packager, electron-forge,\nand electron-builder. If you are not using any of these\ntools, read on.\n\n\nGenerating asar Archives\nAn asar archive is a simple tar-like format that concatenates files\ninto a single file. Electron can read arbitrary files from it without unpacking\nthe whole file.\nSteps to package your app into an asar archive:\n\n\n1. Install the asar Utility\n$ npm install -g asar\n\n\n2. Package with asar pack\n$ asar pack your-app app.asar\n\n\nUsing asar Archives\nIn Electron there are two sets of APIs: Node APIs provided by Node.js and Web\nAPIs provided by Chromium. Both APIs support reading files from asar archives.\n\n\nNode API\nWith special patches in Electron, Node APIs like fs.readFile and require\ntreat asar archives as virtual directories, and the files in it as normal\nfiles in the filesystem.\nFor example, suppose we have an example.asar archive under /path/to:\n$ asar list /path/to/example.asar\n/app.js\n/file.txt\n/dir/module.js\n/static/index.html\n/static/main.css\n/static/jquery.min.js\nRead a file in the asar archive:\nconst fs = require('fs')\nfs.readFileSync('/path/to/example.asar/file.txt')\nList all files under the root of the archive:\nconst fs = require('fs')\nfs.readdirSync('/path/to/example.asar')\nUse a module from the archive:\nrequire('/path/to/example.asar/dir/module.js')\nYou can also display a web page in an asar archive with BrowserWindow:\nconst { BrowserWindow } = require('electron')\nconst win = new BrowserWindow()\n\nwin.loadURL('file:///path/to/example.asar/static/index.html')\n\n\nWeb API\nIn a web page, files in an archive can be requested with the file: protocol.\nLike the Node API, asar archives are treated as directories.\nFor example, to get a file with $.get:\n\n\n\nTreating an asar Archive as a Normal File\nFor some cases like verifying the asar archive's checksum, we need to read the\ncontent of an asar archive as a file. For this purpose you can use the built-in\noriginal-fs module which provides original fs APIs without asar support:\nconst originalFs = require('original-fs')\noriginalFs.readFileSync('/path/to/example.asar')\nYou can also set process.noAsar to true to disable the support for asar in\nthe fs module:\nconst fs = require('fs')\nprocess.noAsar = true\nfs.readFileSync('/path/to/example.asar')\n\n\nLimitations of the Node API\nEven though we tried hard to make asar archives in the Node API work like\ndirectories as much as possible, there are still limitations due to the\nlow-level nature of the Node API.\n\n\nArchives Are Read-only\nThe archives can not be modified so all Node APIs that can modify files will not\nwork with asar archives.\n\n\nWorking Directory Can Not Be Set to Directories in Archive\nThough asar archives are treated as directories, there are no actual\ndirectories in the filesystem, so you can never set the working directory to\ndirectories in asar archives. Passing them as the cwd option of some APIs\nwill also cause errors.\n\n\nExtra Unpacking on Some APIs\nMost fs APIs can read a file or get a file's information from asar archives\nwithout unpacking, but for some APIs that rely on passing the real file path to\nunderlying system calls, Electron will extract the needed file into a\ntemporary file and pass the path of the temporary file to the APIs to make them\nwork. This adds a little overhead for those APIs.\nAPIs that requires extra unpacking are:\n\nchild_process.execFile\nchild_process.execFileSync\nfs.open\nfs.openSync\nprocess.dlopen - Used by require on native modules\n\n\n\nFake Stat Information of fs.stat\nThe Stats object returned by fs.stat and its friends on files in asar\narchives is generated by guessing, because those files do not exist on the\nfilesystem. So you should not trust the Stats object except for getting file\nsize and checking file type.\n\n\nExecuting Binaries Inside asar Archive\nThere are Node APIs that can execute binaries like child_process.exec,\nchild_process.spawn and child_process.execFile, but only execFile is\nsupported to execute binaries inside asar archive.\nThis is because exec and spawn accept command instead of file as input,\nand commands are executed under shell. There is no reliable way to determine\nwhether a command uses a file in asar archive, and even if we do, we can not be\nsure whether we can replace the path in command without side effects.\n\n\nAdding Unpacked Files to asar Archives\nAs stated above, some Node APIs will unpack the file to the filesystem when\ncalled. Apart from the performance issues, various anti-virus scanners might\nbe triggered by this behavior.\nAs a workaround, you can leave various files unpacked using the --unpack option.\nIn the following example, shared libraries of native Node.js modules will not be\npacked:\n$ asar pack app app.asar --unpack *.node\nAfter running the command, you will notice that a folder named app.asar.unpacked\nwas created together with the app.asar file. It contains the unpacked files\nand should be shipped together with the app.asar archive.\n" + }, + { + "type": "tutorial", + "title": "Technical Differences Between Electron and NW.js (formerly node-webkit)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/atom-shell-vs-node-webkit.md", + "url": "https://electronjs.org/docs/tutorial/atom-shell-vs-node-webkit", + "slug": "atom-shell-vs-node-webkit", + "body": "Technical Differences Between Electron and NW.js (formerly node-webkit)\nNote: Electron was previously named Atom Shell.\nLike NW.js, Electron provides a platform to write desktop applications\nwith JavaScript and HTML and has Node integration to grant access to the low\nlevel system from web pages.\nBut there are also fundamental differences between the two projects that make\nElectron a completely separate product from NW.js:\n1. Entry of Application\nIn NW.js the main entry point of an application is a web page or a JS script. You specify a\nhtml or js file in the package.json and it is opened in a browser window as\nthe application's main window (in case of an html entrypoint) or the script is executed.\nIn Electron, the entry point is a JavaScript script. Instead of\nproviding a URL directly, you manually create a browser window and load\nan HTML file using the API. You also need to listen to window events\nto decide when to quit the application.\nElectron works more like the Node.js runtime. Electron's APIs are lower level\nso you can use it for browser testing in place of PhantomJS.\n2. Build System\nIn order to avoid the complexity of building all of Chromium, Electron uses libchromiumcontent to access\nChromium's Content API. libchromiumcontent is a single shared library that\nincludes the Chromium Content module and all of its dependencies. Users don't\nneed a powerful machine to build Electron.\n3. Node Integration\nIn NW.js, the Node integration in web pages requires patching Chromium to\nwork, while in Electron we chose a different way to integrate the libuv loop\nwith each platform's message loop to avoid hacking Chromium. See the\nnode_bindings code for how that was done.\n4. Multi-context\nIf you are an experienced NW.js user, you should be familiar with the\nconcept of Node context and web context. These concepts were invented because\nof how NW.js was implemented.\nBy using the multi-context\nfeature of Node, Electron doesn't introduce a new JavaScript context in web\npages.\nNote: NW.js has optionally supported multi-context since 0.13.\n" + }, + { + "type": "tutorial", + "title": "Automated Testing with a Custom Driver", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/automated-testing-with-a-custom-driver.md", + "url": "https://electronjs.org/docs/tutorial/automated-testing-with-a-custom-driver", + "slug": "automated-testing-with-a-custom-driver", + "body": "Automated Testing with a Custom Driver\nTo write automated tests for your Electron app, you will need a way to \"drive\" your application. Spectron is a commonly-used solution which lets you emulate user actions via WebDriver. However, it's also possible to write your own custom driver using node's builtin IPC-over-STDIO. The benefit of a custom driver is that it tends to require less overhead than Spectron, and lets you expose custom methods to your test suite.\nTo create a custom driver, we'll use nodejs' child_process API. The test suite will spawn the Electron process, then establish a simple messaging protocol:\nvar childProcess = require('child_process')\nvar electronPath = require('electron')\n\n// spawn the process\nvar env = { /* ... */ }\nvar stdio = ['inherit', 'inherit', 'inherit', 'ipc']\nvar appProcess = childProcess.spawn(electronPath, ['./app'], {stdio, env})\n\n// listen for IPC messages from the app\nappProcess.on('message', (msg) => {\n // ...\n})\n\n// send an IPC message to the app\nappProcess.send({my: 'message'})\nFrom within the Electron app, you can listen for messages and send replies using the nodejs process API:\n// listen for IPC messages from the test suite\nprocess.on('message', (msg) => {\n // ...\n})\n\n// send an IPC message to the test suite\nprocess.send({my: 'message'})\nWe can now communicate from the test suite to the Electron app using the appProcess object.\nFor convenience, you may want to wrap appProcess in a driver object that provides more high-level functions. Here is an example of how you can do this:\nclass TestDriver {\n constructor ({path, args, env}) {\n this.rpcCalls = []\n\n // start child process\n env.APP_TEST_DRIVER = 1 // let the app know it should listen for messages\n this.process = childProcess.spawn(path, args, {stdio: ['inherit', 'inherit', 'inherit', 'ipc'], env})\n\n // handle rpc responses\n this.process.on('message', (message) => {\n // pop the handler\n var rpcCall = this.rpcCalls[message.msgId]\n if (!rpcCall) return\n this.rpcCalls[message.msgId] = null\n // reject/resolve\n if (message.reject) rpcCall.reject(message.reject)\n else rpcCall.resolve(message.resolve)\n })\n\n // wait for ready\n this.isReady = this.rpc('isReady').catch((err) => {\n console.error('Application failed to start', err)\n this.stop()\n process.exit(1)\n })\n }\n\n // simple RPC call\n // to use: driver.rpc('method', 1, 2, 3).then(...)\n async rpc (cmd, ...args) {\n // send rpc request\n var msgId = this.rpcCalls.length\n this.process.send({msgId, cmd, args})\n return new Promise((resolve, reject) => this.rpcCalls.push({resolve, reject}))\n }\n\n stop () {\n this.process.kill()\n }\n}\nIn the app, you'd need to write a simple handler for the RPC calls:\nif (process.env.APP_TEST_DRIVER) {\n process.on('message', onMessage)\n}\n\nasync function onMessage ({msgId, cmd, args}) {\n var method = METHODS[cmd]\n if (!method) method = () => new Error('Invalid method: ' + cmd)\n try {\n var resolve = await method(...args)\n process.send({msgId, resolve})\n } catch (err) {\n var reject = {\n message: err.message,\n stack: err.stack,\n name: err.name\n }\n process.send({msgId, reject})\n }\n}\n\nconst METHODS = {\n isReady () {\n // do any setup needed\n return true\n }\n // define your RPC-able methods here\n}\nThen, in your test suite, you can use your test-driver as follows:\nvar test = require('ava')\nvar electronPath = require('electron')\n\nvar app = new TestDriver({\n path: electronPath,\n args: ['./app'],\n env: {\n NODE_ENV: 'test'\n }\n})\ntest.before(async t => {\n await app.isReady\n})\ntest.after.always('cleanup', async t => {\n await app.stop()\n})\n" + }, + { + "type": "tutorial", + "title": "Boilerplates and CLIs", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/boilerplates-and-clis.md", + "url": "https://electronjs.org/docs/tutorial/boilerplates-and-clis", + "slug": "boilerplates-and-clis", + "body": "Boilerplates and CLIs\nElectron development is un-opinionated - there is no \"one true way\" to develop,\nbuild, package, or release an Electron application. Additional features for\nElectron, both for build- and run-time, can usually be found on\nnpm in individual packages, allowing developers to build both\nthe app and build pipeline they need.\nThat level of modularity and extendability ensures that all developers working\nwith Electron, both big and small in team-size, are never restricted in what\nthey can or cannot do at any time during their development lifecycle. However,\nfor many developers, one of the community-driven boilerplates or command line\ntools might make it dramatically easier to compile, package, and release an\napp.\n\n\nBoilerplate vs CLI\nA boilerplate is only a starting point - a canvas, so to speak - from which\nyou build your application. They usually come in the form of a repository you\ncan clone and customize to your heart's content.\nA command line tool on the other hand continues to support you throughout the\ndevelopment and release. They are more helpful and supportive but enforce\nguidelines on how your code should be structured and built. Especially for\nbeginners, using a command line tool is likely to be helpful.\n\n\nelectron-forge\nA \"complete tool for building modern Electron applications\". Electron Forge\nunifies the existing (and well maintained) build tools for Electron development\ninto a cohesive package so that anyone can jump right in to Electron\ndevelopment.\nForge comes with ready-to-use templates for popular\nframeworks like React, Vue, or Angular. It uses the same core modules used by the\ngreater Electron community (like electron-packager) – \nchanges made by Electron maintainers (like Slack) benefit Forge's users, too.\nYou can find more information and documentation on electronforge.io.\n\n\nelectron-builder\nA \"complete solution to package and build a ready-for-distribution Electron app\"\nthat focuses on an integrated experience. electron-builder adds one\nsingle dependency focused on simplicity and manages all further requirements\ninternally.\nelectron-builder replaces features and modules used by the Electron\nmaintainers (such as the auto-updater) with custom ones. They are generally\ntighter integrated but will have less in common with popular Electron apps\nlike Atom, Visual Studio Code, or Slack.\nYou can find more information and documentation in the repository.\n\n\nelectron-react-boilerplate\nIf you don't want any tools but only a solid boilerplate to build from,\nCT Lin's electron-react-boilerplate might be worth\na look. It's quite popular in the community and uses electron-builder\ninternally.\n\n\nOther Tools and Boilerplates\nThe \"Awesome Electron\" list contains more tools and boilerplates\nto choose from. If you find the length of the list intimidating, don't\nforget that adding tools as you go along is a valid approach, too.\n" + }, + { + "type": "tutorial", + "title": "Build Instructions (Linux)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/build-instructions-linux.md", + "url": "https://electronjs.org/docs/tutorial/build-instructions-linux", + "slug": "build-instructions-linux", + "body": "Build Instructions (Linux)\nFollow the guidelines below for building Electron on Linux.\n\n\nPrerequisites\n\nAt least 25GB disk space and 8GB RAM.\nPython 2.7.x. Some distributions like CentOS 6.x still use Python 2.6.x\nso you may need to check your Python version with python -V.\nNode.js. There are various ways to install Node. You can download\nsource code from nodejs.org and compile it.\nDoing so permits installing Node on your own home directory as a standard user.\nOr try repositories such as NodeSource.\nclang 3.4 or later.\nDevelopment headers of GTK+ and libnotify.\n\nOn Ubuntu, install the following libraries:\n$ sudo apt-get install build-essential clang libdbus-1-dev libgtk-3-dev \\\n libnotify-dev libgnome-keyring-dev libgconf2-dev \\\n libasound2-dev libcap-dev libcups2-dev libxtst-dev \\\n libxss1 libnss3-dev gcc-multilib g++-multilib curl \\\n gperf bison\nOn RHEL / CentOS, install the following libraries:\n$ sudo yum install clang dbus-devel gtk3-devel libnotify-devel \\\n libgnome-keyring-devel xorg-x11-server-utils libcap-devel \\\n cups-devel libXtst-devel alsa-lib-devel libXrandr-devel \\\n GConf2-devel nss-devel\nOn Fedora, install the following libraries:\n$ sudo dnf install clang dbus-devel gtk3-devel libnotify-devel \\\n libgnome-keyring-devel xorg-x11-server-utils libcap-devel \\\n cups-devel libXtst-devel alsa-lib-devel libXrandr-devel \\\n GConf2-devel nss-devel\nOther distributions may offer similar packages for installation via package\nmanagers such as pacman. Or one can compile from source code.\n\n\nGetting the Code\n$ git clone https://github.com/electron/electron\n\n\nBootstrapping\nThe bootstrap script will download all necessary build dependencies and create\nthe build project files. You must have Python 2.7.x for the script to succeed.\nDownloading certain files can take a long time. Notice that we are using\nninja to build Electron so there is no Makefile generated.\n$ cd electron\n$ ./script/bootstrap.py --verbose\nIf you are using editor supports JSON compilation database based\nlanguage server, you can generate it:\n$ ./script/build.py --compdb\n\n\nCross compilation\nIf you want to build for an arm target you should also install the following\ndependencies:\n$ sudo apt-get install libc6-dev-armhf-cross linux-libc-dev-armhf-cross \\\n g++-arm-linux-gnueabihf\nSimilarly for arm64, install the following:\n$ sudo apt-get install libc6-dev-arm64-cross linux-libc-dev-arm64-cross \\\n g++-aarch64-linux-gnu\nAnd to cross-compile for arm or ia32 targets, you should pass the\n--target_arch parameter to the bootstrap.py script:\n$ ./script/bootstrap.py -v --target_arch=arm\n\n\nBuilding\nIf you would like to build both Release and Debug targets:\n$ ./script/build.py\nThis script will cause a very large Electron executable to be placed in\nthe directory out/R. The file size is in excess of 1.3 gigabytes. This\nhappens because the Release target binary contains debugging symbols.\nTo reduce the file size, run the create-dist.py script:\n$ ./script/create-dist.py\nThis will put a working distribution with much smaller file sizes in\nthe dist directory. After running the create-dist.py script, you\nmay want to remove the 1.3+ gigabyte binary which is still in out/R.\nYou can also build the Debug target only:\n$ ./script/build.py -c D\nAfter building is done, you can find the electron debug binary under out/D.\n\n\nCleaning\nTo clean the build files:\n$ npm run clean\nTo clean only out and dist directories:\n$ npm run clean-build\nNote: Both clean commands require running bootstrap again before building.\n\n\nTroubleshooting\n\n\nError While Loading Shared Libraries: libtinfo.so.5\nPrebuilt clang will try to link to libtinfo.so.5. Depending on the host\narchitecture, symlink to appropriate libncurses:\n$ sudo ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5\n\n\nTests\nSee Build System Overview: Tests\n\n\nAdvanced topics\nThe default building configuration is targeted for major desktop Linux\ndistributions. To build for a specific distribution or device, the following\ninformation may help you.\n\n\nBuilding libchromiumcontent locally\nTo avoid using the prebuilt binaries of libchromiumcontent, you can build libchromiumcontent locally. To do so, follow these steps:\n\nInstall depot_tools\nInstall additional build dependencies\nFetch the git submodules:\n\n$ git submodule update --init --recursive\n\nPass the --build_release_libcc switch to bootstrap.py script:\n\n$ ./script/bootstrap.py -v --build_release_libcc\nNote that by default the shared_library configuration is not built, so you can\nonly build Release version of Electron if you use this mode:\n$ ./script/build.py -c R\n\n\nUsing system clang instead of downloaded clang binaries\nBy default Electron is built with prebuilt\nclang binaries provided by the\nChromium project. If for some reason you want to build with the clang\ninstalled in your system, you can call bootstrap.py with --clang_dir=\nswitch. By passing it the build script will assume the clang binaries reside\nin /bin/.\nFor example if you installed clang under /user/local/bin/clang:\n$ ./script/bootstrap.py -v --build_release_libcc --clang_dir /usr/local\n$ ./script/build.py -c R\n\n\nUsing compilers other than clang\nTo build Electron with compilers like g++, you first need to disable clang\nwith --disable_clang switch first, and then set CC and CXX environment\nvariables to the ones you want.\nFor example building with GCC toolchain:\n$ env CC=gcc CXX=g++ ./script/bootstrap.py -v --build_release_libcc --disable_clang\n$ ./script/build.py -c R\n\n\nEnvironment variables\nApart from CC and CXX, you can also set the following environment variables to\ncustomise the build configuration:\n\nCPPFLAGS\nCPPFLAGS_host\nCFLAGS\nCFLAGS_host\nCXXFLAGS\nCXXFLAGS_host\nAR\nAR_host\nCC\nCC_host\nCXX\nCXX_host\nLDFLAGS\n\nThe environment variables have to be set when executing the bootstrap.py\nscript, it won't work in the build.py script.\n" + }, + { + "type": "tutorial", + "title": "Build Instructions (macOS)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/build-instructions-osx.md", + "url": "https://electronjs.org/docs/tutorial/build-instructions-osx", + "slug": "build-instructions-osx", + "body": "Build Instructions (macOS)\nFollow the guidelines below for building Electron on macOS.\n\n\nPrerequisites\n\nmacOS >= 10.11.6\nXcode >= 8.2.1\nnode.js (external)\n\nIf you are using the Python downloaded by Homebrew, you also need to install\nthe following Python modules:\n\npyobjc\n\n\n\nmacOS SDK\nIf you're developing Electron and don't plan to redistribute your\ncustom Electron build, you may skip this section.\nFor certain features (e.g. pinch-zoom) to work properly, you must target the\nmacOS 10.10 SDK.\nOfficial Electron builds are built with Xcode 8.2.1, which does not contain\nthe 10.10 SDK by default. To obtain it, first download and mount the\nXcode 6.4\nDMG.\nThen, assuming that the Xcode 6.4 DMG has been mounted at /Volumes/Xcode and\nthat your Xcode 8.2.1 install is at /Applications/Xcode.app, run:\ncp -r /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/\nYou will also need to enable Xcode to build against the 10.10 SDK:\n\nOpen /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist\nSet the MinimumSDKVersion to 10.10\nSave the file\n\n\n\nGetting the Code\n$ git clone https://github.com/electron/electron\n\n\nBootstrapping\nThe bootstrap script will download all necessary build dependencies and create\nthe build project files. Notice that we're using ninja\nto build Electron so there is no Xcode project generated.\n$ cd electron\n$ ./script/bootstrap.py -v\nIf you are using editor supports JSON compilation database based\nlanguage server, you can generate it:\n$ ./script/build.py --compdb\n\n\nBuilding\nBuild both Release and Debug targets:\n$ ./script/build.py\nYou can also only build the Debug target:\n$ ./script/build.py -c D\nAfter building is done, you can find Electron.app under out/D.\n\n\n32bit Support\nElectron can only be built for a 64bit target on macOS and there is no plan to\nsupport 32bit macOS in the future.\n\n\nCleaning\nTo clean the build files:\n$ npm run clean\nTo clean only out and dist directories:\n$ npm run clean-build\nNote: Both clean commands require running bootstrap again before building.\n\n\nTests\nSee Build System Overview: Tests\n" + }, + { + "type": "tutorial", + "title": "Build Instructions (Windows)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/build-instructions-windows.md", + "url": "https://electronjs.org/docs/tutorial/build-instructions-windows", + "slug": "build-instructions-windows", + "body": "Build Instructions (Windows)\nFollow the guidelines below for building Electron on Windows.\n\n\nPrerequisites\n\nWindows 7 / Server 2008 R2 or higher\nVisual Studio 2017 - download VS 2017 Community Edition for\nfree\nPython 2.7\nNode.js\nGit\nDebugging Tools for Windows\nif you plan on creating a full distribution since symstore.exe is used for\ncreating a symbol store from .pdb files.\n\nIf you don't currently have a Windows installation,\ndev.microsoftedge.com\nhas timebombed versions of Windows that you can use to build Electron.\nBuilding Electron is done entirely with command-line scripts and cannot be done\nwith Visual Studio. You can develop Electron with any editor but support for\nbuilding with Visual Studio will come in the future.\nNote: Even though Visual Studio is not used for building, it's still\nrequired because we need the build toolchains it provides.\n\n\nGetting the Code\n$ git clone https://github.com/electron/electron.git\n\n\nBootstrapping\nThe bootstrap script will download all necessary build dependencies and create\nthe build project files. Notice that we're using ninja to build Electron so\nthere is no Visual Studio project generated.\n$ cd electron\n$ python script\\bootstrap.py -v\n\n\nBuilding\nBuild both Release and Debug targets:\n$ python script\\build.py\nYou can also only build the Debug target:\n$ python script\\build.py -c D\nAfter building is done, you can find electron.exe under out\\D (debug\ntarget) or under out\\R (release target).\n\n\n32bit Build\nTo build for the 32bit target, you need to pass --target_arch=ia32 when\nrunning the bootstrap script:\n$ python script\\bootstrap.py -v --target_arch=ia32\nThe other building steps are exactly the same.\n\n\nVisual Studio project\nTo generate a Visual Studio project, you can pass the --msvs parameter:\n$ python script\\bootstrap.py --msvs\n\n\nCleaning\nTo clean the build files:\n$ npm run clean\nTo clean only out and dist directories:\n$ npm run clean-build\nNote: Both clean commands require running bootstrap again before building.\n\n\nTests\nSee Build System Overview: Tests\n\n\nTroubleshooting\n\n\nCommand xxxx not found\nIf you encountered an error like Command xxxx not found, you may try to use\nthe VS2015 Command Prompt console to execute the build scripts.\n\n\nFatal internal compiler error: C1001\nMake sure you have the latest Visual Studio update installed.\n\n\nAssertion failed: ((handle))->activecnt >= 0\nIf building under Cygwin, you may see bootstrap.py failed with following\nerror:\nAssertion failed: ((handle))->activecnt >= 0, file src\\win\\pipe.c, line 1430\n\nTraceback (most recent call last):\n File \"script/bootstrap.py\", line 87, in \n sys.exit(main())\n File \"script/bootstrap.py\", line 22, in main\n update_node_modules('.')\n File \"script/bootstrap.py\", line 56, in update_node_modules\n execute([NPM, 'install'])\n File \"/home/zcbenz/codes/raven/script/lib/util.py\", line 118, in execute\n raise e\nsubprocess.CalledProcessError: Command '['npm.cmd', 'install']' returned non-zero exit status 3\nThis is caused by a bug when using Cygwin Python and Win32 Node together. The\nsolution is to use the Win32 Python to execute the bootstrap script (assuming\nyou have installed Python under C:\\Python27):\n$ /cygdrive/c/Python27/python.exe script/bootstrap.py\n\n\nLNK1181: cannot open input file 'kernel32.lib'\nTry reinstalling 32bit Node.js.\n\n\nError: ENOENT, stat 'C:\\Users\\USERNAME\\AppData\\Roaming\\npm'\nCreating that directory should fix the problem:\n$ mkdir ~\\AppData\\Roaming\\npm\n\n\nnode-gyp is not recognized as an internal or external command\nYou may get this error if you are using Git Bash for building, you should use\nPowerShell or VS2015 Command Prompt instead.\n" + }, + { + "type": "tutorial", + "title": "Build System Overview", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/build-system-overview.md", + "url": "https://electronjs.org/docs/tutorial/build-system-overview", + "slug": "build-system-overview", + "body": "Build System Overview\nElectron uses gyp for project generation and\nninja for building. Project configurations can\nbe found in the .gyp and .gypi files.\n\n\nGyp Files\nFollowing gyp files contain the main rules for building Electron:\n\nelectron.gyp defines how Electron itself is built.\ncommon.gypi adjusts the build configurations of Node to make it build\ntogether with Chromium.\nbrightray/brightray.gyp defines how brightray is built and\nincludes the default configurations for linking with Chromium.\nbrightray/brightray.gypi includes general build configurations about\nbuilding.\n\n\n\nComponent Build\nSince Chromium is quite a large project, the final linking stage can take\nquite a few minutes, which makes it hard for development. In order to solve\nthis, Chromium introduced the \"component build\", which builds each component as\na separate shared library, making linking very quick but sacrificing file size\nand performance.\nIn Electron we took a very similar approach: for Debug builds, the binary\nwill be linked to a shared library version of Chromium's components to achieve\nfast linking time; for Release builds, the binary will be linked to the static\nlibrary versions, so we can have the best possible binary size and performance.\n\n\nMinimal Bootstrapping\nAll of Chromium's prebuilt binaries (libchromiumcontent) are downloaded when\nrunning the bootstrap script. By default both static libraries and shared\nlibraries will be downloaded and the final size should be between 800MB and 2GB\ndepending on the platform.\nBy default, libchromiumcontent is downloaded from Amazon Web Services.\nIf the LIBCHROMIUMCONTENT_MIRROR environment variable is set, the bootstrap\nscript will download from it.\nlibchromiumcontent-qiniu-mirror\nis a mirror for libchromiumcontent. If you have trouble in accessing AWS, you\ncan switch the download address to it via\nexport LIBCHROMIUMCONTENT_MIRROR=http://7xk3d2.dl1.z0.glb.clouddn.com/\nIf you only want to build Electron quickly for testing or development, you\ncan download the shared library versions by passing the --dev parameter:\n$ ./script/bootstrap.py --dev\n$ ./script/build.py -c D\n\n\nTwo-Phase Project Generation\nElectron links with different sets of libraries in Release and Debug\nbuilds. gyp, however, doesn't support configuring different link settings for\ndifferent configurations.\nTo work around this Electron uses a gyp variable\nlibchromiumcontent_component to control which link settings to use and only\ngenerates one target when running gyp.\n\n\nTarget Names\nUnlike most projects that use Release and Debug as target names, Electron\nuses R and D instead. This is because gyp randomly crashes if there is\nonly one Release or Debug build configuration defined, and Electron only has\nto generate one target at a time as stated above.\nThis only affects developers, if you are building Electron for rebranding\nyou are not affected.\n\n\nTests\nTest your changes conform to the project coding style using:\n$ npm run lint\nTest functionality using:\n$ npm test\nWhenever you make changes to Electron source code, you'll need to re-run the\nbuild before the tests:\n$ npm run build && npm test\nYou can make the test suite run faster by isolating the specific test or block\nyou're currently working on using Mocha's\nexclusive tests feature. Append\n.only to any describe or it function call:\ndescribe.only('some feature', function () {\n // ... only tests in this block will be run\n})\nAlternatively, you can use mocha's grep option to only run tests matching the\ngiven regular expression pattern:\n$ npm test -- --grep child_process\nTests that include native modules (e.g. runas) can't be executed with the\ndebug build (see #2558 for\ndetails), but they will work with the release build.\nTo run the tests with the release build use:\n$ npm test -- -R\n" + }, + { + "type": "tutorial", + "title": "Chromium Development", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/chromium-development.md", + "url": "https://electronjs.org/docs/tutorial/chromium-development", + "slug": "chromium-development", + "body": "Chromium Development\n\nA collection of resources for learning about Chromium and tracking its development\n\n\nchromiumdev on Slack\n@ChromiumDev on Twitter\n@googlechrome on Twitter\nBlog\nCode Search\nSource Code\nDevelopment Calendar and Release Info\nDiscussion Groups\n\nSee also V8 Development\n\n\nChromium development with Electron\nIt is possible to debug Chromium with Electron by passing\n--build_debug_libcc to the bootstrap script:\n$ ./script/bootstrap.py -d --build_debug_libcc\nThis will download and build libchromiumcontent locally, similarly to the\n--build_release_libcc, but it will create a shared library build of\nlibchromiumcontent and won't strip any symbols, making it ideal for debugging.\nWhen built like this, you can make changes to files in\nvendor/libchromiumcontent/src and rebuild quickly with:\n$ ./script/build.py -c D --libcc\nWhen developing on linux with gdb, it is recommended to add a gdb index to speed\nup loading symbols. This doesn't need to be executed on every build, but it is\nrecommended to do it at least once to index most shared libraries:\n$ ./vendor/libchromiumcontent/src/build/gdb-add-index ./out/D/electron\nBuilding libchromiumcontent requires a powerful machine and takes a long time\n(though incremental rebuilding the shared library component is fast). With an\n8-core/16-thread Ryzen 1700 CPU clocked at 3ghz, fast SSD and 32GB of RAM, it\nshould take about 40 minutes. It is not recommended to build with less than 16GB\nof RAM.\n\n\nChromium git cache\ndepot_tools has an undocumented option that allows the developer to set a\nglobal cache for all git objects of Chromium + dependencies. This option uses\ngit clone --shared to save bandwidth/space on multiple clones of the same\nrepositories.\nOn electron/libchromiumcontent, this option is exposed through the\nLIBCHROMIUMCONTENT_GIT_CACHE environment variable. If you intend to have\nseveral libchromiumcontent build trees on the same machine(to work on different\nbranches for example), it is recommended to set the variable to speed up the\ndownload of Chromium source. For example:\n$ mkdir ~/.chromium-git-cache\n$ LIBCHROMIUMCONTENT_GIT_CACHE=~/.chromium-git-cache ./script/bootstrap.py -d --build_debug_libcc\nIf the bootstrap script is interrupted while using the git cache, it will leave\nthe cache locked. To remove the lock, delete the files ending in .lock:\n$ find ~/.chromium-git-cache/ -type f -name '*.lock' -delete\nIt is possible to share this directory with other machines by exporting it as\nSMB share on linux, but only one process/machine can be using the cache at a\ntime. The locks created by git-cache script will try to prevent this, but it may\nnot work perfectly in a network.\nOn Windows, SMBv2 has a directory cache that will cause problems with the git\ncache script, so it is necessary to disable it by setting the registry key\nHKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\Lanmanworkstation\\Parameters\\DirectoryCacheLifetime\nto 0. More information: https://stackoverflow.com/a/9935126\n" + }, + { + "type": "tutorial", + "title": "Using clang-format on C++ Code", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/clang-format.md", + "url": "https://electronjs.org/docs/tutorial/clang-format", + "slug": "clang-format", + "body": "Using clang-format on C++ Code\nclang-format is a tool to\nautomatically format C/C++/Objective-C code, so that developers don't need to\nworry about style issues during code reviews.\nIt is highly recommended to format your changed C++ code before opening pull\nrequests, which will save you and the reviewers' time.\nYou can install clang-format and git-clang-format via\nnpm install -g clang-format.\nTo automatically format a file according to Electron C++ code style, run\nclang-format -i path/to/electron/file.cc. It should work on macOS/Linux/Windows.\nThe workflow to format your changed code:\n\nMake codes changes in Electron repository.\nRun git add your_changed_file.cc.\nRun git-clang-format, and you will probably see modifications in\nyour_changed_file.cc, these modifications are generated from clang-format.\nRun git add your_changed_file.cc, and commit your change.\nNow the branch is ready to be opened as a pull request.\n\nIf you want to format the changed code on your latest git commit (HEAD), you can\nrun git-clang-format HEAD~1. See git-clang-format -h for more details.\n\n\nEditor Integration\nYou can also integrate clang-format directly into your favorite editors.\nFor further guidance on setting up editor integration, see these pages:\n\nAtom\nVim & Emacs\nVisual Studio Code\n\n" + }, + { + "type": "tutorial", + "title": "Code Signing", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/code-signing.md", + "url": "https://electronjs.org/docs/tutorial/code-signing", + "slug": "code-signing", + "body": "Code Signing\nCode signing is a security technology that you use to certify that an app was\ncreated by you.\nOn macOS the system can detect any change to the app, whether the change is\nintroduced accidentally or by malicious code.\nOn Windows the system assigns a trust level to your code signing certificate which\nif you don't have, or if your trust level is low will cause security dialogs to\nappear when users start using your application. Trust level builds over time\nso it's better to start code signing as early as possible.\nWhile it is possible to distribute unsigned apps, it is not recommended.\nFor example, here's what macOS users see when attempting to start an unsigned app:\n\n\nApp can't be opened because it is from an unidentified developer\n\nIf you are building an Electron app that you intend to package and distribute,\nit should be code signed. The Mac and Windows app stores do not allow unsigned\napps.\n\n\nSigning macOS builds\nBefore signing macOS builds, you must do the following:\n\nEnroll in the Apple Developer Program(Apple Developer Program) (requires an annual fee)\nDownload and install Xcode\nGenerate, download, and install signing certificates\n\nThere are a number of tools for signing your packaged app:\n\nelectron-osx-sign is a standalone tool for signing macOS packages.\n\nelectron-packager bundles electron-osx-sign. If you're using electron-packager,\npass the --osx-sign=true flag to sign your build.\n\nelectron-forge uses electron-packager internally, you can set the osxSign option\nin your forge config.\n\n\nelectron-builder has built-in code-signing capabilities. See electron.build/code-signing\n\nFor more info, see the Mac App Store Submission Guide.\n\n\nSigning Windows builds\nBefore signing Windows builds, you must do the following:\n\nGet a Windows Authenticode code signing certificate\nInstall Visual Studio 2015/2017 (to get the signing utility)\n\nYou can get a code signing certificate from a lot of resellers, popular ones include:\n\ndigicert\nComodo\nGoDaddy\nAmongst others, please shop around to find one that suits your needs, Google is your friend :)\n\nThere are a number of tools for signing your packaged app:\n\nelectron-winstaller will generate an installer for windows and sign it for you\nelectron-forge can sign installers it generates through the Squirrel.Windows or MSI targets.\nelectron-builder can sign some of its windows targets\n\n\n\nWindows Store\nSee the Windows Store Guide.\n" + }, + { + "type": "tutorial", + "title": "Coding Style", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/coding-style.md", + "url": "https://electronjs.org/docs/tutorial/coding-style", + "slug": "coding-style", + "body": "Coding Style\nThese are the style guidelines for coding in Electron.\nYou can run npm run lint to show any style issues detected by cpplint and\neslint.\n\n\nGeneral Code\n\nEnd files with a newline.\n\nPlace requires in the following order:\n\nBuilt in Node Modules (such as path)\nBuilt in Electron Modules (such as ipc, app)\nLocal Modules (using relative paths)\n\n\n\nPlace class properties in the following order:\n\nClass methods and properties (methods starting with a @)\nInstance methods and properties\n\n\n\nAvoid platform-dependent code:\n\nUse path.join() to concatenate filenames.\nUse os.tmpdir() rather than /tmp when you need to reference the\ntemporary directory.\n\n\n\nUsing a plain return when returning explicitly at the end of a function.\n\nNot return null, return undefined, null or undefined\n\n\n\n\n\nC++ and Python\nFor C++ and Python, we follow Chromium's Coding\nStyle. You can use\nclang-format to format the C++ code automatically. There is\nalso a script script/cpplint.py to check whether all files conform.\nThe Python version we are using now is Python 2.7.\nThe C++ code uses a lot of Chromium's abstractions and types, so it's\nrecommended to get acquainted with them. A good place to start is\nChromium's Important Abstractions and Data Structures\ndocument. The document mentions some special types, scoped types (that\nautomatically release their memory when going out of scope), logging mechanisms\netc.\n\n\nDocumentation\n\nWrite remark markdown style\n\nYou can run npm run lint-docs to ensure that your documentation changes are\nformatted correctly.\n\n\nJavaScript\n\nWrite standard JavaScript style.\nFile names should be concatenated with - instead of _, e.g.\nfile-name.js rather than file_name.js, because in\ngithub/atom module names are usually in\nthe module-name form. This rule only applies to .js files.\n\nUse newer ES6/ES2015 syntax where appropriate\n\nconst\nfor requires and other constants\nlet\nfor defining variables\nArrow functions\ninstead of function () { }\nTemplate literals\ninstead of string concatenation using +\n\n\n\n\n\nNaming Things\nElectron APIs uses the same capitalization scheme as Node.js:\n\nWhen the module itself is a class like BrowserWindow, use PascalCase.\nWhen the module is a set of APIs, like globalShortcut, use camelCase.\nWhen the API is a property of object, and it is complex enough to be in a\nseparate chapter like win.webContents, use mixedCase.\nFor other non-module APIs, use natural titles, like Tag or\nProcess Object.\n\nWhen creating a new API, it is preferred to use getters and setters instead of\njQuery's one-function style. For example, .getText() and .setText(text)\nare preferred to .text([text]). There is a\ndiscussion on this.\n" + }, + { + "type": "tutorial", + "title": "Debugging on Windows", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/debug-instructions-windows.md", + "url": "https://electronjs.org/docs/tutorial/debug-instructions-windows", + "slug": "debug-instructions-windows", + "body": "Debugging on Windows\nIf you experience crashes or issues in Electron that you believe are not caused\nby your JavaScript application, but instead by Electron itself, debugging can\nbe a little bit tricky, especially for developers not used to native/C++\ndebugging. However, using Visual Studio, GitHub's hosted Electron Symbol Server,\nand the Electron source code, you can enable step-through debugging\nwith breakpoints inside Electron's source code.\n\n\nRequirements\n\n\nA debug build of Electron: The easiest way is usually building it\nyourself, using the tools and prerequisites listed in the\nbuild instructions for Windows. While you can\nattach to and debug Electron as you can download it directly, you will\nfind that it is heavily optimized, making debugging substantially more\ndifficult: The debugger will not be able to show you the content of all\nvariables and the execution path can seem strange because of inlining,\ntail calls, and other compiler optimizations.\n\n\nVisual Studio with C++ Tools: The free community editions of Visual\nStudio 2013 and Visual Studio 2015 both work. Once installed,\nconfigure Visual Studio to use GitHub's Electron Symbol server.\nIt will enable Visual Studio to gain a better understanding of what happens\ninside Electron, making it easier to present variables in a human-readable\nformat.\n\n\nProcMon: The free SysInternals tool allows you to inspect\na processes parameters, file handles, and registry operations.\n\n\n\n\nAttaching to and Debugging Electron\nTo start a debugging session, open up PowerShell/CMD and execute your debug\nbuild of Electron, using the application to open as a parameter.\n$ ./out/D/electron.exe ~/my-electron-app/\n\n\nSetting Breakpoints\nThen, open up Visual Studio. Electron is not built with Visual Studio and hence\ndoes not contain a project file - you can however open up the source code files\n\"As File\", meaning that Visual Studio will open them up by themselves. You can\nstill set breakpoints - Visual Studio will automatically figure out that the\nsource code matches the code running in the attached process and break\naccordingly.\nRelevant code files can be found in ./atom/ as well as in Brightray, found in\n./brightray/browser and ./brightray/common.\n\n\nAttaching\nYou can attach the Visual Studio debugger to a running process on a local or\nremote computer. After the process is running, click Debug / Attach to Process\n(or press CTRL+ALT+P) to open the \"Attach to Process\" dialog box. You can use\nthis capability to debug apps that are running on a local or remote computer,\ndebug multiple processes simultaneously.\nIf Electron is running under a different user account, select the\nShow processes from all users check box. Notice that depending on how many\nBrowserWindows your app opened, you will see multiple processes. A typical\none-window app will result in Visual Studio presenting you with two\nElectron.exe entries - one for the main process and one for the renderer\nprocess. Since the list only gives you names, there's currently no reliable\nway of figuring out which is which.\n\n\nWhich Process Should I Attach to?\nCode executed within the main process (that is, code found in or eventually run\nby your main JavaScript file) as well as code called using the remote\n(require('electron').remote) will run inside the main process, while other\ncode will execute inside its respective renderer process.\nYou can be attached to multiple programs when you are debugging, but only one\nprogram is active in the debugger at any time. You can set the active program\nin the Debug Location toolbar or the Processes window.\n\n\nUsing ProcMon to Observe a Process\nWhile Visual Studio is fantastic for inspecting specific code paths, ProcMon's\nstrength is really in observing everything your application is doing with the\noperating system - it captures File, Registry, Network, Process, and Profiling\ndetails of processes. It attempts to log all events occurring and can be\nquite overwhelming, but if you seek to understand what and how your application\nis doing to the operating system, it can be a valuable resource.\nFor an introduction to ProcMon's basic and advanced debugging features, go check\nout this video tutorial provided by Microsoft.\n" + }, + { + "type": "tutorial", + "title": "Debugging on macOS", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/debugging-instructions-macos.md", + "url": "https://electronjs.org/docs/tutorial/debugging-instructions-macos", + "slug": "debugging-instructions-macos", + "body": "Debugging on macOS\nIf you experience crashes or issues in Electron that you believe are not caused\nby your JavaScript application, but instead by Electron itself, debugging can\nbe a little bit tricky, especially for developers not used to native/C++\ndebugging. However, using lldb, and the Electron source code, you can enable\nstep-through debugging with breakpoints inside Electron's source code.\nYou can also use XCode for debugging if\nyou prefer a graphical interface.\n\n\nRequirements\n\n\nA debug build of Electron: The easiest way is usually building it\nyourself, using the tools and prerequisites listed in the\nbuild instructions for macOS. While you can\nattach to and debug Electron as you can download it directly, you will\nfind that it is heavily optimized, making debugging substantially more\ndifficult: The debugger will not be able to show you the content of all\nvariables and the execution path can seem strange because of inlining,\ntail calls, and other compiler optimizations.\n\n\nXcode: In addition to Xcode, also install the Xcode command line tools.\nThey include LLDB, the default debugger in Xcode on Mac OS X. It supports\ndebugging C, Objective-C and C++ on the desktop and iOS devices and simulator.\n\n\n\n\nAttaching to and Debugging Electron\nTo start a debugging session, open up Terminal and start lldb, passing a debug\nbuild of Electron as a parameter.\n$ lldb ./out/D/Electron.app\n(lldb) target create \"./out/D/Electron.app\"\nCurrent executable set to './out/D/Electron.app' (x86_64).\n\n\nSetting Breakpoints\nLLDB is a powerful tool and supports multiple strategies for code inspection. For\nthis basic introduction, let's assume that you're calling a command from JavaScript\nthat isn't behaving correctly - so you'd like to break on that command's C++\ncounterpart inside the Electron source.\nRelevant code files can be found in ./atom/ as well as in Brightray, found in\n./brightray/browser and ./brightray/common.\nLet's assume that you want to debug app.setName(), which is defined in browser.cc\nas Browser::SetName(). Set the breakpoint using the breakpoint command, specifying\nfile and line to break on:\n(lldb) breakpoint set --file browser.cc --line 117\nBreakpoint 1: where = Electron Framework`atom::Browser::SetName(std::__1::basic_string, std::__1::allocator > const&) + 20 at browser.cc:118, address = 0x000000000015fdb4\nThen, start Electron:\n(lldb) run\nThe app will immediately be paused, since Electron sets the app's name on launch:\n(lldb) run\nProcess 25244 launched: '/Users/fr/Code/electron/out/D/Electron.app/Contents/MacOS/Electron' (x86_64)\nProcess 25244 stopped\n* thread #1: tid = 0x839a4c, 0x0000000100162db4 Electron Framework`atom::Browser::SetName(this=0x0000000108b14f20, name=\"Electron\") + 20 at browser.cc:118, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1\n frame #0: 0x0000000100162db4 Electron Framework`atom::Browser::SetName(this=0x0000000108b14f20, name=\"Electron\") + 20 at browser.cc:118\n 115 \t}\n 116\n 117 \tvoid Browser::SetName(const std::string& name) {\n-> 118 \t name_override_ = name;\n 119 \t}\n 120\n 121 \tint Browser::GetBadgeCount() {\n(lldb)\nTo show the arguments and local variables for the current frame, run frame variable (or fr v),\nwhich will show you that the app is currently setting the name to \"Electron\".\n(lldb) frame variable\n(atom::Browser *) this = 0x0000000108b14f20\n(const string &) name = \"Electron\": {\n [...]\n}\nTo do a source level single step in the currently selected thread, execute step (or s).\nThis would take you into name_override_.empty(). To proceed and do a step over,\nrun next (or n).\n(lldb) step\nProcess 25244 stopped\n* thread #1: tid = 0x839a4c, 0x0000000100162dcc Electron Framework`atom::Browser::SetName(this=0x0000000108b14f20, name=\"Electron\") + 44 at browser.cc:119, queue = 'com.apple.main-thread', stop reason = step in\n frame #0: 0x0000000100162dcc Electron Framework`atom::Browser::SetName(this=0x0000000108b14f20, name=\"Electron\") + 44 at browser.cc:119\n 116\n 117 \tvoid Browser::SetName(const std::string& name) {\n 118 \t name_override_ = name;\n-> 119 \t}\n 120\n 121 \tint Browser::GetBadgeCount() {\n 122 \t return badge_count_;\nTo finish debugging at this point, run process continue. You can also continue until a certain\nline is hit in this thread (thread until 100). This command will run the thread in the current\nframe till it reaches line 100 in this frame or stops if it leaves the current frame.\nNow, if you open up Electron's developer tools and call setName, you will once again hit the\nbreakpoint.\n\n\nFurther Reading\nLLDB is a powerful tool with a great documentation. To learn more about it, consider\nApple's debugging documentation, for instance the LLDB Command Structure Reference\nor the introduction to Using LLDB as a Standalone Debugger.\nYou can also check out LLDB's fantastic manual and tutorial, which\nwill explain more complex debugging scenarios.\n" + }, + { + "type": "tutorial", + "title": "Debugging with XCode", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/debugging-instructions-macos-xcode.md", + "url": "https://electronjs.org/docs/tutorial/debugging-instructions-macos-xcode", + "slug": "debugging-instructions-macos-xcode", + "body": "Debugging with XCode\n\n\nBuild Debug Electron with Release libchromiumcontent\nYou can create a debug build of electron by following build instructions for macOS.\nThe bootstrap process will download Release version of libchromiumcontent by default,\nso you will not be able to step through the chromium source.\n\n\nBuild Debug Electron with Debug libchromiumcontent\nIf you want to debug and step through libchromiumcontent, you will have to run the\nbootsrap script with the --build_debug_libcc argument.\n$ cd electron\n$ ./script/bootstrap.py -v --build_debug_libcc\nThis can take a significant amount of time depending on build machine as it has to\nbuild all of the libchromium source.\nOnce, the lib is built, create a symlink to the built directory under download\nln -s vendor/libchromiumcontent/dist/main/shared_library vendor/download/libchromiumcontent/shared_library\nElectron debug builds will use this shared library to link against.\n$ ./script/build.py -c D --libcc\nThis will build debug electron with debug version of libchromiumcontent.\n\n\nGenerate xcode project for debugging sources (cannot build code from xcode)\nRun the update script with the --xcode argument.\n$ ./script/update.py --xcode\nThis will generate the electron.ninjs.xcworkspace. You will have to open this workspace\nto set breakpoints and inspect.\n\n\nDebugging and breakpoints\nLaunch electron app after build.\nYou can now open the xcode workspace created above and attach to the electron process\nthrough the Debug > Attach To Process > Electron debug menu. [Note: If you want to debug\nthe renderer process, you need to attach to the Electron Helper as well.]\nYou can now set breakpoints in any of the indexed files. However, you will not be able\nto set breakpoints directly in the chromium source.\nTo set break points in the chromium source, you can choose Debug > Breakpoints > Create\nSymbolic Breakpoint and set any function name as the symbol. This will set the breakpoint\nfor all functions with that name, from all the classes if there are more than one.\nYou can also do this step of setting break points prior to attaching the debugger,\nhowever, actual breakpoints for symbolic breakpoint functions may not show up until the\ndebugger is attached to the app.\n" + }, + { + "type": "tutorial", + "title": "Debugging the Main Process", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/debugging-main-process.md", + "url": "https://electronjs.org/docs/tutorial/debugging-main-process", + "slug": "debugging-main-process", + "body": "Debugging the Main Process\nThe DevTools in an Electron browser window can only debug JavaScript that's\nexecuted in that window (i.e. the web pages). To debug JavaScript that's\nexecuted in the main process you will need to use an external debugger and\nlaunch Electron with the --inspect or --inspect-brk switch.\n\n\nCommand Line Switches\nUse one of the following command line switches to enable debugging of the main\nprocess:\n\n\n--inspect=[port]\nElectron will listen for V8 inspector protocol messages on the specified port,\nan external debugger will need to connect on this port. The default port is\n5858.\nelectron --inspect=5858 your/app\n\n\n--inspect-brk=[port]\nLike --inspect but pauses execution on the first line of JavaScript.\n\n\nExternal Debuggers\nYou will need to use a debugger that supports the V8 inspector protocol.\n\nConnect Chrome by visiting chrome://inspect and selecting to inspect the\nlaunched Electron app present there.\nDebugging the Main Process in VSCode\n\n" + }, + { + "type": "tutorial", + "title": "Debugging the Main Process in VSCode", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/debugging-main-process-vscode.md", + "url": "https://electronjs.org/docs/tutorial/debugging-main-process-vscode", + "slug": "debugging-main-process-vscode", + "body": "Debugging the Main Process in VSCode\n\n\n1. Open an Electron project in VSCode.\n$ git clone git@github.com:electron/electron-quick-start.git\n$ code electron-quick-start\n\n\n2. Add a file .vscode/launch.json with the following configuration:\n{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"name\": \"Debug Main Process\",\n \"type\": \"node\",\n \"request\": \"launch\",\n \"cwd\": \"${workspaceRoot}\",\n \"runtimeExecutable\": \"${workspaceRoot}/node_modules/.bin/electron\",\n \"windows\": {\n \"runtimeExecutable\": \"${workspaceRoot}/node_modules/.bin/electron.cmd\"\n },\n \"args\" : [\".\"]\n }\n ]\n}\n\n\n3. Debugging\nSet some breakpoints in main.js, and start debugging in the Debug View. You should be able to hit the breakpoints.\nHere is a pre-configured project that you can download and directly debug in VSCode: https://github.com/octref/vscode-electron-debug/tree/master/electron-quick-start\n" + }, + { + "type": "tutorial", + "title": "Desktop Environment Integration", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/desktop-environment-integration.md", + "url": "https://electronjs.org/docs/tutorial/desktop-environment-integration", + "slug": "desktop-environment-integration", + "body": "Desktop Environment Integration\nDifferent operating systems provide different features for integrating desktop\napplications into their desktop environments. For example, on Windows,\napplications can put shortcuts in the JumpList of task bar, and on Mac,\napplications can put a custom menu in the dock menu.\nThis guide explains how to integrate your application into those desktop\nenvironments with Electron APIs.\n\n\nNotifications\nSee the Notifications documentation.\n\n\nRecent Documents\nSee Recent Documents documentation.\n\n\nProgress Bar\nSee the Progress Bar documentation.\n\n\nUnity Launcher\nSee the Unity Launcher documentation.\n\n\nRepresented File for macOS Window\nSee the Represented File documentation.\n\n\nDragging files out of the window\nSee the Native File Drag & Drop documentation.\n" + }, + { + "type": "tutorial", + "title": "Developer Environment", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/development-environment.md", + "url": "https://electronjs.org/docs/tutorial/development-environment", + "slug": "development-environment", + "body": "Developer Environment\nElectron development is essentially Node.js development. To turn your operating\nsystem into an environment capable of building desktop apps with Electron,\nyou will merely need Node.js, npm, a code editor of your choice, and a\nrudimentary understanding of your operating system's command line client.\n\n\nSetting up macOS\n\nElectron supports Mac OS X 10.9 (and all versions named macOS) and up. Apple\ndoes not allow running macOS in virtual machines unless the host computer is\nalready an Apple computer, so if you find yourself in need of a Mac, consider\nusing a cloud service that rents access to Macs (like MacInCloud\nor xcloud).\n\nFirst, install a recent version of Node.js. We recommend that you install\neither the latest LTS or Current version available. Visit\nthe Node.js download page and select the macOS Installer.\nWhile Homebrew is an offered option, but we recommend against it - many tools\nwill be incompatible with the way Homebrew installs Node.js.\nOnce downloaded, execute the installer and let the installation wizard guide\nyou through the installation.\nOnce installed, confirm that everything works as expected. Find the macOS\nTerminal application in your /Applications/Utilities folder (or by\nsearching for the word Terminal in Spotlight). Open up Terminal\nor another command line client of your choice and confirm that both node\nand npm are available:\n# This command should print the version of Node.js\nnode -v\n\n# This command should print the version of npm\nnpm -v\nIf both commands printed a version number, you are all set! Before you get\nstarted, you might want to install a code editor suited\nfor JavaScript development.\n\n\nSetting up Windows\n\nElectron supports Windows 7 and later versions – attempting to develop Electron\napplications on earlier versions of Windows will not work. Microsoft provides\nfree virtual machine images with Windows 10 for developers.\n\nFirst, install a recent version of Node.js. We recommend that you install\neither the latest LTS or Current version available. Visit\nthe Node.js download page and select the Windows Installer.\nOnce downloaded, execute the installer and let the installation wizard guide\nyou through the installation.\nOn the screen that allows you to configure the installation, make sure to\nselect the Node.js runtime, npm package manager, and Add to PATH\noptions.\nOnce installed, confirm that everything works as expected. Find the Windows\nPowerShell by opening the Start Menu and typing PowerShell. Open\nup PowerShell or another command line client of your choice and confirm that\nboth node and npm are available:\n# This command should print the version of Node.js\nnode -v\n\n# This command should print the version of npm\nnpm -v\nIf both commands printed a version number, you are all set! Before you get\nstarted, you might want to install a code editor suited\nfor JavaScript development.\n\n\nSetting up Linux\n\nGenerally speaking, Electron supports Ubuntu 12.04, Fedora 21, Debian 8\nand later.\n\nFirst, install a recent version of Node.js. Depending on your Linux\ndistribution, the installation steps might differ. Assuming that you normally\ninstall software using a package manager like apt or pacman, use the\nofficial Node.js guidance on installing on Linux.\nYou're running Linux, so you likely already know how to operate a command line\nclient. Open up your favorite client and confirm that both node and npm\nare available globally:\n# This command should print the version of Node.js\nnode -v\n\n# This command should print the version of npm\nnpm -v\nIf both commands printed a version number, you are all set! Before you get\nstarted, you might want to install a code editor suited\nfor JavaScript development.\n\n\nA Good Editor\nWe might suggest two free popular editors built in Electron:\nGitHub's Atom and Microsoft's Visual Studio Code. Both of\nthem have excellent JavaScript support.\nIf you are one of the many developers with a strong preference, know that\nvirtually all code editors and IDEs these days support JavaScript.\n" + }, + { + "type": "tutorial", + "title": "DevTools Extension", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/devtools-extension.md", + "url": "https://electronjs.org/docs/tutorial/devtools-extension", + "slug": "devtools-extension", + "body": "DevTools Extension\nElectron supports the Chrome DevTools Extension, which can\nbe used to extend the ability of devtools for debugging popular web frameworks.\n\n\nHow to load a DevTools Extension\nThis document outlines the process for manually loading an extension.\nYou may also try\nelectron-devtools-installer,\na third-party tool that downloads extensions directly from the Chrome WebStore.\nTo load an extension in Electron, you need to download it in Chrome browser,\nlocate its filesystem path, and then load it by calling the\nBrowserWindow.addDevToolsExtension(extension) API.\nUsing the React Developer Tools as example:\n\nInstall it in Chrome browser.\nNavigate to chrome://extensions, and find its extension ID, which is a hash\nstring like fmkadmapgofadopljbjfkapdkoienihi.\n\nFind out filesystem location used by Chrome for storing extensions:\n\non Windows it is %LOCALAPPDATA%\\Google\\Chrome\\User Data\\Default\\Extensions;\n\non Linux it could be:\n\n~/.config/google-chrome/Default/Extensions/\n~/.config/google-chrome-beta/Default/Extensions/\n~/.config/google-chrome-canary/Default/Extensions/\n~/.config/chromium/Default/Extensions/\n\n\non macOS it is ~/Library/Application Support/Google/Chrome/Default/Extensions.\n\n\nPass the location of the extension to BrowserWindow.addDevToolsExtension\nAPI, for the React Developer Tools, it is something like:\n~/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/0.15.0_0\n\nNote: The BrowserWindow.addDevToolsExtension API cannot be called before the\nready event of the app module is emitted.\nThe name of the extension is returned by BrowserWindow.addDevToolsExtension,\nand you can pass the name of the extension to the BrowserWindow.removeDevToolsExtension\nAPI to unload it.\n\n\nSupported DevTools Extensions\nElectron only supports a limited set of chrome.* APIs, so some extensions\nusing unsupported chrome.* APIs for chrome extension features may not work.\nFollowing Devtools Extensions are tested and guaranteed to work in Electron:\n\nEmber Inspector\nReact Developer Tools\nBackbone Debugger\njQuery Debugger\nAngularJS Batarang\nVue.js devtools\nCerebral Debugger\nRedux DevTools Extension\nMobX Developer Tools\n\n\n\nWhat should I do if a DevTools Extension is not working?\nFirst please make sure the extension is still being maintained, some extensions\ncan not even work for recent versions of Chrome browser, and we are not able to\ndo anything for them.\nThen file a bug at Electron's issues list, and describe which part of the\nextension is not working as expected.\n" + }, + { + "type": "tutorial", + "title": "Electron Versioning", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/electron-versioning.md", + "url": "https://electronjs.org/docs/tutorial/electron-versioning", + "slug": "electron-versioning", + "body": "Electron Versioning\n\nA detailed look at our versioning policy and implementation.\n\nAs of version 2.0.0, Electron follows semver. The following command will install the most recent stable build of Electron:\nnpm install --save-dev electron\nTo update an existing project to use the latest stable version:\nnpm install --save-dev electron@latest\n\n\nVersion 1.x\nElectron versions < 2.0 did not conform to the semver spec: major versions corresponded to end-user API changes, minor versions corresponded to Chromium major releases, and patch versions corresponded to new features and bug fixes. While convenient for developers merging features, it creates problems for developers of client-facing applications. The QA testing cycles of major apps like Slack, Stride, Teams, Skype, VS Code, Atom, and Desktop can be lengthy and stability is a highly desired outcome. There is a high risk in adopting new features while trying to absorb bug fixes.\nHere is an example of the 1.x strategy:\n\nAn app developed with 1.8.1 cannot take the 1.8.3 bug fix without either absorbing the 1.8.2 feature, or by backporting the fix and maintaining a new release line.\n\n\nVersion 2.0 and Beyond\nThere are several major changes from our 1.x strategy outlined below. Each change is intended to satisfy the needs and priorities of developers/maintainers and app developers.\n\nStrict use of semver\nIntroduction of semver-compliant -beta tags\nIntroduction of conventional commit messages\nWell-defined stabilization branches\nThe master branch is versionless; only stabilization branches contain version information\n\nWe will cover in detail how git branching works, how npm tagging works, what developers should expect to see, and how one can backport changes.\n\n\nsemver\nFrom 2.0 onward, Electron will follow semver.\nBelow is a table explicitly mapping types of changes to their corresponding category of semver (e.g. Major, Minor, Patch).\n\n\n\nMajor Version Increments\nMinor Version Increments\nPatch Version Increments\n\n\n\n\nElectron breaking API changes\nElectron non-breaking API changes\nElectron bug fixes\n\n\nNode.js major version updates\nNode.js minor version updates\nNode.js patch version updates\n\n\nChromium version updates\n\nfix-related chromium patches\n\n\n\nNote that most chromium updates will be considered breaking. Fixes that can be backported will likely be cherry-picked as patches.\n\n\nStabilization Branches\nStabilization branches are branches that run parallel to master, taking in only cherry-picked commits that are related to security or stability. These branches are never merged back to master.\n\nStabilization branches are always either major or minor version lines, and named against the following template $MAJOR-$MINOR-x e.g. 2-0-x.\nWe allow for multiple stabilization branches to exist simultaneously, and intend to support at least two in parallel at all times, backporting security fixes as necessary.\n\nOlder lines will not be supported by GitHub, but other groups can take ownership and backport stability and security fixes on their own. We discourage this, but recognize that it makes life easier for many app developers.\n\n\nBeta Releases and Bug Fixes\nDevelopers want to know which releases are safe to use. Even seemingly innocent features can introduce regressions in complex applications. At the same time, locking to a fixed version is dangerous because you’re ignoring security patches and bug fixes that may have come out since your version. Our goal is to allow the following standard semver ranges in package.json :\n\nUse ~2.0.0 to admit only stability or security related fixes to your 2.0.0 release.\nUse ^2.0.0 to admit non-breaking reasonably stable feature work as well as security and bug fixes.\n\nWhat’s important about the second point is that apps using ^ should still be able to expect a reasonable level of stability. To accomplish this, semver allows for a pre-release identifier to indicate a particular version is not yet safe or stable.\nWhatever you choose, you will periodically have to bump the version in your package.json as breaking changes are a fact of Chromium life.\nThe process is as follows:\n\nAll new major and minor releases lines begin with a -beta.N tag for N >= 1. At that point, the feature set is locked. That release line admits no further features, and focuses only on security and stability.\ne.g. 2.0.0-beta.1.\nBug fixes, regression fixes, and security patches can be admitted. Upon doing so, a new beta is released incrementing N.\ne.g. 2.0.0-beta.2\nIf a particular beta release is generally regarded as stable, it will be re-released as a stable build, changing only the version information.\ne.g. 2.0.0.\nIf future bug fixes or security patches need to be made once a release is stable, they are applied and the patch version is incremented accordingly\ne.g. 2.0.1.\n\nFor each major and minor bump, you should expect to see something like the following:\n2.0.0-beta.1\n2.0.0-beta.2\n2.0.0-beta.3\n2.0.0\n2.0.1\n2.0.2\nAn example lifecycle in pictures:\n\nA new release branch is created that includes the latest set of features. It is published as 2.0.0-beta.1.\n\nA bug fix comes into master that can be backported to the release branch. The patch is applied, and a new beta is published as 2.0.0-beta.2.\n\nThe beta is considered generally stable and it is published again as a non-beta under 2.0.0.\n\nLater, a zero-day exploit is revealed and a fix is applied to master. We backport the fix to the 2-0-x line and release 2.0.1.\n\n\nA few examples of how various semver ranges will pick up new releases:\n\n\n\nMissing Features: Alphas, and Nightly\nOur strategy has a few tradeoffs, which for now we feel are appropriate. Most importantly that new features in master may take a while before reaching a stable release line. If you want to try a new feature immediately, you will have to build Electron yourself.\nAs a future consideration, we may introduce one or both of the following:\n\nnightly builds off of master; these would allow folks to test new features quickly and give feedback\nalpha releases that have looser stability constraints to betas; for example it would be allowable to admit new features while a stability channel is in alpha\n\n\n\nFeature Flags\nFeature flags are a common practice in Chromium, and are well-established in the web-development ecosystem. In the context of Electron, a feature flag or soft branch must have the following properties:\n\nit is enabled/disabled either at runtime, or build-time; we do not support the concept of a request-scoped feature flag\nit completely segments new and old code paths; refactoring old code to support a new feature violates the feature-flag contract\nfeature flags are eventually removed after the soft-branch is merged\n\nWe reconcile flagged code with our versioning strategy as follows:\n\nwe do not consider iterating on feature-flagged code in a stability branch; even judicious use of feature flags is not without risk\nyou may break API contracts in feature-flagged code without bumping the major version. Flagged code does not adhere to semver\n\n\n\nSemantic Commits\nWe seek to increase clarity at all levels of the update and releases process. Starting with 2.0.0 we will require pull requests adhere to the Conventional Commits spec, which can be summarized as follows:\n\n\nCommits that would result in a semver major bump must start with BREAKING CHANGE:.\n\n\nCommits that would result in a semver minor bump must start with feat:.\n\n\nCommits that would result in a semver patch bump must start with fix:.\n\n\nWe allow squashing of commits, provided that the squashed message adheres the the above message format.\n\n\nIt is acceptable for some commits in a pull request to not include a semantic prefix, as long as a later commit in the same pull request contains a meaningful encompassing semantic message.\n\n\n\n\nVersionless master\n\nThe master branch will always contain 0.0.0-dev in its package.json\nRelease branches are never merged back to master\nRelease branches do contain the correct version in their package.json\n\n" + }, + { + "type": "tutorial", + "title": "Electron FAQ", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/faq.md", + "url": "https://electronjs.org/docs/tutorial/faq", + "slug": "faq", + "body": "Electron FAQ\n\n\nWhy am I having trouble installing Electron?\nWhen running npm install electron, some users occasionally encounter\ninstallation errors.\nIn almost all cases, these errors are the result of network problems and not\nactual issues with the electron npm package. Errors like ELIFECYCLE,\nEAI_AGAIN, ECONNRESET, and ETIMEDOUT are all indications of such\nnetwork problems. The best resolution is to try switching networks, or\nwait a bit and try installing again.\nYou can also attempt to download Electron directly from\nelectron/electron/releases\nif installing via npm is failing.\n\n\nWhen will Electron upgrade to latest Chrome?\nThe Chrome version of Electron is usually bumped within one or two weeks after\na new stable Chrome version gets released. This estimate is not guaranteed and\ndepends on the amount of work involved with upgrading.\nOnly the stable channel of Chrome is used. If an important fix is in beta or dev\nchannel, we will back-port it.\nFor more information, please see the security introduction.\n\n\nWhen will Electron upgrade to latest Node.js?\nWhen a new version of Node.js gets released, we usually wait for about a month\nbefore upgrading the one in Electron. So we can avoid getting affected by bugs\nintroduced in new Node.js versions, which happens very often.\nNew features of Node.js are usually brought by V8 upgrades, since Electron is\nusing the V8 shipped by Chrome browser, the shiny new JavaScript feature of a\nnew Node.js version is usually already in Electron.\n\n\nHow to share data between web pages?\nTo share data between web pages (the renderer processes) the simplest way is to\nuse HTML5 APIs which are already available in browsers. Good candidates are\nStorage API, localStorage,\nsessionStorage, and IndexedDB.\nOr you can use the IPC system, which is specific to Electron, to store objects\nin the main process as a global variable, and then to access them from the\nrenderers through the remote property of electron module:\n// In the main process.\nglobal.sharedObject = {\n someProperty: 'default value'\n}\n// In page 1.\nrequire('electron').remote.getGlobal('sharedObject').someProperty = 'new value'\n// In page 2.\nconsole.log(require('electron').remote.getGlobal('sharedObject').someProperty)\n\n\nMy app's window/tray disappeared after a few minutes.\nThis happens when the variable which is used to store the window/tray gets\ngarbage collected.\nIf you encounter this problem, the following articles may prove helpful:\n\nMemory Management\nVariable Scope\n\nIf you want a quick fix, you can make the variables global by changing your\ncode from this:\nconst {app, Tray} = require('electron')\napp.on('ready', () => {\n const tray = new Tray('/path/to/icon.png')\n tray.setTitle('hello world')\n})\nto this:\nconst {app, Tray} = require('electron')\nlet tray = null\napp.on('ready', () => {\n tray = new Tray('/path/to/icon.png')\n tray.setTitle('hello world')\n})\n\n\nI can not use jQuery/RequireJS/Meteor/AngularJS in Electron.\nDue to the Node.js integration of Electron, there are some extra symbols\ninserted into the DOM like module, exports, require. This causes problems\nfor some libraries since they want to insert the symbols with the same names.\nTo solve this, you can turn off node integration in Electron:\n// In the main process.\nconst {BrowserWindow} = require('electron')\nlet win = new BrowserWindow({\n webPreferences: {\n nodeIntegration: false\n }\n})\nwin.show()\nBut if you want to keep the abilities of using Node.js and Electron APIs, you\nhave to rename the symbols in the page before including other libraries:\n\n\n\n\n\n\nrequire('electron').xxx is undefined.\nWhen using Electron's built-in module you might encounter an error like this:\n> require('electron').webFrame.setZoomFactor(1.0)\nUncaught TypeError: Cannot read property 'setZoomLevel' of undefined\nThis is because you have the npm electron module installed\neither locally or globally, which overrides Electron's built-in module.\nTo verify whether you are using the correct built-in module, you can print the\npath of the electron module:\nconsole.log(require.resolve('electron'))\nand then check if it is in the following form:\n\"/path/to/Electron.app/Contents/Resources/atom.asar/renderer/api/lib/exports/electron.js\"\nIf it is something like node_modules/electron/index.js, then you have to\neither remove the npm electron module, or rename it.\nnpm uninstall electron\nnpm uninstall -g electron\nHowever if you are using the built-in module but still getting this error, it\nis very likely you are using the module in the wrong process. For example\nelectron.app can only be used in the main process, while electron.webFrame\nis only available in renderer processes.\n" + }, + { + "type": "tutorial", + "title": "Writing Your First Electron App", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/first-app.md", + "url": "https://electronjs.org/docs/tutorial/first-app", + "slug": "first-app", + "body": "Writing Your First Electron App\nElectron enables you to create desktop applications with pure JavaScript by\nproviding a runtime with rich native (operating system) APIs. You could see it\nas a variant of the Node.js runtime that is focused on desktop applications\ninstead of web servers.\nThis doesn't mean Electron is a JavaScript binding to graphical user interface\n(GUI) libraries. Instead, Electron uses web pages as its GUI, so you could also\nsee it as a minimal Chromium browser, controlled by JavaScript.\nNote: This example is also available as a repository you can\ndownload and run immediately.\nAs far as development is concerned, an Electron application is essentially a\nNode.js application. The starting point is a package.json that is identical\nto that of a Node.js module. A most basic Electron app would have the following\nfolder structure:\nyour-app/\n├── package.json\n├── main.js\n└── index.html\nCreate a new empty folder for your new Electron application. Open up your\ncommand line client and run npm init from that very folder.\nnpm init\nnpm will guide you through creating a basic package.json file. The script\nspecified by the main field is the startup script of your app, which will\nrun the main process. An example of your package.json might look like this:\n{\n \"name\": \"your-app\",\n \"version\": \"0.1.0\",\n \"main\": \"main.js\"\n}\nNote: If the main field is not present in package.json, Electron will\nattempt to load an index.js (as Node.js does). If this was actually\na simple Node application, you would add a start script that instructs node\nto execute the current package:\n{\n \"name\": \"your-app\",\n \"version\": \"0.1.0\",\n \"main\": \"main.js\",\n \"scripts\": {\n \"start\": \"node .\"\n }\n}\nTurning this Node application into an Electron application is quite simple - we\nmerely replace the node runtime with the electron runtime.\n{\n \"name\": \"your-app\",\n \"version\": \"0.1.0\",\n \"main\": \"main.js\",\n \"scripts\": {\n \"start\": \"electron .\"\n }\n}\n\n\nInstalling Electron\nAt this point, you'll need to install electron itself. The recommended way\nof doing so is to install it as a development dependency in your app, which\nallows you to work on multiple apps with different Electron versions. To do so,\nrun the following command from your app's directory:\nnpm install --save-dev electron\nOther means for installing Electron exist. Please consult the\ninstallation guide to learn about use with proxies, mirrors,\nand custom caches.\n\n\nElectron Development in a Nutshell\nElectron apps are developed in JavaScript using the same principles and methods\nfound in Node.js development. All APIs and features found in Electron are\naccessible through the electron module, which can be required like any other\nNode.js module:\nconst electron = require('electron')\nThe electron module exposes features in namespaces. As examples, the lifecycle\nof the application is managed through electron.app, windows can be created\nusing the electron.BrowserWindow class. A simple main.js file might wait\nfor the application to be ready and open a window:\nconst {app, BrowserWindow} = require('electron')\nconst path = require('path')\nconst url = require('url')\n\nfunction createWindow () {\n // Create the browser window.\n win = new BrowserWindow({width: 800, height: 600})\n\n // and load the index.html of the app.\n win.loadURL(url.format({\n pathname: path.join(__dirname, 'index.html'),\n protocol: 'file:',\n slashes: true\n }))\n}\n\napp.on('ready', createWindow)\nThe main.js should create windows and handle all the system events your\napplication might encounter. A more complete version of the above example\nmight open developer tools, handle the window being closed, or re-create\nwindows on macOS if the user clicks on the app's icon in the dock.\nconst {app, BrowserWindow} = require('electron')\nconst path = require('path')\nconst url = require('url')\n\n// Keep a global reference of the window object, if you don't, the window will\n// be closed automatically when the JavaScript object is garbage collected.\nlet win\n\nfunction createWindow () {\n // Create the browser window.\n win = new BrowserWindow({width: 800, height: 600})\n\n // and load the index.html of the app.\n win.loadURL(url.format({\n pathname: path.join(__dirname, 'index.html'),\n protocol: 'file:',\n slashes: true\n }))\n\n // Open the DevTools.\n win.webContents.openDevTools()\n\n // Emitted when the window is closed.\n win.on('closed', () => {\n // Dereference the window object, usually you would store windows\n // in an array if your app supports multi windows, this is the time\n // when you should delete the corresponding element.\n win = null\n })\n}\n\n// This method will be called when Electron has finished\n// initialization and is ready to create browser windows.\n// Some APIs can only be used after this event occurs.\napp.on('ready', createWindow)\n\n// Quit when all windows are closed.\napp.on('window-all-closed', () => {\n // On macOS it is common for applications and their menu bar\n // to stay active until the user quits explicitly with Cmd + Q\n if (process.platform !== 'darwin') {\n app.quit()\n }\n})\n\napp.on('activate', () => {\n // On macOS it's common to re-create a window in the app when the\n // dock icon is clicked and there are no other windows open.\n if (win === null) {\n createWindow()\n }\n})\n\n// In this file you can include the rest of your app's specific main process\n// code. You can also put them in separate files and require them here.\nFinally the index.html is the web page you want to show:\n\n\n \n \n Hello World!\n \n \n

Hello World!

\n We are using node ,\n Chrome ,\n and Electron .\n \n\n\n\nRunning Your App\nOnce you've created your initial main.js, index.html, and package.json\nfiles, you can try your app by running npm start from your application's\ndirectory.\n\n\nTrying this Example\nClone and run the code in this tutorial by using the\nelectron/electron-quick-start repository.\nNote: Running this requires Git.\n# Clone the repository\n$ git clone https://github.com/electron/electron-quick-start\n# Go into the repository\n$ cd electron-quick-start\n# Install dependencies\n$ npm install\n# Run the app\n$ npm start\nFor a list of boilerplates and tools to kick-start your development process,\nsee the Boilerplates and CLIs documentation.\n" + }, + { + "type": "tutorial", + "title": "Glossary", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/glossary.md", + "url": "https://electronjs.org/docs/tutorial/glossary", + "slug": "glossary", + "body": "Glossary\nThis page defines some terminology that is commonly used in Electron development.\n\n\nASAR\nASAR stands for Atom Shell Archive Format. An asar archive is a simple\ntar-like format that concatenates files into a single file. Electron can read\narbitrary files from it without unpacking the whole file.\nThe ASAR format was created primarily to improve performance on Windows... TODO\n\n\nBrightray\nBrightray was a static library\nthat made libchromiumcontent easier to use in applications. It is now\ndeprecated and has been merged into Electron's codebase.\n\n\nCRT\nThe C Run-time Library (CRT) is the part of the C++ Standard Library that\nincorporates the ISO C99 standard library. The Visual C++ libraries that\nimplement the CRT support native code development, and both mixed native and\nmanaged code, and pure managed code for .NET development.\n\n\nDMG\nAn Apple Disk Image is a packaging format used by macOS. DMG files are\ncommonly used for distributing application \"installers\". electron-builder\nsupports dmg as a build target.\n\n\nIME\nInput Method Editor. A program that allows users to enter characters and\nsymbols not found on their keyboard. For example, this allows users of Latin\nkeyboards to input Chinese, Japanese, Korean and Indic characters.\n\n\nIDL\nInterface description language. Write function signatures and data types in a format that can be used to generate interfaces in Java, C++, JavaScript, etc.\n\n\nIPC\nIPC stands for Inter-Process Communication. Electron uses IPC to send\nserialized JSON messages between the main and renderer processes.\n\n\nlibchromiumcontent\nA shared library that includes the Chromium Content module and all its\ndependencies (e.g., Blink, V8, etc.). Also referred to as \"libcc\".\n\ngithub.com/electron/libchromiumcontent\n\n\n\nmain process\nThe main process, commonly a file named main.js, is the entry point to every\nElectron app. It controls the life of the app, from open to close. It also\nmanages native elements such as the Menu, Menu Bar, Dock, Tray, etc. The\nmain process is responsible for creating each new renderer process in the app.\nThe full Node API is built in.\nEvery app's main process file is specified in the main property in\npackage.json. This is how electron . knows what file to execute at startup.\nIn Chromium, this process is referred to as the \"browser process\". It is\nrenamed in Electron to avoid confusion with renderer processes.\nSee also: process, renderer process\n\n\nMAS\nAcronym for Apple's Mac App Store. For details on submitting your app to the\nMAS, see the Mac App Store Submission Guide.\n\n\nMojo\nAn IPC system for communicating intra- or inter-process, and that's important because Chrome is keen on being able to split its work into separate processes or not, depending on memory pressures etc. \nSee https://chromium.googlesource.com/chromium/src/+/master/mojo/README.md\n\n\nnative modules\nNative modules (also called addons in\nNode.js) are modules written in C or C++ that can be loaded into Node.js or\nElectron using the require() function, and used as if they were an\nordinary Node.js module. They are used primarily to provide an interface\nbetween JavaScript running in Node.js and C/C++ libraries.\nNative Node modules are supported by Electron, but since Electron is very\nlikely to use a different V8 version from the Node binary installed in your\nsystem, you have to manually specify the location of Electron’s headers when\nbuilding native modules.\nSee also Using Native Node Modules.\n\n\nNSIS\nNullsoft Scriptable Install System is a script-driven Installer\nauthoring tool for Microsoft Windows. It is released under a combination of\nfree software licenses, and is a widely-used alternative to commercial\nproprietary products like InstallShield. electron-builder supports NSIS\nas a build target.\n\n\nOSR\nOSR (Off-screen rendering) can be used for loading heavy page in\nbackground and then displaying it after (it will be much faster).\nIt allows you to render page without showing it on screen.\n\n\nprocess\nA process is an instance of a computer program that is being executed. Electron\napps that make use of the main and one or many renderer process are\nactually running several programs simultaneously.\nIn Node.js and Electron, each running process has a process object. This\nobject is a global that provides information about, and control over, the\ncurrent process. As a global, it is always available to applications without\nusing require().\nSee also: main process, renderer process\n\n\nrenderer process\nThe renderer process is a browser window in your app. Unlike the main process,\nthere can be multiple of these and each is run in a separate process.\nThey can also be hidden.\nIn normal browsers, web pages usually run in a sandboxed environment and are not\nallowed access to native resources. Electron users, however, have the power to\nuse Node.js APIs in web pages allowing lower level operating system\ninteractions.\nSee also: process, main process\n\n\nSquirrel\nSquirrel is an open-source framework that enables Electron apps to update\nautomatically as new versions are released. See the autoUpdater API for\ninfo about getting started with Squirrel.\n\n\nuserland\nThis term originated in the Unix community, where \"userland\" or \"userspace\"\nreferred to programs that run outside of the operating system kernel. More\nrecently, the term has been popularized in the Node and npm community to\ndistinguish between the features available in \"Node core\" versus packages\npublished to the npm registry by the much larger \"user\" community.\nLike Node, Electron is focused on having a small set of APIs that provide\nall the necessary primitives for developing multi-platform desktop applications.\nThis design philosophy allows Electron to remain a flexible tool without being\noverly prescriptive about how it should be used. Userland enables users to\ncreate and share tools that provide additional functionality on top of what is\navailable in \"core\".\n\n\nV8\nV8 is Google's open source JavaScript engine. It is written in C++ and is\nused in Google Chrome. V8 can run standalone, or can be embedded into any C++ application.\nElectron builds V8 as part of Chromium and then points Node to that V8 when\nbuilding it.\nV8's version numbers always correspond to those of Google Chrome. Chrome 59\nincludes V8 5.9, Chrome 58 includes V8 5.8, etc.\n\ndevelopers.google.com/v8\nnodejs.org/api/v8.html\ndocs/development/v8-development.md\n\n\n\nwebview\nwebview tags are used to embed 'guest' content (such as external web pages) in\nyour Electron app. They are similar to iframes, but differ in that each\nwebview runs in a separate process. It doesn't have the same\npermissions as your web page and all interactions between your app and\nembedded content will be asynchronous. This keeps your app safe from the\nembedded content.\n" + }, + { + "type": "tutorial", + "title": "In-App Purchase (macOS)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/in-app-purchases.md", + "url": "https://electronjs.org/docs/tutorial/in-app-purchases", + "slug": "in-app-purchases", + "body": "In-App Purchase (macOS)\n\n\nPreparing\n\n\nPaid Applications Agreement\nIf you haven't already, you’ll need to sign the Paid Applications Agreement and set up your banking and tax information in iTunes Connect. \niTunes Connect Developer Help: Agreements, tax, and banking overview\n\n\nCreate Your In-App Purchases\nThen, you'll need to configure your in-app purchases in iTunes Connect, and include details such as name, pricing, and description that highlights the features and functionality of your in-app purchase.\niTunes Connect Developer Help: Create an in-app purchase\n\n\nChange the CFBundleIdentifier\nTo test In-App Purchase in development with Electron you'll have to change the CFBundleIdentifier in node_modules/electron/dist/Electron.app/Contents/Info.plist. You have to replace com.github.electron by the bundle identifier of the application you created with iTunes Connect.\nCFBundleIdentifier\ncom.example.app\n\n\nCode example\nHere is an example that shows how to use In-App Purchases in Electron. You'll have to replace the product ids by the identifiers of the products created with iTunes Connect (the identifier of com.example.app.product1 is product1). Note that you have to listen to the transactions-updated event as soon as possible in your app.\nconst { inAppPurchase } = require('electron').remote\nconst PRODUCT_IDS = ['id1', 'id2']\n\n// Listen for transactions as soon as possible.\ninAppPurchase.on('transactions-updated', (event, transactions) => {\n if (!Array.isArray(transactions)) {\n return\n }\n\n // Check each transaction.\n transactions.forEach(function (transaction) {\n var payment = transaction.payment\n\n switch (transaction.transactionState) {\n case 'purchasing':\n console.log(`Purchasing ${payment.productIdentifier}...`)\n break\n case 'purchased':\n\n console.log(`${payment.productIdentifier} purchased.`)\n\n // Get the receipt url.\n let receiptURL = inAppPurchase.getReceiptURL()\n\n console.log(`Receipt URL: ${receiptURL}`)\n\n // Submit the receipt file to the server and check if it is valid.\n // @see https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html\n // ...\n // If the receipt is valid, the product is purchased\n // ...\n\n // Finish the transaction.\n inAppPurchase.finishTransactionByDate(transaction.transactionDate)\n\n break\n case 'failed':\n\n console.log(`Failed to purchase ${payment.productIdentifier}.`)\n\n // Finish the transaction.\n inAppPurchase.finishTransactionByDate(transaction.transactionDate)\n\n break\n case 'restored':\n\n console.log(`The purchase of ${payment.productIdentifier} has been restored.`)\n\n break\n case 'deferred':\n\n console.log(`The purchase of ${payment.productIdentifier} has been deferred.`)\n\n break\n default:\n break\n }\n })\n})\n\n// Check if the user is allowed to make in-app purchase.\nif (!inAppPurchase.canMakePayments()) {\n console.log('The user is not allowed to make in-app purchase.')\n}\n\n// Retrieve and display the product descriptions.\ninAppPurchase.getProducts(PRODUCT_IDS, (products) => {\n // Check the parameters.\n if (!Array.isArray(products) || products.length <= 0) {\n console.log('Unable to retrieve the product informations.')\n return\n }\n\n // Display the name and price of each product.\n products.forEach((product) => {\n console.log(`The price of ${product.localizedTitle} is ${product.formattedPrice}.`)\n })\n\n // Ask the user which product he/she wants to purchase.\n // ...\n let selectedProduct = products[0]\n let selectedQuantity = 1\n\n // Purchase the selected product.\n inAppPurchase.purchaseProduct(selectedProduct.productIdentifier, selectedQuantity, (isProductValid) => {\n if (!isProductValid) {\n console.log('The product is not valid.')\n return\n }\n\n console.log('The payment has been added to the payment queue.')\n })\n})\n" + }, + { + "type": "tutorial", + "title": "Installation", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/installation.md", + "url": "https://electronjs.org/docs/tutorial/installation", + "slug": "installation", + "body": "Installation\nTo install prebuilt Electron binaries, use npm.\nThe preferred method is to install Electron as a development dependency in your\napp:\nnpm install electron --save-dev\nSee the Electron versioning doc for info on how to\nmanage Electron versions in your apps.\n\n\nGlobal Installation\nYou can also install the electron command globally in your $PATH:\nnpm install electron -g\n\n\nCustomization\nIf you want to change the architecture that is downloaded (e.g., ia32 on an\nx64 machine), you can use the --arch flag with npm install or set the\nnpm_config_arch environment variable:\nnpm install --arch=ia32 electron\nIn addition to changing the architecture, you can also specify the platform\n(e.g., win32, linux, etc.) using the --platform flag:\nnpm install --platform=win32 electron\n\n\nProxies\nIf you need to use an HTTP proxy you can set these environment variables.\n\n\nCustom Mirrors and Caches\nDuring installation, the electron module will call out to\nelectron-download to download prebuilt binaries of\nElectron for your platform. It will do so by contacting GitHub's\nrelease download page (https://github.com/electron/electron/releases/tag/v$VERSION,\nwhere $VERSION is the exact version of Electron).\nIf you are unable to access GitHub or you need to provide a custom build, you\ncan do so by either providing a mirror or an existing cache directory.\n\n\nMirror\nYou can use environment variables to override the base URL, the path at which to\nlook for Electron binaries, and the binary filename. The url used by electron-download\nis composed as follows:\nurl = ELECTRON_MIRROR + ELECTRON_CUSTOM_DIR + '/' + ELECTRON_CUSTOM_FILENAME\nFor instance, to use the China mirror:\nELECTRON_MIRROR=\"https://npm.taobao.org/mirrors/electron/\"\n\n\nCache\nAlternatively, you can override the local cache. electron-download will cache\ndownloaded binaries in a local directory to not stress your network. You can use\nthat cache folder to provide custom builds of Electron or to avoid making contact\nwith the network at all.\n\nLinux: $XDG_CACHE_HOME or ~/.cache/electron/\nMacOS: ~/Library/Caches/electron/\nWindows: $LOCALAPPDATA/electron/Cache or ~/AppData/Local/electron/Cache/\n\nOn environments that have been using older versions of Electron, you might find the\ncache also in ~/.electron.\nYou can also override the local cache location by providing a ELECTRON_CACHE\nenvironment variable.\nThe cache contains the version's official zip file as well as a checksum, stored as\na text file. A typical cache might look like this:\n├── electron-v1.7.9-darwin-x64.zip\n├── electron-v1.8.1-darwin-x64.zip\n├── electron-v1.8.2-beta.1-darwin-x64.zip\n├── electron-v1.8.2-beta.2-darwin-x64.zip\n├── electron-v1.8.2-beta.3-darwin-x64.zip\n├── SHASUMS256.txt-1.7.9\n├── SHASUMS256.txt-1.8.1\n├── SHASUMS256.txt-1.8.2-beta.1\n├── SHASUMS256.txt-1.8.2-beta.2\n├── SHASUMS256.txt-1.8.2-beta.3\n\n\nTroubleshooting\nWhen running npm install electron, some users occasionally encounter\ninstallation errors.\nIn almost all cases, these errors are the result of network problems and not\nactual issues with the electron npm package. Errors like ELIFECYCLE,\nEAI_AGAIN, ECONNRESET, and ETIMEDOUT are all indications of such\nnetwork problems. The best resolution is to try switching networks, or\nwait a bit and try installing again.\nYou can also attempt to download Electron directly from\nelectron/electron/releases\nif installing via npm is failing.\nIf installation fails with an EACCESS error you may need to\nfix your npm permissions.\nIf the above error persists, the unsafe-perm flag may need to be\nset to true:\nsudo npm install electron --unsafe-perm=true\nOn slower networks, it may be advisable to use the --verbose flag in order to\nshow download progress:\nnpm install --verbose electron\nIf you need to force a re-download of the asset and the SHASUM file set the\nforce_no_cache environment variable to true.\n" + }, + { + "type": "tutorial", + "title": "Issues In Electron", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/issues.md", + "url": "https://electronjs.org/docs/tutorial/issues", + "slug": "issues", + "body": "Issues In Electron\n\n\nIssues\n\nHow to Contribute in Issues\nAsking for General Help\nSubmitting a Bug Report\nTriaging a Bug Report\nResolving a Bug Report\n\n\n\nHow to Contribute in Issues\nFor any issue, there are fundamentally three ways an individual can\ncontribute:\n\nBy opening the issue for discussion: If you believe that you have found\na new bug in Electron, you should report it by creating a new issue in\nthe electron/electron issue tracker.\nBy helping to triage the issue: You can do this either by providing\nassistive details (a reproducible test case that demonstrates a bug) or by\nproviding suggestions to address the issue.\nBy helping to resolve the issue: This can be done by demonstrating\nthat the issue is not a bug or is fixed; but more often, by opening\na pull request that changes the source in electron/electron in a\nconcrete and reviewable manner.\n\n\n\nAsking for General Help\n\"Finding Support\" has a\nlist of resources for getting programming help, reporting security issues,\ncontributing, and more. Please use the issue tracker for bugs only!\n\n\nSubmitting a Bug Report\nWhen opening a new issue in the electron/electron issue tracker, users\nwill be presented with a template that should be filled in.\n\n\n* Electron version:\n* Operating system:\n\n### Expected behavior\n\n\n\n### Actual behavior\n\n\n\n### How to reproduce\n\n\nIf you believe that you have found a bug in Electron, please fill out this\nform to the best of your ability.\nThe two most important pieces of information needed to evaluate the report are\na description of the bug and a simple test case to recreate it. It easier to fix\na bug if it can be reproduced.\nSee How to create a Minimal, Complete, and Verifiable example.\n\n\nTriaging a Bug Report\nIt's common for open issues to involve discussion. Some contributors may\nhave differing opinions, including whether the behavior is a bug or feature.\nThis discussion is part of the process and should be kept focused, helpful,\nand professional.\nTerse responses that provide neither additional context nor supporting detail\nare not helpful or professional. To many, such responses are annoying and\nunfriendly.\nContributors are encouraged to solve issues collaboratively and help one\nanother make progress. If encounter an issue that you feel is invalid, or\nwhich contains incorrect information, explain why you feel that way with\nadditional supporting context, and be willing to be convinced that you may\nbe wrong. By doing so, we can often reach the correct outcome faster.\n\n\nResolving a Bug Report\nMost issues are resolved by opening a pull request. The process for opening and\nreviewing a pull request is similar to that of opening and triaging issues, but\ncarries with it a necessary review and approval workflow that ensures that the\nproposed changes meet the minimal quality and functional guidelines of the\nElectron project.\n" + }, + { + "type": "tutorial", + "title": "Keyboard Shortcuts", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/keyboard-shortcuts.md", + "url": "https://electronjs.org/docs/tutorial/keyboard-shortcuts", + "slug": "keyboard-shortcuts", + "body": "Keyboard Shortcuts\n\nConfigure local and global keyboard shortcuts\n\n\n\nLocal Shortcuts\nYou can use the Menu module to configure keyboard shortcuts that will\nbe triggered only when the app is focused. To do so, specify an\naccelerator property when creating a MenuItem.\nconst {Menu, MenuItem} = require('electron')\nconst menu = new Menu()\n\nmenu.append(new MenuItem({\n label: 'Print',\n accelerator: 'CmdOrCtrl+P',\n click: () => { console.log('time to print stuff') }\n}))\nYou can configure different key combinations based on the user's operating system.\n{\n accelerator: process.platform === 'darwin' ? 'Alt+Cmd+I' : 'Ctrl+Shift+I'\n}\n\n\nGlobal Shortcuts\nYou can use the globalShortcut module to detect keyboard events even when\nthe application does not have keyboard focus.\nconst {app, globalShortcut} = require('electron')\n\napp.on('ready', () => {\n globalShortcut.register('CommandOrControl+X', () => {\n console.log('CommandOrControl+X is pressed')\n })\n})\n\n\nShortcuts within a BrowserWindow\nIf you want to handle keyboard shortcuts for a BrowserWindow, you can use the keyup and keydown event listeners on the window object inside the renderer process.\nwindow.addEventListener('keyup', doSomething, true)\nNote the third parameter true which means the listener will always receive key presses before other listeners so they can't have stopPropagation() called on them.\nThe before-input-event event\nis emitted before dispatching keydown and keyup events in the page. It can\nbe used to catch and handle custom shortcuts that are not visible in the menu.\nIf you don't want to do manual shortcut parsing there are libraries that do advanced key detection such as mousetrap.\nMousetrap.bind('4', () => { console.log('4') })\nMousetrap.bind('?', () => { console.log('show shortcuts!') })\nMousetrap.bind('esc', () => { console.log('escape') }, 'keyup')\n\n// combinations\nMousetrap.bind('command+shift+k', () => { console.log('command shift k') })\n\n// map multiple combinations to the same callback\nMousetrap.bind(['command+k', 'ctrl+k'], () => {\n console.log('command k or control k')\n\n // return false to prevent default behavior and stop event from bubbling\n return false\n})\n\n// gmail style sequences\nMousetrap.bind('g i', () => { console.log('go to inbox') })\nMousetrap.bind('* a', () => { console.log('select all') })\n\n// konami code!\nMousetrap.bind('up up down down left right left right b a enter', () => {\n console.log('konami code')\n})\n" + }, + { + "type": "tutorial", + "title": "Custom Linux Desktop Launcher Actions", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/linux-desktop-actions.md", + "url": "https://electronjs.org/docs/tutorial/linux-desktop-actions", + "slug": "linux-desktop-actions", + "body": "Custom Linux Desktop Launcher Actions\nOn many Linux environments, you can add custom entries to its launcher\nby modifying the .desktop file. For Canonical's Unity documentation,\nsee Adding Shortcuts to a Launcher. For details on a\nmore generic implementation, see the freedesktop.org Specification.\nLauncher shortcuts of Audacious:\n\nGenerally speaking, shortcuts are added by providing a Name and Exec\nproperty for each entry in the shortcuts menu. Unity will execute the\nExec field once clicked by the user. The format is as follows:\nActions=PlayPause;Next;Previous\n\n[Desktop Action PlayPause]\nName=Play-Pause\nExec=audacious -t\nOnlyShowIn=Unity;\n\n[Desktop Action Next]\nName=Next\nExec=audacious -f\nOnlyShowIn=Unity;\n\n[Desktop Action Previous]\nName=Previous\nExec=audacious -r\nOnlyShowIn=Unity;\nUnity's preferred way of telling your application what to do is to use\nparameters. You can find these in your app in the global variable\nprocess.argv.\n" + }, + { + "type": "tutorial", + "title": "Mac App Store Submission Guide", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/mac-app-store-submission-guide.md", + "url": "https://electronjs.org/docs/tutorial/mac-app-store-submission-guide", + "slug": "mac-app-store-submission-guide", + "body": "Mac App Store Submission Guide\nSince v0.34.0, Electron allows submitting packaged apps to the Mac App Store\n(MAS). This guide provides information on: how to submit your app and the\nlimitations of the MAS build.\nNote: Submitting an app to Mac App Store requires enrolling Apple Developer\nProgram, which costs money.\n\n\nHow to Submit Your App\nThe following steps introduce a simple way to submit your app to Mac App Store.\nHowever, these steps do not ensure your app will be approved by Apple; you\nstill need to read Apple's Submitting Your App guide on\nhow to meet the Mac App Store requirements.\n\n\nGet Certificate\nTo submit your app to the Mac App Store, you first must get a certificate from\nApple. You can follow these existing guides on web.\n\n\nGet Team ID\nBefore signing your app, you need to know the Team ID of your account. To locate\nyour Team ID, Sign in to Apple Developer Center,\nand click Membership in the sidebar. Your Team ID appears in the Membership\nInformation section under the team name.\n\n\nSign Your App\nAfter finishing the preparation work, you can package your app by following\nApplication Distribution, and then proceed to\nsigning your app.\nFirst, you have to add a ElectronTeamID key to your app's Info.plist, which\nhas your Team ID as value:\n\n\n ...\n ElectronTeamID\n TEAM_ID\n\n\nThen, you need to prepare three entitlements files.\nchild.plist:\n\n\n\n \n com.apple.security.app-sandbox\n \n com.apple.security.inherit\n \n \n\nparent.plist:\n\n\n\n \n com.apple.security.app-sandbox\n \n com.apple.security.application-groups\n TEAM_ID.your.bundle.id\n \n\nloginhelper.plist:\n\n\n\n \n com.apple.security.app-sandbox\n \n \n\nYou have to replace TEAM_ID with your Team ID, and replace your.bundle.id\nwith the Bundle ID of your app.\nAnd then sign your app with the following script:\n#!/bin/bash\n\n# Name of your app.\nAPP=\"YourApp\"\n# The path of your app to sign.\nAPP_PATH=\"/path/to/YourApp.app\"\n# The path to the location you want to put the signed package.\nRESULT_PATH=\"~/Desktop/$APP.pkg\"\n# The name of certificates you requested.\nAPP_KEY=\"3rd Party Mac Developer Application: Company Name (APPIDENTITY)\"\nINSTALLER_KEY=\"3rd Party Mac Developer Installer: Company Name (APPIDENTITY)\"\n# The path of your plist files.\nCHILD_PLIST=\"/path/to/child.plist\"\nPARENT_PLIST=\"/path/to/parent.plist\"\nLOGINHELPER_PLIST=\"/path/to/loginhelper.plist\"\n\nFRAMEWORKS_PATH=\"$APP_PATH/Contents/Frameworks\"\n\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Electron Framework\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Libraries/libffmpeg.dylib\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A/Libraries/libnode.dylib\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/Electron Framework.framework\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/$APP Helper.app/Contents/MacOS/$APP Helper\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/$APP Helper.app/\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/$APP Helper EH.app/Contents/MacOS/$APP Helper EH\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/$APP Helper EH.app/\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/$APP Helper NP.app/Contents/MacOS/$APP Helper NP\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$FRAMEWORKS_PATH/$APP Helper NP.app/\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$LOGINHELPER_PLIST\" \"$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/Contents/MacOS/$APP Login Helper\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$LOGINHELPER_PLIST\" \"$APP_PATH/Contents/Library/LoginItems/$APP Login Helper.app/\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$CHILD_PLIST\" \"$APP_PATH/Contents/MacOS/$APP\"\ncodesign -s \"$APP_KEY\" -f --entitlements \"$PARENT_PLIST\" \"$APP_PATH\"\n\nproductbuild --component \"$APP_PATH\" /Applications --sign \"$INSTALLER_KEY\" \"$RESULT_PATH\"\nIf you are new to app sandboxing under macOS, you should also read through\nApple's Enabling App Sandbox to have a basic idea, then\nadd keys for the permissions needed by your app to the entitlements files.\nApart from manually signing your app, you can also choose to use the\nelectron-osx-sign module to do the job.\n\n\nSign Native Modules\nNative modules used in your app also need to be signed. If using\nelectron-osx-sign, be sure to include the path to the built binaries in the\nargument list:\nelectron-osx-sign YourApp.app YourApp.app/Contents/Resources/app/node_modules/nativemodule/build/release/nativemodule\nAlso note that native modules may have intermediate files produced which should\nnot be included (as they would also need to be signed). If you use\nelectron-packager before version 8.1.0, add\n--ignore=.+\\.o$ to your build step to ignore these files. Versions 8.1.0 and\nlater ignores those files by default.\n\n\nUpload Your App\nAfter signing your app, you can use Application Loader to upload it to iTunes\nConnect for processing, making sure you have created a record\nbefore uploading.\n\n\nSubmit Your App for Review\nAfter these steps, you can submit your app for review.\n\n\nLimitations of MAS Build\nIn order to satisfy all requirements for app sandboxing, the following modules\nhave been disabled in the MAS build:\n\ncrashReporter\nautoUpdater\n\nand the following behaviors have been changed:\n\nVideo capture may not work for some machines.\nCertain accessibility features may not work.\nApps will not be aware of DNS changes.\n\nAlso, due to the usage of app sandboxing, the resources which can be accessed by\nthe app are strictly limited; you can read App Sandboxing for\nmore information.\n\n\nAdditional Entitlements\nDepending on which Electron APIs your app uses, you may need to add additional\nentitlements to your parent.plist file to be able to use these APIs from your\napp's Mac App Store build.\n\n\nNetwork Access\nEnable outgoing network connections to allow your app to connect to a server:\ncom.apple.security.network.client\n\nEnable incoming network connections to allow your app to open a network\nlistening socket:\ncom.apple.security.network.server\n\nSee the Enabling Network Access documentation for more\ndetails.\n\n\ndialog.showOpenDialog\ncom.apple.security.files.user-selected.read-only\n\nSee the Enabling User-Selected File Access documentation for\nmore details.\n\n\ndialog.showSaveDialog\ncom.apple.security.files.user-selected.read-write\n\nSee the Enabling User-Selected File Access documentation for\nmore details.\n\n\nKnown issues\n\n\nshell.openItem(filePath)\nThis will fail when the app is signed for distribution in the Mac App Store.\nSubscribe to #9005 for updates.\n\n\nWorkaround\nshell.openExternal('file://' + filePath) will open the file in the default application as long as the extension is associated with an installed app.\n\n\nCryptographic Algorithms Used by Electron\nDepending on the country and region you are located, Mac App Store may require\ndocumenting the cryptographic algorithms used in your app, and even ask you to\nsubmit a copy of U.S. Encryption Registration (ERN) approval.\nElectron uses following cryptographic algorithms:\n\nAES - NIST SP 800-38A, NIST SP 800-38D, RFC 3394\nHMAC - FIPS 198-1\nECDSA - ANS X9.62–2005\nECDH - ANS X9.63–2001\nHKDF - NIST SP 800-56C\nPBKDF2 - RFC 2898\nRSA - RFC 3447\nSHA - FIPS 180-4\nBlowfish - https://www.schneier.com/cryptography/blowfish/\nCAST - RFC 2144, RFC 2612\nDES - FIPS 46-3\nDH - RFC 2631\nDSA - ANSI X9.30\nEC - SEC 1\nIDEA - \"On the Design and Security of Block Ciphers\" book by X. Lai\nMD2 - RFC 1319\nMD4 - RFC 6150\nMD5 - RFC 1321\nMDC2 - ISO/IEC 10118-2\nRC2 - RFC 2268\nRC4 - RFC 4345\nRC5 - http://people.csail.mit.edu/rivest/Rivest-rc5rev.pdf\nRIPEMD - ISO/IEC 10118-3\n\nOn how to get the ERN approval, you can reference the article: How to legally\nsubmit an app to Apple’s App Store when it uses encryption (or how to obtain an\nERN).\n" + }, + { + "type": "tutorial", + "title": "MacOS Dock", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/macos-dock.md", + "url": "https://electronjs.org/docs/tutorial/macos-dock", + "slug": "macos-dock", + "body": "MacOS Dock\nElectron has APIs to configure the app's icon in the macOS Dock. A macOS-only\nAPI exists to create a a custom dock menu, but\nElectron also uses the app's dock icon to implement cross-platform features\nlike recent documents and\napplication progress.\nThe custom dock is commonly used to add shortcuts to tasks the user wouldn't\nwant to open the whole app window for.\nDock menu of Terminal.app:\n\nTo set your custom dock menu, you can use the app.dock.setMenu API, which is\nonly available on macOS:\nconst { app, Menu } = require('electron')\n\nconst dockMenu = Menu.buildFromTemplate([\n {\n label: 'New Window',\n click () { console.log('New Window') }\n }, {\n label: 'New Window with Settings',\n submenu: [\n { label: 'Basic' },\n { label: 'Pro' }\n ]\n },\n { label: 'New Command...' }\n])\n\napp.dock.setMenu(dockMenu)\n" + }, + { + "type": "tutorial", + "title": "Multithreading", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/multithreading.md", + "url": "https://electronjs.org/docs/tutorial/multithreading", + "slug": "multithreading", + "body": "Multithreading\nWith Web Workers, it is possible to run JavaScript in OS-level\nthreads.\n\n\nMulti-threaded Node.js\nIt is possible to use Node.js features in Electron's Web Workers, to do\nso the nodeIntegrationInWorker option should be set to true in\nwebPreferences.\nlet win = new BrowserWindow({\n webPreferences: {\n nodeIntegrationInWorker: true\n }\n})\nThe nodeIntegrationInWorker can be used independent of nodeIntegration, but\nsandbox must not be set to true.\n\n\nAvailable APIs\nAll built-in modules of Node.js are supported in Web Workers, and asar\narchives can still be read with Node.js APIs. However none of Electron's\nbuilt-in modules can be used in a multi-threaded environment.\n\n\nNative Node.js modules\nAny native Node.js module can be loaded directly in Web Workers, but it is\nstrongly recommended not to do so. Most existing native modules have been\nwritten assuming single-threaded environment, using them in Web Workers will\nlead to crashes and memory corruptions.\nNote that even if a native Node.js module is thread-safe it's still not safe to\nload it in a Web Worker because the process.dlopen function is not thread\nsafe.\nThe only way to load a native module safely for now, is to make sure the app\nloads no native modules after the Web Workers get started.\nprocess.dlopen = () => {\n throw new Error('Load native module is not safe')\n}\nlet worker = new Worker('script.js')\n" + }, + { + "type": "tutorial", + "title": "Native File Drag & Drop", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/native-file-drag-drop.md", + "url": "https://electronjs.org/docs/tutorial/native-file-drag-drop", + "slug": "native-file-drag-drop", + "body": "Native File Drag & Drop\nCertain kinds of applications that manipulate files might want to support\nthe operating system's native file drag & drop feature. Dragging files into\nweb content is common and supported by many websites. Electron additionally\nsupports dragging files and content out from web content into the operating\nsystem's world.\nTo implement this feature in your app, you need to call webContents.startDrag(item)\nAPI in response to the ondragstart event.\nIn your renderer process, handle the ondragstart event and forward the\ninformation to your main process.\nitem\n\nThen, in the main process, augment the event with a path to the file that is\nbeing dragged and an icon.\nconst { ipcMain } = require('electron')\n\nipcMain.on('ondragstart', (event, filePath) => {\n event.sender.startDrag({\n file: filePath,\n icon: '/path/to/icon.png'\n })\n})\n" + }, + { + "type": "tutorial", + "title": "Notifications (Windows, Linux, macOS)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/notifications.md", + "url": "https://electronjs.org/docs/tutorial/notifications", + "slug": "notifications", + "body": "Notifications (Windows, Linux, macOS)\nAll three operating systems provide means for applications to send notifications\nto the user. Electron conveniently allows developers to send notifications with\nthe HTML5 Notification API, using\nthe currently running operating system's native notification APIs to display it.\nNote: Since this is an HTML5 API it is only available in the renderer process. If\nyou want to show Notifications in the main process please check out the\nNotification module.\nlet myNotification = new Notification('Title', {\n body: 'Lorem Ipsum Dolor Sit Amet'\n})\n\nmyNotification.onclick = () => {\n console.log('Notification clicked')\n}\nWhile code and user experience across operating systems are similar, there\nare subtle differences.\n\n\nWindows\n\nOn Windows 10, notifications \"just work\".\nOn Windows 8.1 and Windows 8, a shortcut to your app, with an Application User\nModel ID, must be installed to the Start screen. Note,\nhowever, that it does not need to be pinned to the Start screen.\nOn Windows 7, notifications work via a custom implementation which visually\nresembles the native one on newer systems.\n\nFurthermore, in Windows 8, the maximum length for the notification body is 250\ncharacters, with the Windows team recommending that notifications should be kept\nto 200 characters. That said, that limitation has been removed in Windows 10, with\nthe Windows team asking developers to be reasonable. Attempting to send gigantic\namounts of text to the API (thousands of characters) might result in instability.\n\n\nAdvanced Notifications\nLater versions of Windows allow for advanced notifications, with custom templates,\nimages, and other flexible elements. To send those notifications (from either the\nmain process or the renderer process), use the userland module\nelectron-windows-notifications,\nwhich uses native Node addons to send ToastNotification and TileNotification objects.\nWhile notifications including buttons work with electron-windows-notifications,\nhandling replies requires the use of electron-windows-interactive-notifications, which\nhelps with registering the required COM components and calling your Electron app with\nthe entered user data.\n\n\nQuiet Hours / Presentation Mode\nTo detect whether or not you're allowed to send a notification, use the userland module\nelectron-notification-state.\nThis allows you to determine ahead of time whether or not Windows will silently throw\nthe notification away.\n\n\nmacOS\nNotifications are straight-forward on macOS, but you should be aware of\nApple's Human Interface guidelines regarding notifications.\nNote that notifications are limited to 256 bytes in size and will be truncated\nif you exceed that limit.\n\n\nAdvanced Notifications\nLater versions of macOS allow for notifications with an input field, allowing the user\nto quickly reply to a notification. In order to send notifications with an input field,\nuse the userland module node-mac-notifier.\n\n\nDo not disturb / Session State\nTo detect whether or not you're allowed to send a notification, use the userland module\nelectron-notification-state.\nThis will allow you to detect ahead of time whether or not the notification will be displayed.\n\n\nLinux\nNotifications are sent using libnotify which can show notifications on any\ndesktop environment that follows Desktop Notifications\nSpecification, including Cinnamon, Enlightenment, Unity,\nGNOME, KDE.\n" + }, + { + "type": "tutorial", + "title": "Offscreen Rendering", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/offscreen-rendering.md", + "url": "https://electronjs.org/docs/tutorial/offscreen-rendering", + "slug": "offscreen-rendering", + "body": "Offscreen Rendering\nOffscreen rendering lets you obtain the content of a browser window in a bitmap,\nso it can be rendered anywhere, for example on a texture in a 3D scene. The\noffscreen rendering in Electron uses a similar approach than the Chromium\nEmbedded Framework project.\nTwo modes of rendering can be used and only the dirty area is passed in the\n'paint' event to be more efficient. The rendering can be stopped, continued\nand the frame rate can be set. The specified frame rate is a top limit value,\nwhen there is nothing happening on a webpage, no frames are generated. The\nmaximum frame rate is 60, because above that there is no benefit, only\nperformance loss.\nNote: An offscreen window is always created as a Frameless Window.\n\n\nRendering Modes\n\n\nGPU accelerated\nGPU accelerated rendering means that the GPU is used for composition. Because of\nthat the frame has to be copied from the GPU which requires more performance,\nthus this mode is quite a bit slower than the other one. The benefit of this\nmode that WebGL and 3D CSS animations are supported.\n\n\nSoftware output device\nThis mode uses a software output device for rendering in the CPU, so the frame\ngeneration is much faster, thus this mode is preferred over the GPU accelerated\none.\nTo enable this mode GPU acceleration has to be disabled by calling the\napp.disableHardwareAcceleration() API.\n\n\nUsage\nconst { app, BrowserWindow } = require('electron')\n\napp.disableHardwareAcceleration()\n\nlet win\n\napp.once('ready', () => {\n win = new BrowserWindow({\n webPreferences: {\n offscreen: true\n }\n })\n\n win.loadURL('http://github.com')\n win.webContents.on('paint', (event, dirty, image) => {\n // updateBitmap(dirty, image.getBitmap())\n })\n win.webContents.setFrameRate(30)\n})\n" + }, + { + "type": "tutorial", + "title": "Online/Offline Event Detection", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/online-offline-events.md", + "url": "https://electronjs.org/docs/tutorial/online-offline-events", + "slug": "online-offline-events", + "body": "Online/Offline Event Detection\nOnline and offline event detection can be implemented in the renderer process using the navigator.onLine attribute, part of standard HTML5 API.\nThe navigator.onLine attribute returns false if any network requests are guaranteed to fail i.e. definitely offline (disconnected from the network). It returns true in all other cases.\nSince all other conditions return true, one has to be mindful of getting false positives, as we cannot assume true value necessarily means that Electron can access the internet. Such as in cases where the computer is running a virtualization software that has virtual ethernet adapters that are always “connected.”\nTherefore, if you really want to determine the internet access status of Electron,\nyou should develop additional means for checking.\nExample:\nmain.js\nconst {app, BrowserWindow} = require('electron')\n\nlet onlineStatusWindow\n\napp.on('ready', () => {\n onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })\n onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`)\n})\nonline-status.html\n\n\n\n\n\n\nThere may be instances where you want to respond to these events in the\nmain process as well. The main process however does not have a\nnavigator object and thus cannot detect these events directly. Using\nElectron's inter-process communication utilities, the events can be forwarded\nto the main process and handled as needed, as shown in the following example.\nmain.js\nconst {app, BrowserWindow, ipcMain} = require('electron')\nlet onlineStatusWindow\n\napp.on('ready', () => {\n onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })\n onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`)\n})\n\nipcMain.on('online-status-changed', (event, status) => {\n console.log(status)\n})\nonline-status.html\n\n\n\n\n\n\n" + }, + { + "type": "tutorial", + "title": "Planned Breaking API Changes (3.0)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/planned-breaking-changes.md", + "url": "https://electronjs.org/docs/tutorial/planned-breaking-changes", + "slug": "planned-breaking-changes", + "body": "Planned Breaking API Changes (3.0)\nThe following list includes the APIs that will be removed in Electron 3.0.\nThere is no timetable for when this release will occur but deprecation\nwarnings will be added at least one major version beforehand.\n\n\napp\n// Deprecated\napp.getAppMemoryInfo()\n// Replace with\napp.getAppMetrics()\n\n\nBrowserWindow\n// Deprecated\nlet optionsA = {webPreferences: {blinkFeatures: ''}}\nlet windowA = new BrowserWindow(optionsA)\n// Replace with\nlet optionsB = {webPreferences: {enableBlinkFeatures: ''}}\nlet windowB = new BrowserWindow(optionsB)\n\n\nclipboard\n// Deprecated\nclipboard.readRtf()\n// Replace with\nclipboard.readRTF()\n\n// Deprecated\nclipboard.writeRtf()\n// Replace with\nclipboard.writeRTF()\n\n// Deprecated\nclipboard.readHtml()\n// Replace with\nclipboard.readHTML()\n\n// Deprecated\nclipboard.writeHtml()\n// Replace with\nclipboard.writeHTML()\n\n\ncrashReporter\n// Deprecated\ncrashReporter.start({\n companyName: 'Crashly',\n submitURL: 'https://crash.server.com',\n autoSubmit: true\n})\n// Replace with\ncrashReporter.start({\n companyName: 'Crashly',\n submitURL: 'https://crash.server.com',\n uploadToServer: true\n})\n\n\nnativeImage\n// Deprecated\nnativeImage.createFromBuffer(buffer, 1.0)\n// Replace with\nnativeImage.createFromBuffer(buffer, {\n scaleFactor: 1.0\n})\n\n\nscreen\n// Deprecated\nscreen.getMenuBarHeight()\n// Replace with\nscreen.getPrimaryDisplay().workArea\n\n\nsession\n// Deprecated\nses.setCertificateVerifyProc(function (hostname, certificate, callback) {\n callback(true)\n})\n// Replace with\nses.setCertificateVerifyProc(function (request, callback) {\n callback(0)\n})\n\n\nTray\n// Deprecated\ntray.setHighlightMode(true)\n// Replace with\ntray.setHighlightMode('on')\n\n// Deprecated\ntray.setHighlightMode(false)\n// Replace with\ntray.setHighlightMode('off')\n\n\nwebContents\n// Deprecated\nwebContents.openDevTools({detach: true})\n// Replace with\nwebContents.openDevTools({mode: 'detach'})\n\n\nwebFrame\n// Deprecated\nwebFrame.registerURLSchemeAsSecure('app')\n// Replace with\nprotocol.registerStandardSchemes(['app'], {secure: true})\n\n// Deprecated\nwebFrame.registerURLSchemeAsPrivileged('app', {secure: true})\n// Replace with\nprotocol.registerStandardSchemes(['app'], {secure: true})\n\n\nNode Headers URL\nThis is the URL specified as disturl in a .npmrc file or as the --dist-url\ncommand line flag when building native Node modules.\nDeprecated: https://atom.io/download/atom-shell\nReplace with: https://atom.io/download/electron\n\n\nFIXME comments\nThe FIXME string is used in code comments to denote things that should be\nfixed for the 3.0 release. See\nhttps://github.com/electron/electron/search?q=fixme\n\n\nPlanned Breaking API Changes (4.0)\nThe following list includes the APIs that will be removed in Electron 4.0.\nThere is no timetable for when this release will occur but deprecation\nwarnings will be added at least one major version beforehand.\n\n\napp.makeSingleInstance\n// Deprecated\napp.makeSingleInstance(function (argv, cwd) {\n\n})\n// Replace with\napp.requestSingleInstanceLock()\napp.on('second-instance', function (argv, cwd) {\n\n})\n\n\napp.releaseSingleInstance\n// Deprecated\napp.releaseSingleInstance()\n// Replace with\napp.releaseSingleInstanceLock()\n" + }, + { + "type": "tutorial", + "title": "Progress Bar in Taskbar (Windows, macOS, Unity)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/progress-bar.md", + "url": "https://electronjs.org/docs/tutorial/progress-bar", + "slug": "progress-bar", + "body": "Progress Bar in Taskbar (Windows, macOS, Unity)\nOn Windows a taskbar button can be used to display a progress bar. This enables\na window to provide progress information to the user without the user having to\nswitch to the window itself.\nOn macOS the progress bar will be displayed as a part of the dock icon.\nThe Unity DE also has a similar feature that allows you to specify the progress\nbar in the launcher.\nProgress bar in taskbar button:\n\nAll three cases are covered by the same API - the setProgressBar() method\navailable on instances of BrowserWindows. Call it with a number between 0\nand 1 to indicate your progress. If you have a long-running task that's\ncurrently at 63% towards completion, you'd call it with setProgressBar(0.63).\nGenerally speaking, setting the parameter to a value below zero (like -1)\nwill remove the progress bar while setting it to a value higher than one\n(like 2) will switch the progress bar to intermediate mode.\nSee the API documentation for more options and modes.\nconst { BrowserWindow } = require('electron')\nconst win = new BrowserWindow()\n\nwin.setProgressBar(0.5)\n" + }, + { + "type": "tutorial", + "title": "Pull Requests", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/pull-requests.md", + "url": "https://electronjs.org/docs/tutorial/pull-requests", + "slug": "pull-requests", + "body": "Pull Requests\n\nDependencies\n\nSetting up your local environment\n\nStep 1: Fork\nStep 2: Build\nStep 3: Branch\n\n\n\nMaking Changes\n\nStep 4: Code\n\nStep 5: Commit\n\nCommit message guidelines\n\n\nStep 6: Rebase\nStep 7: Test\nStep 8: Push\nStep 9: Opening the Pull Request\n\nStep 10: Discuss and Update\n\nApproval and Request Changes Workflow\n\n\nStep 11: Landing\nContinuous Integration Testing\n\n\n\n\n\nSetting up your local environment\n\n\nStep 1: Fork\nFork the project on GitHub and clone your fork\nlocally.\n$ git clone git@github.com:username/electron.git\n$ cd electron\n$ git remote add upstream https://github.com/electron/electron.git\n$ git fetch upstream\n\n\nStep 2: Build\nBuild steps and dependencies differ slightly depending on your operating system.\nSee these detailed guides on building Electron locally:\n\nBuilding on MacOS\nBuilding on Linux\nBuilding on Windows\n\nOnce you've built the project locally, you're ready to start making changes!\n\n\nStep 3: Branch\nTo keep your development environment organized, create local branches to\nhold your work. These should be branched directly off of the master branch.\n$ git checkout -b my-branch -t upstream/master\n\n\nMaking Changes\n\n\nStep 4: Code\nMost pull requests opened against the electron/electron repository include\nchanges to either the C/C++ code in the atom/ or brightray/ folders,\nthe JavaScript code in the lib/ folder, the documentation in docs/api/\nor tests in the spec/ folder.\nPlease be sure to run npm run lint from time to time on any code changes\nto ensure that they follow the project's code style.\nSee coding style for\nmore information about best practice when modifying code in different parts of\nthe project.\n\n\nStep 5: Commit\nIt is recommended to keep your changes grouped logically within individual\ncommits. Many contributors find it easier to review changes that are split\nacross multiple commits. There is no limit to the number of commits in a\npull request.\n$ git add my/changed/files\n$ git commit\nNote that multiple commits often get squashed when they are landed.\n\n\nCommit message guidelines\nA good commit message should describe what changed and why. The Electron project\nuses semantic commit messages to streamline\nthe release process.\nBefore a pull request can be merged, it should include at least one semantic\ncommit message, though it's not necessary for all commits in the pull request\nto be semantic. Alternatively, you can update your pull request title to\nstart with a semantic prefix.\nExamples of commit messages with semantic prefixes:\n\nfix: don't overwrite prevent_default if default wasn't prevented\nfeat: add app.isPackaged() method\ndocs: app.isDefaultProtocolClient is now available on Linux \n\nCommon prefixes:\n\nfix: A bug fix\nfeat: A new feature\ndocs: Documentation changes\ntest: Adding missing tests or correcting existing tests\nbuild: Changes that affect the build system\nci: Changes to our CI configuration files and scripts\nperf: A code change that improves performance\nrefactor: A code change that neither fixes a bug nor adds a feature\nstyle: Changes that do not affect the meaning of the code (linting)\n\nOther things to keep in mind when writing a commit message:\n\n\nThe first line should:\n\ncontain a short description of the change (preferably 50 characters or less,\nand no more than 72 characters)\nbe entirely in lowercase with the exception of proper nouns, acronyms, and\nthe words that refer to code, like function/variable names\n\n\nKeep the second line blank.\nWrap all other lines at 72 columns.\n\n\n\nBreaking Changes\nA commit that has the text BREAKING CHANGE: at the beginning of its optional\nbody or footer section introduces a breaking API change (correlating with Major\nin semantic versioning). A breaking change can be part of commits of any type.\ne.g., a fix:, feat: & chore: types would all be valid, in addition to any\nother type.\nSee conventionalcommits.org for more details.\n\n\nStep 6: Rebase\nOnce you have committed your changes, it is a good idea to use git rebase\n(not git merge) to synchronize your work with the main repository.\n$ git fetch upstream\n$ git rebase upstream/master\nThis ensures that your working branch has the latest changes from electron/electron\nmaster.\n\n\nStep 7: Test\nBug fixes and features should always come with tests. A\ntesting guide has been\nprovided to make the process easier. Looking at other tests to see how they\nshould be structured can also help.\nBefore submitting your changes in a pull request, always run the full\ntest suite. To run the tests:\n$ npm run test\nMake sure the linter does not report any issues and that all tests pass.\nPlease do not submit patches that fail either check.\nIf you are updating tests and want to run a single spec to check it:\n$ npm run test -match=menu\nThe above would only run spec modules matching menu, which is useful for\nanyone who's working on tests that would otherwise be at the very end of\nthe testing cycle.\n\n\nStep 8: Push\nOnce your commits are ready to go -- with passing tests and linting --\nbegin the process of opening a pull request by pushing your working branch\nto your fork on GitHub.\n$ git push origin my-branch\n\n\nStep 9: Opening the Pull Request\nFrom within GitHub, opening a new pull request will present you with a template\nthat should be filled out:\n\n\n\nStep 10: Discuss and update\nYou will probably get feedback or requests for changes to your pull request.\nThis is a big part of the submission process so don't be discouraged! Some\ncontributors may sign off on the pull request right away. Others may have\ndetailed comments or feedback. This is a necessary part of the process\nin order to evaluate whether the changes are correct and necessary.\nTo make changes to an existing pull request, make the changes to your local\nbranch, add a new commit with those changes, and push those to your fork.\nGitHub will automatically update the pull request.\n$ git add my/changed/files\n$ git commit\n$ git push origin my-branch\nThere are a number of more advanced mechanisms for managing commits using\ngit rebase that can be used, but are beyond the scope of this guide.\nFeel free to post a comment in the pull request to ping reviewers if you are\nawaiting an answer on something. If you encounter words or acronyms that\nseem unfamiliar, refer to this\nglossary.\n\n\nApproval and Request Changes Workflow\nAll pull requests require approval from a Code Owner of the area you\nmodified in order to land. Whenever a maintainer reviews a pull request they\nmay request changes. These may be small, such as fixing a typo, or may involve\nsubstantive changes. Such requests are intended to be helpful, but at times\nmay come across as abrupt or unhelpful, especially if they do not include\nconcrete suggestions on how to change them.\nTry not to be discouraged. If you feel that a review is unfair, say so or seek\nthe input of another project contributor. Often such comments are the result of\na reviewer having taken insufficient time to review and are not ill-intended.\nSuch difficulties can often be resolved with a bit of patience. That said,\nreviewers should be expected to provide helpful feeback.\n\n\nStep 11: Landing\nIn order to land, a pull request needs to be reviewed and approved by\nat least one Electron Code Owner and pass CI. After that, if there are no\nobjections from other contributors, the pull request can be merged.\nCongratulations and thanks for your contribution!\n\n\nContinuous Integration Testing\nEvery pull request is tested on the Continuous Integration (CI) system to\nconfirm that it works on Electron's supported platforms.\nIdeally, the pull request will pass (\"be green\") on all of CI's platforms.\nThis means that all tests pass and there are no linting errors. However,\nit is not uncommon for the CI infrastructure itself to fail on specific\nplatforms or for so-called \"flaky\" tests to fail (\"be red\"). Each CI\nfailure must be manually inspected to determine the cause.\nCI starts automatically when you open a pull request, but only\nReleasers\ncan restart a CI run. If you believe CI is giving a false negative,\nask a Releaser to restart the tests.\n" + }, + { + "type": "tutorial", + "title": "Quick Start", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/quick-start.md", + "url": "https://electronjs.org/docs/tutorial/quick-start", + "slug": "quick-start", + "body": "Quick Start\nElectron enables you to create desktop applications with pure JavaScript by\nproviding a runtime with rich native (operating system) APIs. You could see it\nas a variant of the Node.js runtime that is focused on desktop applications\ninstead of web servers.\nThe old \"Quick Start\" document that used to live here has been split up into\ntwo documents:\n\nTo check out how a simple Electron app is built, see\nWriting Your First Electron App\nTo check out the process architecture, see\nMain and Renderer Processes.\n\nTo learn more about Electron, check out the\nofficial guides.\n" + }, + { + "type": "tutorial", + "title": "Official Guides", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/README.md", + "url": "https://electronjs.org/docs/tutorial/README", + "slug": "README", + "body": "Official Guides\nPlease make sure that you use the documents that match your Electron version.\nThe version number should be a part of the page URL. If it's not, you are\nprobably using the documentation of a development branch which may contain API\nchanges that are not compatible with your Electron version. To view older\nversions of the documentation, you can\nbrowse by tag\non GitHub by opening the \"Switch branches/tags\" dropdown and selecting the tag\nthat matches your version.\n\n\nFAQ\nThere are questions that are asked quite often. Check this out before creating\nan issue:\n\nElectron FAQ\n\n\n\nGuides and Tutorials\n\n\nSetting up the Development Environment\n\nSetting up macOS\nSetting up Windows\nSetting up Linux\nChoosing an Editor\n\n\n\nCreating your First App\n\nInstalling Electron\nElectron Development in a Nutshell\nRunning Your App\n\n\n\nBoilerplates and CLIs\n\nBoilerplate vs CLI\nelectron-forge\nelectron-builder\nelectron-react-boilerplate\nOther Tools and Boilerplates\n\n\n\nApplication Architecture\n\nMain and Renderer Processes\nUsing Electron's APIs\nUsing Node.js APIs\nUsing Native Node.js Modules\nInter-Process Communication\n\n\n\nAdding Features to Your App\n\nNotifications\nRecent Documents\nApplication Progress\nCustom Dock Menu\nCustom Windows Taskbar\nCustom Linux Desktop Actions\nKeyboard Shortcuts\nOffline/Online Detection\nRepresented File for macOS BrowserWindows\nNative File Drag & Drop\n\n\n\nAccessibility\n\nSpectron\nDevtron\nEnabling Accessibility\n\n\n\nTesting and Debugging\n\nDebugging the Main Process\nUsing Selenium and WebDriver\nTesting on Headless CI Systems (Travis, Jenkins)\nDevTools Extension\nAutomated Testing with a Custom Driver\n\n\n\nPackaging\n\nCode Signing\n\n\n\nDistribution\n\nSupport\nMac App Store\nWindows Store\nSnapcraft\n\n\n\nSecurity\n\nReporting Security Issues\nChromium Security Issues and Upgrades\nElectron Security Warnings\nSecurity Checklist\n\n\n\nUpdates\n\nDeploying an Update Server\nImplementing Updates in Your App\nApplying Updates\n\n\n\n\n\nDetailed Tutorials\nThese individual tutorials expand on topics discussed in the guide above.\n\n\nIn Detail: Installing Electron\n\nGlobal versus Local Installation\nProxies\nCustom Mirrors and Caches\nTroubleshooting\n\n\n\nIn Detail: Electron's Versioning Scheme\n\nsemver\nStabilization Branches\nBeta Releases and Bug Fixes\n\n\n\nIn Detail: Packaging App Source Code with asar\n\nGenerating asar Archives\nUsing asar Archives\nLimitations\nAdding Unpacked Files to asar Archives\n\n\nIn Detail: Using Pepper Flash Plugin\nIn Detail: Using Widevine CDM Plugin\nOffscreen Rendering\n\n\n\nGlossary of Terms\n\n\n\nAPI References\n\nSynopsis\nProcess Object\nSupported Chrome Command Line Switches\nEnvironment Variables\n\n\n\nCustom DOM Elements:\n\nFile Object\n Tag\nwindow.open Function\n\n\n\nModules for the Main Process:\n\napp\nautoUpdater\nBrowserView\nBrowserWindow\ncontentTracing\ndialog\nglobalShortcut\ninAppPurchase\nipcMain\nMenu\nMenuItem\nnet\npowerMonitor\npowerSaveBlocker\nprotocol\nsession\nsystemPreferences\nTray\nwebContents\n\n\n\nModules for the Renderer Process (Web Page):\n\ndesktopCapturer\nipcRenderer\nremote\nwebFrame\n\n\n\nModules for Both Processes:\n\nclipboard\ncrashReporter\nnativeImage\nscreen\nshell\n\n\n\nDevelopment\nSee development/README.md\n" + }, + { + "type": "tutorial", + "title": "Developing Electron", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/README.md", + "url": "https://electronjs.org/docs/tutorial/README", + "slug": "README", + "body": "Developing Electron\nThese guides are intended for people working on the Electron project itself.\nFor guides on Electron app development, see\n/docs/README.md.\n\nCode of Conduct\nContributing to Electron\nIssues\nPull Requests\nDocumentation Styleguide\nSource Code Directory Structure\nCoding Style\nUsing clang-format on C++ Code\nBuild System Overview\nBuild Instructions (macOS)\nBuild Instructions (Windows)\nBuild Instructions (Linux)\nChromium Development\nV8 Development\nTesting\nDebugging on Windows\nDebugging on macOS\nSetting Up Symbol Server in Debugger\nUpgrading Chromium\nUpgrading Crashpad\nUpgrading Node\nReleasing\n\n" + }, + { + "type": "tutorial", + "title": "Recent Documents (Windows & macOS)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/recent-documents.md", + "url": "https://electronjs.org/docs/tutorial/recent-documents", + "slug": "recent-documents", + "body": "Recent Documents (Windows & macOS)\nWindows and macOS provide access to a list of recent documents opened by\nthe application via JumpList or dock menu, respectively.\nJumpList:\n\nApplication dock menu:\n\nTo add a file to recent documents, you can use the\napp.addRecentDocument API:\nconst { app } = require('electron')\napp.addRecentDocument('/Users/USERNAME/Desktop/work.type')\nAnd you can use app.clearRecentDocuments API to empty\nthe recent documents list:\nconst { app } = require('electron')\napp.clearRecentDocuments()\n\n\nWindows Notes\nIn order to be able to use this feature on Windows, your application has to be\nregistered as a handler of the file type of the document, otherwise the file\nwon't appear in JumpList even after you have added it. You can find everything\non registering your application in Application Registration.\nWhen a user clicks a file from the JumpList, a new instance of your application\nwill be started with the path of the file added as a command line argument.\n\n\nmacOS Notes\nWhen a file is requested from the recent documents menu, the open-file event\nof app module will be emitted for it.\n" + }, + { + "type": "tutorial", + "title": "Releasing", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/releasing.md", + "url": "https://electronjs.org/docs/tutorial/releasing", + "slug": "releasing", + "body": "Releasing\nThis document describes the process for releasing a new version of Electron.\n\n\nDetermine which branch to release from\n\nIf releasing beta, run the scripts below from master.\nIf releasing a stable version, run the scripts below from the branch\nyou're stabilizing.\n\n\n\nFind out what version change is needed\nRun npm run prepare-release -- --notesOnly to view auto generated release\nnotes. The notes generated should help you determine if this is a major, minor,\npatch, or beta version change. Read the\nVersion Change Rules for more information.\nNB: If releasing from a branch, e.g. 1-8-x, check out the branch with\ngit checkout 1-8-x rather than git checkout -b remotes/origin/1-8-x.\nThe scripts need git rev-parse --abbrev-ref HEAD to return a short name,\ne.g. no remotes/origin/\n\n\nSet your tokens and environment variables\nYou'll need Electron S3 credentials in order to create and\nupload an Electron release. Contact a team member for more\ninformation.\nThere are a handful of *_TOKEN environment variables needed by the release\nscripts. Once you've generated these per-user tokens, you may want to keep\nthem in a local file that you can source when starting a release.\n\nELECTRON_GITHUB_TOKEN:\nCreate as described at https://github.com/settings/tokens/new,\ngiving the token repo access scope.\nAPPVEYOR_TOKEN:\nCreate a token from https://windows-ci.electronjs.org/api-token\nIf you don't have an account, ask a team member to add you.\nCIRCLE_TOKEN:\nCreate a token from \"Personal API Tokens\" at https://circleci.com/account/api\n\n\n\nRun the prepare-release script\nThe prepare release script will do the following:\n1. Check if a release is already in process and if so it will halt.\n2. Create a release branch.\n3. Bump the version number in several files. See this bump commit for an example.\n4. Create a draft release on GitHub with auto-generated release notes.\n5. Push the release branch.\n6. Call the APIs to run the release builds.\nOnce you have determined which type of version change is needed, run the\nprepare-release script with arguments according to your need:\n\n[major|minor|patch|beta] to increment one of the version numbers, or\n--stable to indicate this is a stable version\n\nFor example:\n\n\nMajor version change\nnpm run prepare-release -- major\n\n\nMinor version change\nnpm run prepare-release -- minor\n\n\nPatch version change\nnpm run prepare-release -- patch\n\n\nBeta version change\nnpm run prepare-release -- beta\n\n\nPromote beta to stable\nnpm run prepare-release -- --stable\nTip: You can test the new version number before running prepare-release with\na dry run of the bump-version script with the same major/minor/patch/beta\narguments, e.g.:\n$ ./script/bump-version.py --bump minor --dry-run\n\n\nWait for builds :hourglass_flowing_sand:\nThe prepare-release script will trigger the builds via API calls.\nTo monitor the build progress, see the following pages:\n\ncircleci.com/gh/electron/electron for OS X and Linux\nwindows-ci.electronjs.org/project/AppVeyor/electron for Windows\n\n\n\nCompile release notes\nWriting release notes is a good way to keep yourself busy while the builds are running.\nFor prior art, see existing releases on the releases page.\nTips:\n\nEach listed item should reference a PR on electron/electron, not an issue, nor a PR from another repo like libcc.\nNo need to use link markup when referencing PRs. Strings like #123 will automatically be converted to links on github.com.\nTo see the version of Chromium, V8, and Node in every version of Electron, visit atom.io/download/electron/index.json.\n\n\n\nPatch releases\nFor a patch release, use the following format:\n## Bug Fixes\n\n* Fixed a cross-platform thing. #123\n\n### Linux\n\n* Fixed a Linux thing. #123\n\n### macOS\n\n* Fixed a macOS thing. #123\n\n### Windows\n\n* Fixed a Windows thing. #1234\n\n\nMinor releases\nFor a minor release, e.g. 1.8.0, use this format:\n## Upgrades\n\n- Upgraded from Node `oldVersion` to `newVersion`. #123\n\n## API Changes\n\n* Changed a thing. #123\n\n### Linux\n\n* Changed a Linux thing. #123\n\n### macOS\n\n* Changed a macOS thing. #123\n\n### Windows\n\n* Changed a Windows thing. #123\n\n\nMajor releases\n## Upgrades\n\n- Upgraded from Chromium `oldVersion` to `newVersion`. #123\n- Upgraded from Node `oldVersion` to `newVersion`. #123\n\n## Breaking API changes\n\n* Changed a thing. #123\n\n### Linux\n\n* Changed a Linux thing. #123\n\n### macOS\n\n* Changed a macOS thing. #123\n\n### Windows\n\n* Changed a Windows thing. #123\n\n## Other Changes\n\n- Some other change. #123\n\n\nBeta releases\nUse the same formats as the ones suggested above, but add the following note at\nthe beginning of the changelog:\n**Note:** This is a beta release and most likely will have have some\ninstability and/or regressions.\n\nPlease file new issues for any bugs you find in it.\n\nThis release is published to [npm](https://www.npmjs.com/package/electron)\nunder the `beta` tag and can be installed via `npm install electron@beta`.\n\n\nEdit the release draft\n\nVisit the releases page and you'll see a new draft release with placeholder\nrelease notes.\nEdit the release and add release notes.\nUncheck the prerelease checkbox if you're publishing a stable release;\nleave it checked for beta releases.\nClick 'Save draft'. Do not click 'Publish release'!\nWait for all builds to pass before proceeding.\nIn the release branch, verify that the release's files have been created:\n\n$ git rev-parse --abbrev-ref HEAD\nrelease\n$ npm run release -- --validateRelease\n\n\nMerge temporary branch (pre-2-0-x branches only)\nOnce the release builds have finished, merge the release branch back into\nthe source release branch using the merge-release script.\nIf the branch cannot be successfully merged back this script will automatically\nrebase the release branch and push the changes which will trigger the release\nbuilds again, which means you will need to wait for the release builds to run\nagain before proceeding.\n\n\nMerging back into master\nnpm run merge-release -- master\n\n\nMerging back into old release branch\nnpm run merge-release -- 1-7-x\n\n\nPublish the release\nOnce the merge has finished successfully, run the release script\nvia npm run release to finish the release process. This script will do the\nfollowing:\n1. Build the project to validate that the correct version number is being released.\n2. Download the binaries and generate the node headers and the .lib linker used\non Windows by node-gyp to build native modules.\n3. Create and upload the SHASUMS files stored on S3 for the node files.\n4. Create and upload the SHASUMS256.txt file stored on the GitHub release.\n5. Validate that all of the required files are present on GitHub and S3 and have\nthe correct checksums as specified in the SHASUMS files.\n6. Publish the release on GitHub\n7. Delete the release branch.\n\n\nPublish to npm\nBefore publishing to npm, you'll need to log into npm as Electron. Optionally,\nyou may find npmrc to be a useful way\nto keep Electron's profile side-by-side with your own:\n$ sudo npm install -g npmrc\n$ npmrc -c electron\nRemoving old .npmrc (default)\nActivating .npmrc \"electron\"\nThe Electron account's credentials are kept by GitHub.\n\"Electron - NPM\" for the URL \"https://www.npmjs.com/login\".\n$ npm login\nUsername: electron\nPassword:\nEmail: (this IS public) electron@github.com\nPublish the release to npm.\n$ npm whoami\nelectron\n$ npm run publish-to-npm\nNote: In general you should be using the latest Node during this\nprocess; however, older versions of the publish-to-npm script\nmay have trouble with Node 7 or higher. If you have trouble with\nthis in an older branch, try running with an older version of Node,\ne.g. a 6.x LTS.\n\n\nFix missing binaries of a release manually\nIn the case of a corrupted release with broken CI machines, we might have to\nre-upload the binaries for an already published release.\nThe first step is to go to the\nReleases page and delete the\ncorrupted binaries with the SHASUMS256.txt checksum file.\nThen manually create distributions for each platform and upload them:\n# Checkout the version to re-upload.\ngit checkout vTHE.RELEASE.VERSION\n\n# Do release build, specifying one target architecture.\n./script/bootstrap.py --target_arch [arm|x64|ia32]\n./script/build.py -c R\n./script/create-dist.py\n\n# Explicitly allow overwritting a published release.\n./script/upload.py --overwrite\nAfter re-uploading all distributions, publish again to upload the checksum\nfile:\nnpm run release\n" + }, + { + "type": "tutorial", + "title": "REPL", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/repl.md", + "url": "https://electronjs.org/docs/tutorial/repl", + "slug": "repl", + "body": "REPL\nRead-Eval-Print-Loop (REPL) is a simple, interactive computer programming\nenvironment that takes single user inputs (i.e. single expressions), evaluates\nthem, and returns the result to the user.\nThe repl module provides a REPL implementation that can be accessed using:\n\n\nAssuming you have electron or electron-prebuilt installed as a local\nproject dependency:\n./node_modules/.bin/electron --interactive\n\n\nAssuming you have electron or electron-prebuilt installed globally:\nelectron --interactive\n\n\nThis only creates a REPL for the main process. You can use the Console\ntab of the Dev Tools to get a REPL for the renderer processes.\nNote: electron --interactive is not available on Windows.\nMore information can be found in the Node.js REPL docs.\n" + }, + { + "type": "tutorial", + "title": "Represented File for macOS BrowserWindows", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/represented-file.md", + "url": "https://electronjs.org/docs/tutorial/represented-file", + "slug": "represented-file", + "body": "Represented File for macOS BrowserWindows\nOn macOS a window can set its represented file, so the file's icon can show in\nthe title bar and when users Command-Click or Control-Click on the title a path\npopup will show.\nYou can also set the edited state of a window so that the file icon can indicate\nwhether the document in this window has been modified.\nRepresented file popup menu:\n\nTo set the represented file of window, you can use the\nBrowserWindow.setRepresentedFilename and\nBrowserWindow.setDocumentEdited APIs:\nconst { BrowserWindow } = require('electron')\n\nconst win = new BrowserWindow()\nwin.setRepresentedFilename('/etc/passwd')\nwin.setDocumentEdited(true)\n" + }, + { + "type": "tutorial", + "title": "Security, Native Capabilities, and Your Responsibility", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/security.md", + "url": "https://electronjs.org/docs/tutorial/security", + "slug": "security", + "body": "Security, Native Capabilities, and Your Responsibility\nAs web developers, we usually enjoy the strong security net of the browser -\nthe risks associated with the code we write are relatively small. Our websites\nare granted limited powers in a sandbox, and we trust that our users enjoy a\nbrowser built by a large team of engineers that is able to quickly respond to\nnewly discovered security threats.\nWhen working with Electron, it is important to understand that Electron is not\na web browser. It allows you to build feature-rich desktop applications with\nfamiliar web technologies, but your code wields much greater power. JavaScript\ncan access the filesystem, user shell, and more. This allows you to build\nhigh quality native applications, but the inherent security risks scale with\nthe additional powers granted to your code.\nWith that in mind, be aware that displaying arbitrary content from untrusted\nsources poses a severe security risk that Electron is not intended to handle.\nIn fact, the most popular Electron apps (Atom, Slack, Visual Studio Code, etc)\ndisplay primarily local content (or trusted, secure remote content without Node\nintegration) – if your application executes code from an online source, it is\nyour responsibility to ensure that the code is not malicious.\n\n\nReporting Security Issues\nFor information on how to properly disclose an Electron vulnerability,\nsee SECURITY.md\n\n\nChromium Security Issues and Upgrades\nWhile Electron strives to support new versions of Chromium as soon as possible,\ndevelopers should be aware that upgrading is a serious undertaking - involving\nhand-editing dozens or even hundreds of files. Given the resources and\ncontributions available today, Electron will often not be on the very latest\nversion of Chromium, lagging behind by either days or weeks.\nWe feel that our current system of updating the Chromium component strikes an\nappropriate balance between the resources we have available and the needs of\nthe majority of applications built on top of the framework. We definitely are\ninterested in hearing more about specific use cases from the people that build\nthings on top of Electron. Pull requests and contributions supporting this\neffort are always very welcome.\n\n\nIgnoring Above Advice\nA security issue exists whenever you receive code from a remote destination and\nexecute it locally. As an example, consider a remote website being displayed\ninside a BrowserWindow. If an attacker somehow manages to\nchange said content (either by attacking the source directly, or by sitting\nbetween your app and the actual destination), they will be able to execute\nnative code on the user's machine.\n\n:warning: Under no circumstances should you load and execute remote code with\nNode.js integration enabled. Instead, use only local files (packaged together\nwith your application) to execute Node.js code. To display remote content, use\nthe webview tag and make sure to disable the nodeIntegration.\n\n\n\nElectron Security Warnings\nFrom Electron 2.0 on, developers will see warnings and recommendations printed\nto the developer console. They only show up when the binary's name is Electron,\nindicating that a developer is currently looking at the console.\nYou can force-enable or force-disable these warnings by setting\nELECTRON_ENABLE_SECURITY_WARNINGS or ELECTRON_DISABLE_SECURITY_WARNINGS on\neither process.env or the window object.\n\n\nChecklist: Security Recommendations\nThis is not bulletproof, but at the least, you should follow these steps to\nimprove the security of your application.\n\nOnly load secure content\nDisable the Node.js integration in all renderers that display remote content\nEnable context isolation in all renderers that display remote content\nUse ses.setPermissionRequestHandler() in all sessions that load remote content\nDo not disable webSecurity\nDefine a Content-Security-Policy and use restrictive rules (i.e. script-src 'self')\nOverride and disable eval, which allows strings to be executed as code.\nDo not set allowRunningInsecureContent to true\nDo not enable experimental features\nDo not use blinkFeatures\nWebViews: Do not use allowpopups\nWebViews: Verify the options and params of all tags\n\n\n\n1) Only Load Secure Content\nAny resources not included with your application should be loaded using a\nsecure protocol like HTTPS. In other words, do not use insecure protocols\nlike HTTP. Similarly, we recommend the use of WSS over WS, FTPS over\nFTP, and so on.\n\n\nWhy?\nHTTPS has three main benefits:\n1) It authenticates the remote server, ensuring your app connects to the correct\nhost instead of an impersonator.\n2) It ensures data integrity, asserting that the data was not modified while in\ntransit between your application and the host.\n3) It encrypts the traffic between your user and the destination host, making it\nmore difficult to eavesdrop on the information sent between your app and\nthe host.\n\n\nHow?\n// Bad\nbrowserWindow.loadURL('http://my-website.com')\n\n// Good\nbrowserWindow.loadURL('https://my-website.com')\n\n\n\n\n\n\n\n\n\n2) Disable Node.js Integration for Remote Content\nIt is paramount that you disable Node.js integration in any renderer\n(BrowserWindow, BrowserView, or\nWebView) that loads remote content. The goal is to limit the\npowers you grant to remote content, thus making it dramatically more difficult\nfor an attacker to harm your users should they gain the ability to execute\nJavaScript on your website.\nAfter this, you can grant additional permissions for specific hosts. For example,\nif you are opening a BrowserWindow pointed at `https://my-website.com/\", you can\ngive that website exactly the abilities it needs, but no more.\n\n\nWhy?\nA cross-site-scripting (XSS) attack is more dangerous if an attacker can jump\nout of the renderer process and execute code on the user's computer.\nCross-site-scripting attacks are fairly common - and while an issue, their\npower is usually limited to messing with the website that they are executed on.\nDisabling Node.js integration helps prevent an XSS from being escalated into a\nso-called \"Remote Code Execution\" (RCE) attack.\n\n\nHow?\n// Bad\nconst mainWindow = new BrowserWindow()\nmainWindow.loadURL('https://my-website.com')\n// Good\nconst mainWindow = new BrowserWindow({\n webPreferences: {\n nodeIntegration: false,\n preload: './preload.js'\n }\n})\n\nmainWindow.loadURL('https://my-website.com')\n\n\n\n\n\nWhen disabling Node.js integration, you can still expose APIs to your website that\ndo consume Node.js modules or features. Preload scripts continue to have access\nto require and other Node.js features, allowing developers to expose a custom\nAPI to remotely loaded content.\nIn the following example preload script, the later loaded website will have\naccess to a window.readConfig() method, but no Node.js features.\nconst { readFileSync } = require('fs')\n\nwindow.readConfig = function () {\n const data = readFileSync('./config.json')\n return data\n}\n\n\n3) Enable Context Isolation for Remote Content\nContext isolation is an Electron feature that allows developers to run code\nin preload scripts and in Electron APIs in a dedicated JavaScript context. In\npractice, that means that global objects like Array.prototype.push or\nJSON.parse cannot be modified by scripts running in the renderer process.\nElectron uses the same technology as Chromium's Content Scripts\nto enable this behavior.\n\n\nWhy?\nContext isolation allows each the scripts on running in the renderer to make\nchanges to its JavaScript environment without worrying about conflicting with\nthe scripts in the Electron API or the preload script.\nWhile still an experimental Electron feature, context isolation adds an\nadditional layer of security. It creates a new JavaScript world for Electron\nAPIs and preload scripts.\nAt the same time, preload scripts still have access to the document and\nwindow objects. In other words, you're getting a decent return on a likely\nvery small investment.\n\n\nHow?\n// Main process\nconst mainWindow = new BrowserWindow({\n webPreferences: {\n contextIsolation: true,\n preload: 'preload.js'\n }\n})\n// Preload script\n\n// Set a variable in the page before it loads\nwebFrame.executeJavaScript('window.foo = \"foo\";')\n\n// The loaded page will not be able to access this, it is only available\n// in this context\nwindow.bar = 'bar'\n\ndocument.addEventListener('DOMContentLoaded', () => {\n // Will log out 'undefined' since window.foo is only available in the main\n // context\n console.log(window.foo)\n\n // Will log out 'bar' since window.bar is available in this context\n console.log(window.bar)\n})\n\n\n4) Handle Session Permission Requests From Remote Content\nYou may have seen permission requests while using Chrome: They pop up whenever\nthe website attempts to use a feature that the user has to manually approve (\nlike notifications).\nThe API is based on the Chromium permissions API\nand implements the same types of permissions.\n\n\nWhy?\nBy default, Electron will automatically approve all permission requests unless\nthe developer has manually configured a custom handler. While a solid default,\nsecurity-conscious developers might want to assume the very opposite.\n\n\nHow?\nconst { session } = require('electron')\n\nsession\n .fromPartition('some-partition')\n .setPermissionRequestHandler((webContents, permission, callback) => {\n const url = webContents.getURL()\n\n if (permission === 'notifications') {\n // Approves the permissions request\n callback(true)\n }\n\n if (!url.startsWith('https://my-website.com')) {\n // Denies the permissions request\n return callback(false)\n }\n })\n\n\n5) Do Not Disable WebSecurity\nRecommendation is Electron's default\nYou may have already guessed that disabling the webSecurity property on a\nrenderer process (BrowserWindow,\nBrowserView, or WebView) disables crucial\nsecurity features.\nDo not disable webSecurity in production applications.\n\n\nWhy?\nDisabling webSecurity will disable the same-origin policy and set\nallowRunningInsecureContent property to true. In other words, it allows\nthe execution of insecure code from different domains.\n\n\nHow?\n// Bad\nconst mainWindow = new BrowserWindow({\n webPreferences: {\n webSecurity: false\n }\n})\n// Good\nconst mainWindow = new BrowserWindow()\n\n\n\n\n\n\n\n6) Define a Content Security Policy\nA Content Security Policy (CSP) is an additional layer of protection against\ncross-site-scripting attacks and data injection attacks. We recommend that they\nbe enabled by any website you load inside Electron.\n\n\nWhy?\nCSP allows the server serving content to restrict and control the resources\nElectron can load for that given web page. https://your-page.com should\nbe allowed to load scripts from the origins you defined while scripts from\nhttps://evil.attacker.com should not be allowed to run. Defining a CSP is an\neasy way to improve your applications security.\n\n\nHow?\nElectron respects the Content-Security-Policy HTTP header\nand the respective tag.\nThe following CSP will allow Electron to execute scripts from the current\nwebsite and from apis.mydomain.com.\n// Bad\nContent-Security-Policy: '*'\n\n// Good\nContent-Security-Policy: script-src 'self' https://apis.mydomain.com\n\n\n7) Override and Disable eval\neval() is a core JavaScript method that allows the execution of JavaScript\nfrom a string. Disabling it disables your app's ability to evaluate JavaScript\nthat is not known in advance.\n\n\nWhy?\nThe eval() method has precisely one mission: To evaluate a series of\ncharacters as JavaScript and execute it. It is a required method whenever you\nneed to evaluate code that is not known ahead of time. While legitimate use\ncases exist, like any other code generators, eval() is difficult to harden.\nGenerally speaking, it is easier to completely disable eval() than to make\nit bulletproof. Thus, if you do not need it, it is a good idea to disable it.\n\n\nHow?\n// ESLint will warn about any use of eval(), even this one\n// eslint-disable-next-line\nwindow.eval = global.eval = function () {\n throw new Error(`Sorry, this app does not support window.eval().`)\n}\n\n\n8) Do Not Set allowRunningInsecureContent to true\nRecommendation is Electron's default\nBy default, Electron will not allow websites loaded over HTTPS to load and\nexecute scripts, CSS, or plugins from insecure sources (HTTP). Setting the\nproperty allowRunningInsecureContent to true disables that protection.\nLoading the initial HTML of a website over HTTPS and attempting to load\nsubsequent resources via HTTP is also known as \"mixed content\".\n\n\nWhy?\nLoading content over HTTPS assures the authenticity and integrity\nof the loaded resources while encrypting the traffic itself. See the section on\nonly displaying secure content for more details.\n\n\nHow?\n// Bad\nconst mainWindow = new BrowserWindow({\n webPreferences: {\n allowRunningInsecureContent: true\n }\n})\n// Good\nconst mainWindow = new BrowserWindow({})\n\n\n9) Do Not Enable Experimental Features\nRecommendation is Electron's default\nAdvanced users of Electron can enable experimental Chromium features using the\nexperimentalFeatures and experimentalCanvasFeatures properties.\n\n\nWhy?\nExperimental features are, as the name suggests, experimental and have not been\nenabled for all Chromium users. Furthermore, their impact on Electron as a whole\nhas likely not been tested.\nLegitimate use cases exist, but unless you know what you are doing, you should\nnot enable this property.\n\n\nHow?\n// Bad\nconst mainWindow = new BrowserWindow({\n webPreferences: {\n experimentalFeatures: true\n }\n})\n// Good\nconst mainWindow = new BrowserWindow({})\n\n\n10) Do Not Use blinkFeatures\nRecommendation is Electron's default\nBlink is the name of the rendering engine behind Chromium. As with\nexperimentalFeatures, the blinkFeatures property allows developers to\nenable features that have been disabled by default.\n\n\nWhy?\nGenerally speaking, there are likely good reasons if a feature was not enabled\nby default. Legitimate use cases for enabling specific features exist. As a\ndeveloper, you should know exactly why you need to enable a feature, what the\nramifications are, and how it impacts the security of your application. Under\nno circumstances should you enable features speculatively.\n\n\nHow?\n// Bad\nconst mainWindow = new BrowserWindow({\n webPreferences: {\n blinkFeatures: ['ExecCommandInJavaScript']\n }\n})\n// Good\nconst mainWindow = new BrowserWindow()\n\n\n11) Do Not Use allowpopups\nRecommendation is Electron's default\nIf you are using WebViews, you might need the pages and scripts\nloaded in your tag to open new windows. The allowpopups attribute\nenables them to create new BrowserWindows using the\nwindow.open() method. WebViews are otherwise not allowed to create new\nwindows.\n\n\nWhy?\nIf you do not need popups, you are better off not allowing the creation of\nnew BrowserWindows by default. This follows the principle\nof minimally required access: Don't let a website create new popups unless\nyou know it needs that feature.\n\n\nHow?\n\n\n\n\n\n\n\n12) Verify WebView Options Before Creation\nA WebView created in a renderer process that does not have Node.js integration\nenabled will not be able to enable integration itself. However, a WebView will\nalways create an independent renderer process with its own webPreferences.\nIt is a good idea to control the creation of new WebViews from\nthe main process and to verify that their webPreferences do not disable\nsecurity features.\n\n\nWhy?\nSince WebViews live in the DOM, they can be created by a script running on your\nwebsite even if Node.js integration is otherwise disabled.\nElectron enables developers to disable various security features that control\na renderer process. In most cases, developers do not need to disable any of\nthose features - and you should therefore not allow different configurations\nfor newly created tags.\n\n\nHow?\nBefore a tag is attached, Electron will fire the\nwill-attach-webview event on the hosting webContents. Use the event to\nprevent the creation of WebViews with possibly insecure options.\napp.on('web-contents-created', (event, contents) => {\n contents.on('will-attach-webview', (event, webPreferences, params) => {\n // Strip away preload scripts if unused or verify their location is legitimate\n delete webPreferences.preload\n delete webPreferences.preloadURL\n\n // Disable Node.js integration\n webPreferences.nodeIntegration = false\n\n // Verify URL being loaded\n if (!params.src.startsWith('https://yourapp.com/')) {\n event.preventDefault()\n }\n })\n})\nAgain, this list merely minimizes the risk, it does not remove it. If your goal\nis to display a website, a browser will be a more secure option.\n" + }, + { + "type": "tutorial", + "title": "Setting Up Symbol Server in Debugger", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/setting-up-symbol-server.md", + "url": "https://electronjs.org/docs/tutorial/setting-up-symbol-server", + "slug": "setting-up-symbol-server", + "body": "Setting Up Symbol Server in Debugger\nDebug symbols allow you to have better debugging sessions. They have information\nabout the functions contained in executables and dynamic libraries and provide\nyou with information to get clean call stacks. A Symbol Server allows the\ndebugger to load the correct symbols, binaries and sources automatically without\nforcing users to download large debugging files. The server functions like\nMicrosoft's symbol server so the\ndocumentation there can be useful.\nNote that because released Electron builds are heavily optimized, debugging is\nnot always easy. The debugger will not be able to show you the content of all\nvariables and the execution path can seem strange because of inlining, tail\ncalls, and other compiler optimizations. The only workaround is to build an\nunoptimized local build.\nThe official symbol server URL for Electron is\nhttps://electron-symbols.githubapp.com.\nYou cannot visit this URL directly, you must add it to the symbol path of your\ndebugging tool. In the examples below, a local cache directory is used to avoid\nrepeatedly fetching the PDB from the server. Replace c:\\code\\symbols with an\nappropriate cache directory on your machine.\n\n\nUsing the Symbol Server in Windbg\nThe Windbg symbol path is configured with a string value delimited with asterisk\ncharacters. To use only the Electron symbol server, add the following entry to\nyour symbol path (Note: you can replace c:\\code\\symbols with any writable\ndirectory on your computer, if you'd prefer a different location for downloaded\nsymbols):\nSRV*c:\\code\\symbols\\*https://electron-symbols.githubapp.com\nSet this string as _NT_SYMBOL_PATH in the environment, using the Windbg menus,\nor by typing the .sympath command. If you would like to get symbols from\nMicrosoft's symbol server as well, you should list that first:\nSRV*c:\\code\\symbols\\*https://msdl.microsoft.com/download/symbols;SRV*c:\\code\\symbols\\*https://electron-symbols.githubapp.com\n\n\nUsing the symbol server in Visual Studio\n\n\n\n\nTroubleshooting: Symbols will not load\nType the following commands in Windbg to print why symbols are not loading:\n> !sym noisy\n> .reload /f electron.exe\n" + }, + { + "type": "tutorial", + "title": "Snapcraft Guide (Ubuntu Software Center & More)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/snapcraft.md", + "url": "https://electronjs.org/docs/tutorial/snapcraft", + "slug": "snapcraft", + "body": "Snapcraft Guide (Ubuntu Software Center & More)\nThis guide provides information on how to package your Electron application\nfor any Snapcraft environment, including the Ubuntu Software Center.\n\n\nBackground and Requirements\nTogether with the broader Linux community, Canonical aims to fix many of the\ncommon software installation problems with the snapcraft\nproject. Snaps are containerized software packages that include required\ndependencies, auto-update, and work on all major Linux distributions without\nsystem modification.\nThere are three ways to create a .snap file:\n1) Using electron-forge or\nelectron-builder, both tools that come with snap\nsupport out of the box. This is the easiest option.\n2) Using electron-installer-snap, which takes electron-packager's output.\n3) Using an already created .deb package.\nIn all cases, you will need to have the snapcraft tool installed. We\nrecommend building on Ubuntu 16.04 (or the current LTS).\nsnap install snapcraft --classic\nWhile it is possible to install snapcraft on macOS using Homebrew, it\nis not able to build snap packages and is focused on managing packages\nin the store.\n\n\nUsing electron-installer-snap\nThe module works like electron-winstaller and similar\nmodules in that its scope is limited to building snap packages. You can install\nit with:\nnpm install --save-dev electron-installer-snap\n\n\nStep 1: Package Your Electron Application\nPackage the application using electron-packager (or a\nsimilar tool). Make sure to remove node_modules that you don't need in your\nfinal application, since any module you don't actually need will increase\nyour application's size.\nThe output should look roughly like this:\n.\n└── dist\n └── app-linux-x64\n ├── LICENSE\n ├── LICENSES.chromium.html\n ├── content_shell.pak\n ├── app\n ├── icudtl.dat\n ├── libgcrypt.so.11\n ├── libnode.so\n ├── locales\n ├── natives_blob.bin\n ├── resources\n ├── snapshot_blob.bin\n └── version\n\n\nStep 2: Running electron-installer-snap\nFrom a terminal that has snapcraft in its PATH, run electron-installer-snap\nwith the only required parameter --src, which is the location of your packaged\nElectron application created in the first step.\nnpx electron-installer-snap --src=out/myappname-linux-x64\nIf you have an existing build pipeline, you can use electron-installer-snap\nprogrammatically. For more information, see the Snapcraft API docs.\nconst snap = require('electron-installer-snap')\n\nsnap(options)\n .then(snapPath => console.log(`Created snap at ${snapPath}!`))\n\n\nUsing an Existing Debian Package\nSnapcraft is capable of taking an existing .deb file and turning it into\na .snap file. The creation of a snap is configured using a snapcraft.yaml\nfile that describes the sources, dependencies, description, and other core\nbuilding blocks.\n\n\nStep 1: Create a Debian Package\nIf you do not already have a .deb package, using electron-installer-snap\nmight be an easier path to create snap packages. However, multiple solutions\nfor creating Debian packages exist, including electron-forge,\nelectron-builder or\nelectron-installer-debian.\n\n\nStep 2: Create a snapcraft.yaml\nFor more information on the available configuration options, see the\ndocumentation on the snapcraft syntax.\nLet's look at an example:\nname: myApp\nversion: '2.0.0'\nsummary: A little description for the app.\ndescription: |\n You know what? This app is amazing! It does all the things\n for you. Some say it keeps you young, maybe even happy.\n\ngrade: stable\nconfinement: classic\n\nparts:\n slack:\n plugin: dump\n source: my-deb.deb\n source-type: deb\n after:\n - desktop-gtk3\n stage-packages:\n - libasound2\n - libgconf2-4\n - libnotify4\n - libnspr4\n - libnss3\n - libpcre3\n - libpulse0\n - libxss1\n - libxtst6\n electron-launch:\n plugin: dump\n source: files/\n prepare: |\n chmod +x bin/electron-launch\n\napps:\n myApp:\n command: bin/electron-launch $SNAP/usr/lib/myApp/myApp\n desktop: usr/share/applications/myApp.desktop\n # Correct the TMPDIR path for Chromium Framework/Electron to ensure\n # libappindicator has readable resources.\n environment:\n TMPDIR: $XDG_RUNTIME_DIR\nAs you can see, the snapcraft.yaml instructs the system to launch a file\ncalled electron-launch. In this example, it passes information on to the\napp's binary:\n#!/bin/sh\n\nexec \"$@\" --executed-from=\"$(pwd)\" --pid=$$ > /dev/null 2>&1 &\nAlternatively, if you're building your snap with strict confinement, you\ncan use the desktop-launch command:\napps:\n myApp:\n # Correct the TMPDIR path for Chromium Framework/Electron to ensure\n # libappindicator has readable resources.\n command: env TMPDIR=$XDG_RUNTIME_DIR PATH=/usr/local/bin:${PATH} ${SNAP}/bin/desktop-launch $SNAP/myApp/desktop\n desktop: usr/share/applications/desktop.desktop\n" + }, + { + "type": "tutorial", + "title": "Source Code Directory Structure", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/source-code-directory-structure.md", + "url": "https://electronjs.org/docs/tutorial/source-code-directory-structure", + "slug": "source-code-directory-structure", + "body": "Source Code Directory Structure\nThe source code of Electron is separated into a few parts, mostly\nfollowing Chromium on the separation conventions.\nYou may need to become familiar with Chromium's multi-process\narchitecture\nto understand the source code better.\n\n\nStructure of Source Code\nElectron\n├── atom/ - C++ source code.\n| ├── app/ - System entry code.\n| ├── browser/ - The frontend including the main window, UI, and all of the\n| | main process things. This talks to the renderer to manage web pages.\n| | ├── ui/ - Implementation of UI stuff for different platforms.\n| | | ├── cocoa/ - Cocoa specific source code.\n| | | ├── win/ - Windows GUI specific source code.\n| | | └── x/ - X11 specific source code.\n| | ├── api/ - The implementation of the main process APIs.\n| | ├── net/ - Network related code.\n| | ├── mac/ - Mac specific Objective-C source code.\n| | └── resources/ - Icons, platform-dependent files, etc.\n| ├── renderer/ - Code that runs in renderer process.\n| | └── api/ - The implementation of renderer process APIs.\n| └── common/ - Code that used by both the main and renderer processes,\n| including some utility functions and code to integrate node's message\n| loop into Chromium's message loop.\n| └── api/ - The implementation of common APIs, and foundations of\n| Electron's built-in modules.\n├── brightray/ - Thin shim over libcc that makes it easier to use.\n├── chromium_src/ - Source code copied from Chromium. See below.\n├── default_app/ - The default page to show when Electron is started without\n| providing an app.\n├── docs/ - Documentations.\n├── lib/ - JavaScript source code.\n| ├── browser/ - Javascript main process initialization code.\n| | └── api/ - Javascript API implementation.\n| ├── common/ - JavaScript used by both the main and renderer processes\n| | └── api/ - Javascript API implementation.\n| └── renderer/ - Javascript renderer process initialization code.\n| └── api/ - Javascript API implementation.\n├── spec/ - Automatic tests.\n├── electron.gyp - Building rules of Electron.\n└── common.gypi - Compiler specific settings and building rules for other\n components like `node` and `breakpad`.\n\n\n/chromium_src\nThe files in /chromium_src tend to be pieces of Chromium that aren't part of\nthe content layer. For example to implement Pepper API, we need some wiring\nsimilar to what official Chrome does. We could have built the relevant\nsources as a part of libcc but most\noften we don't require all the features (some tend to be proprietary,\nanalytics stuff) so we took parts of the code. These could have easily\nbeen patches in libcc, but at the time when these were written the goal of\nlibcc was to maintain very minimal patches and chromium_src changes tend to be\nbig ones. Also, note that these patches can never be upstreamed unlike other\nlibcc patches we maintain now.\n\n\nStructure of Other Directories\n\nscript - Scripts used for development purpose like building, packaging,\ntesting, etc.\ntools - Helper scripts used by gyp files, unlike script, scripts put\nhere should never be invoked by users directly.\nvendor - Source code of third party dependencies, we didn't use\nthird_party as name because it would confuse it with the same directory in\nChromium's source code tree.\nnode_modules - Third party node modules used for building.\nout - Temporary output directory of ninja.\ndist - Temporary directory created by script/create-dist.py script\nwhen creating a distribution.\nexternal_binaries - Downloaded binaries of third-party frameworks which\ndo not support building with gyp.\n\n\n\nKeeping Git Submodules Up to Date\nThe Electron repository has a few vendored dependencies, found in the\n/vendor directory. Occasionally you might see a message like this\nwhen running git status:\n$ git status\n\n\tmodified: vendor/libchromiumcontent (new commits)\n\tmodified: vendor/node (new commits)\nTo update these vendored dependencies, run the following command:\ngit submodule update --init --recursive\nIf you find yourself running this command often, you can create an alias for it\nin your ~/.gitconfig file:\n[alias]\n\tsu = submodule update --init --recursive\n" + }, + { + "type": "tutorial", + "title": "Electron Documentation Styleguide", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/styleguide.md", + "url": "https://electronjs.org/docs/tutorial/styleguide", + "slug": "styleguide", + "body": "Electron Documentation Styleguide\nThese are the guidelines for writing Electron documentation.\n\n\nTitles\n\nEach page must have a single #-level title at the top.\nChapters in the same page must have ##-level titles.\nSub-chapters need to increase the number of # in the title according to\ntheir nesting depth.\nAll words in the page's title must be capitalized, except for conjunctions\nlike \"of\" and \"and\" .\nOnly the first word of a chapter title must be capitalized.\n\nUsing Quick Start as example:\n# Quick Start\n\n...\n\n## Main process\n\n...\n\n## Renderer process\n\n...\n\n## Run your app\n\n...\n\n### Run as a distribution\n\n...\n\n### Manually downloaded Electron binary\n\n...\nFor API references, there are exceptions to this rule.\n\n\nMarkdown rules\n\nUse sh instead of cmd in code blocks (due to the syntax highlighter).\nLines should be wrapped at 80 columns.\nNo nesting lists more than 2 levels (due to the markdown renderer).\nAll js and javascript code blocks are linted with\nstandard-markdown.\n\n\n\nPicking words\n\nUse \"will\" over \"would\" when describing outcomes.\nPrefer \"in the ___ process\" over \"on\".\n\n\n\nAPI references\nThe following rules only apply to the documentation of APIs.\n\n\nPage title\nEach page must use the actual object name returned by require('electron')\nas the title, such as BrowserWindow, autoUpdater, and session.\nUnder the page title must be a one-line description starting with >.\nUsing session as example:\n# session\n\n> Manage browser sessions, cookies, cache, proxy settings, etc.\n\n\nModule methods and events\nFor modules that are not classes, their methods and events must be listed under\nthe ## Methods and ## Events chapters.\nUsing autoUpdater as an example:\n# autoUpdater\n\n## Events\n\n### Event: 'error'\n\n## Methods\n\n### `autoUpdater.setFeedURL(url[, requestHeaders])`\n\n\nClasses\n\nAPI classes or classes that are part of modules must be listed under a\n## Class: TheClassName chapter.\nOne page can have multiple classes.\nConstructors must be listed with ###-level titles.\nStatic Methods must be listed under a ### Static Methods chapter.\nInstance Methods must be listed under an ### Instance Methods chapter.\n\nAll methods that have a return value must start their description with \"Returns [TYPE] - Return description\"\n\nIf the method returns an Object, its structure can be specified using a colon followed by a newline then an unordered list of properties in the same style as function parameters.\n\n\nInstance Events must be listed under an ### Instance Events chapter.\n\nInstance Properties must be listed under an ### Instance Properties chapter.\n\nInstance properties must start with \"A [Property Type] ...\"\n\n\n\nUsing the Session and Cookies classes as an example:\n# session\n\n## Methods\n\n### session.fromPartition(partition)\n\n## Properties\n\n### session.defaultSession\n\n## Class: Session\n\n### Instance Events\n\n#### Event: 'will-download'\n\n### Instance Methods\n\n#### `ses.getCacheSize(callback)`\n\n### Instance Properties\n\n#### `ses.cookies`\n\n## Class: Cookies\n\n### Instance Methods\n\n#### `cookies.get(filter, callback)`\n\n\nMethods\nThe methods chapter must be in the following form:\n### `objectName.methodName(required[, optional]))`\n\n* `required` String - A parameter description.\n* `optional` Integer (optional) - Another parameter description.\n\n...\nThe title can be ### or ####-levels depending on whether it is a method of\na module or a class.\nFor modules, the objectName is the module's name. For classes, it must be the\nname of the instance of the class, and must not be the same as the module's\nname.\nFor example, the methods of the Session class under the session module must\nuse ses as the objectName.\nThe optional arguments are notated by square brackets [] surrounding the optional argument\nas well as the comma required if this optional argument follows another\nargument:\nrequired[, optional]\nBelow the method is more detailed information on each of the arguments. The type\nof argument is notated by either the common types:\n\nString\nNumber\nObject\nArray\nBoolean\nOr a custom type like Electron's WebContent\n\nIf an argument or a method is unique to certain platforms, those platforms are\ndenoted using a space-delimited italicized list following the datatype. Values\ncan be macOS, Windows or Linux.\n* `animate` Boolean (optional) _macOS_ _Windows_ - Animate the thing.\nArray type arguments must specify what elements the array may include in\nthe description below.\nThe description for Function type arguments should make it clear how it may be\ncalled and list the types of the parameters that will be passed to it.\n\n\nEvents\nThe events chapter must be in following form:\n### Event: 'wake-up'\n\nReturns:\n\n* `time` String\n\n...\nThe title can be ### or ####-levels depending on whether it is an event of\na module or a class.\nThe arguments of an event follow the same rules as methods.\n\n\nProperties\nThe properties chapter must be in following form:\n### session.defaultSession\n\n...\nThe title can be ### or ####-levels depending on whether it is a property of\na module or a class.\n\n\nDocumentation Translations\nSee electron/i18n\n" + }, + { + "type": "tutorial", + "title": "Electron Support", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/support.md", + "url": "https://electronjs.org/docs/tutorial/support", + "slug": "support", + "body": "Electron Support\n\n\nFinding Support\nIf you have a security concern,\nplease see the security document.\nIf you're looking for programming help,\nfor answers to questions,\nor to join in discussion with other developers who use Electron,\nyou can interact with the community in these locations:\n\nelectron category on the Atom\nforums\n#atom-shell channel on Freenode\nElectron channel on Atom's Slack\nelectron-ru (Russian)\nelectron-br (Brazilian Portuguese)\nelectron-kr (Korean)\nelectron-jp (Japanese)\nelectron-tr (Turkish)\nelectron-id (Indonesia)\nelectron-pl (Poland)\n\nIf you'd like to contribute to Electron,\nsee the contributing document.\nIf you've found a bug in a supported version of Electron,\nplease report it with the issue tracker.\nawesome-electron\nis a community-maintained list of useful example apps,\ntools and resources.\n\n\nSupported Versions\nThe latest three release branches are supported by the Electron team.\nFor example, if the latest release is 2.0.x, then the 2-0-x series\nis supported, as are the two previous release series 1-7-x and 1-8-x.\nWhen a release branch reaches the end of its support cycle, the series\nwill be deprecated in NPM and a final end-of-support release will be\nmade. This release will add a warning to inform that an unsupported\nversion of Electron is in use.\nThese steps are to help app developers learn when a branch they're\nusing becomes unsupported, but without being excessively intrusive\nto end users.\nIf an application has exceptional circumstances and needs to stay\non an unsupported series of Electron, developers can silence the\nend-of-support warning by omitting the final release from the app's\npackage.json devDependencies. For example, since the 1-6-x series\nended with an end-of-support 1.6.18 release, developers could choose\nto stay in the 1-6-x series without warnings with devDependency of\n\"electron\": 1.6.0 - 1.6.17.\n\n\nSupported Platforms\nFollowing platforms are supported by Electron:\n\n\nmacOS\nOnly 64bit binaries are provided for macOS, and the minimum macOS version\nsupported is macOS 10.9.\n\n\nWindows\nWindows 7 and later are supported, older operating systems are not supported\n(and do not work).\nBoth ia32 (x86) and x64 (amd64) binaries are provided for Windows.\nRunning Electron apps on Windows for ARM devices is possible by using the\nia32 binary.\n\n\nLinux\nThe prebuilt ia32 (i686) and x64 (amd64) binaries of Electron are built on\nUbuntu 12.04, the armv7l binary is built against ARM v7 with hard-float ABI and\nNEON for Debian Wheezy.\nUntil the release of Electron 2.0, Electron will also\ncontinue to release the armv7l binary with a simple arm suffix. Both binaries\nare identical.\nWhether the prebuilt binary can run on a distribution depends on whether the\ndistribution includes the libraries that Electron is linked to on the building\nplatform, so only Ubuntu 12.04 is guaranteed to work, but following platforms\nare also verified to be able to run the prebuilt binaries of Electron:\n\nUbuntu 12.04 and newer\nFedora 21\nDebian 8\n\n" + }, + { + "type": "tutorial", + "title": "Testing", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/testing.md", + "url": "https://electronjs.org/docs/tutorial/testing", + "slug": "testing", + "body": "Testing\nWe aim to keep the code coverage of Electron high. We ask that all pull\nrequest not only pass all existing tests, but ideally also add new tests\nto cover changed code and new scenarios. Ensuring that we capture as\nmany code paths and use cases of Electron as possible ensures that we\nall ship apps with fewer bugs.\nThis repository comes with linting rules for both JavaScript and C++ –\nas well as unit and integration tests. To learn more about Electron's\ncoding style, please see the coding-style document.\n\n\nLinting\nTo ensure that your JavaScript is in compliance with the Electron coding\nstyle, run npm run lint-js, which will run standard against both\nElectron itself as well as the unit tests. If you are using an editor\nwith a plugin/addon system, you might want to use one of the many\nStandardJS addons to be informed of coding style\nviolations before you ever commit them.\nTo run standard with parameters, run npm run lint-js -- followed by\narguments you want passed to standard.\nTo ensure that your C++ is in compliance with the Electron coding style,\nrun npm run lint-cpp, which runs a cpplint script. We recommend that\nyou use clang-format and prepared a short tutorial.\nThere is not a lot of Python in this repository, but it too is governed\nby coding style rules. npm run lint-py will check all Python, using\npylint to do so.\n\n\nUnit Tests\nTo run all unit tests, run npm run test. The unit tests are an Electron\napp (surprise!) that can be found in the spec folder. Note that it has\nits own package.json and that its dependencies are therefore not defined\nin the top-level package.json.\nTo run only specific tests matching a pattern, run npm run test -- -g=PATTERN, replacing the PATTERN with a regex that matches the tests\nyou would like to run. As an example: If you want to run only IPC tests, you\nwould run npm run test -- -g ipc.\n" + }, + { + "type": "tutorial", + "title": "Testing on Headless CI Systems (Travis CI, Jenkins)", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/testing-on-headless-ci.md", + "url": "https://electronjs.org/docs/tutorial/testing-on-headless-ci", + "slug": "testing-on-headless-ci", + "body": "Testing on Headless CI Systems (Travis CI, Jenkins)\nBeing based on Chromium, Electron requires a display driver to function.\nIf Chromium can't find a display driver, Electron will fail to launch -\nand therefore not executing any of your tests, regardless of how you are running\nthem. Testing Electron-based apps on Travis, Circle, Jenkins or similar Systems\nrequires therefore a little bit of configuration. In essence, we need to use\na virtual display driver.\n\n\nConfiguring the Virtual Display Server\nFirst, install Xvfb.\nIt's a virtual framebuffer, implementing the X11 display server protocol -\nit performs all graphical operations in memory without showing any screen output,\nwhich is exactly what we need.\nThen, create a virtual xvfb screen and export an environment variable\ncalled DISPLAY that points to it. Chromium in Electron will automatically look\nfor $DISPLAY, so no further configuration of your app is required.\nThis step can be automated with Paul Betts's\nxvfb-maybe: Prepend your test\ncommands with xvfb-maybe and the little tool will automatically configure\nxvfb, if required by the current system. On Windows or macOS, it will\ndo nothing.\n## On Windows or macOS, this invokes electron-mocha\n## On Linux, if we are in a headless environment, this will be equivalent\n## to xvfb-run electron-mocha ./test/*.js\nxvfb-maybe electron-mocha ./test/*.js\n\n\nTravis CI\nOn Travis, your .travis.yml should look roughly like this:\naddons:\n apt:\n packages:\n - xvfb\n\ninstall:\n - export DISPLAY=':99.0'\n - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &\n\n\nJenkins\nFor Jenkins, a Xvfb plugin is available.\n\n\nCircle CI\nCircle CI is awesome and has xvfb and $DISPLAY\nalready setup, so no further configuration is required.\n\n\nAppVeyor\nAppVeyor runs on Windows, supporting Selenium, Chromium, Electron and similar\ntools out of the box - no configuration is required.\n" + }, + { + "type": "tutorial", + "title": "Updating Applications", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/updates.md", + "url": "https://electronjs.org/docs/tutorial/updates", + "slug": "updates", + "body": "Updating Applications\nThere are several ways to update an Electron application. The easiest and\nofficially supported one is taking advantage of the built-in\nSquirrel framework and\nElectron's autoUpdater module.\n\n\nUsing update.electronjs.org\nGitHub's Electron team maintains update.electronjs.org, a free and open-source\nwebservice that Electron apps can use to self-update. The service is designed\nfor Electron apps that meet the following criteria:\n\nApp runs on macOS or Windows\nApp has a public GitHub repository\nBuilds are published to GitHub Releases\nBuilds are code-signed\n\nThe easiest way to use this service is by installing update-electron-app,\na Node.js module preconfigured for use with update.electronjs.org.\nInstall the module:\nnpm install update-electron-app\nInvoke the updater from your app's main process file:\nrequire('update-electron-app')()\nBy default, this module will check for updates at app startup, then every ten\nminutes. When an update is found, it will automatically be downloaded in the background. When the download completes, a dialog is displayed allowing the user\nto restart the app.\nIf you need to customize your configuration, you can\npass options to update-electron-app\nor\nuse the update service directly.\n\n\nUsing electron-builder\nIf your app is packaged with electron-builder you can use the\nelectron-updater module, which does not require a server and allows for updates\nfrom S3, GitHub or any other static file host. This sidesteps Electron's built-in\nupdate mechanism, meaning that the rest of this documentation will not apply to\nelectron-builder's updater.\n\n\nDeploying an Update Server\nIf you're developing a private Electron application, or if you're not\npublishing releases to GitHub Releases, it may be necessary to run your own\nupdate server.\nDepending on your needs, you can choose from one of these:\n\nHazel – Update server for private or open-source apps which can be\ndeployed for free on Now. It pulls from GitHub Releases\nand leverages the power of GitHub's CDN.\nNuts – Also uses GitHub Releases, but caches app\nupdates on disk and supports private repositories.\nelectron-release-server – Provides a dashboard for\nhandling releases and does not require releases to originate on GitHub.\nNucleus – A complete update server for Electron apps maintained by\nAtlassian. Supports multiple applications and channels; uses a static file store\nto minify server cost.\n\n\n\nImplementing Updates in Your App\nOnce you've deployed your update server, continue with importing the required\nmodules in your code. The following code might vary for different server\nsoftware, but it works like described when using\nHazel.\nImportant: Please ensure that the code below will only be executed in\nyour packaged app, and not in development. You can use\nelectron-is-dev to check for\nthe environment.\nconst { app, autoUpdater, dialog } = require('electron')\nNext, construct the URL of the update server and tell\nautoUpdater about it:\nconst server = 'https://your-deployment-url.com'\nconst feed = `${server}/update/${process.platform}/${app.getVersion()}`\n\nautoUpdater.setFeedURL(feed)\nAs the final step, check for updates. The example below will check every minute:\nsetInterval(() => {\n autoUpdater.checkForUpdates()\n}, 60000)\nOnce your application is packaged,\nit will receive an update for each new\nGitHub Release that you\npublish.\n\n\nApplying Updates\nNow that you've configured the basic update mechanism for your application, you\nneed to ensure that the user will get notified when there's an update. This\ncan be achieved using the autoUpdater API\nevents:\nautoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {\n const dialogOpts = {\n type: 'info',\n buttons: ['Restart', 'Later'],\n title: 'Application Update',\n message: process.platform === 'win32' ? releaseNotes : releaseName,\n detail: 'A new version has been downloaded. Restart the application to apply the updates.'\n }\n\n dialog.showMessageBox(dialogOpts, (response) => {\n if (response === 0) autoUpdater.quitAndInstall()\n })\n})\nAlso make sure that errors are\nbeing handled. Here's an example\nfor logging them to stderr:\nautoUpdater.on('error', message => {\n console.error('There was a problem updating the application')\n console.error(message)\n})\n" + }, + { + "type": "tutorial", + "title": "Upgrading Chromium", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/upgrading-chromium.md", + "url": "https://electronjs.org/docs/tutorial/upgrading-chromium", + "slug": "upgrading-chromium", + "body": "Upgrading Chromium\nThis is an overview of the steps needed to upgrade Chromium in Electron.\n\nUpgrade libcc to a new Chromium version\nMake Electron code compatible with the new libcc\nUpdate Electron dependencies (crashpad, NodeJS, etc.) if needed\nMake internal builds of libcc and electron\nUpdate Electron docs if necessary\n\n\n\nUpgrade libcc to a new Chromium version\n\n\nGet the code and initialize the project:\n$ git clone git@github.com:electron/libchromiumcontent.git\n$ cd libchromiumcontent\n$ ./script/bootstrap -v\n\nUpdate the Chromium snapshot\n\n\n\nChoose a version number from OmahaProxy\nand update the VERSION file with it\n\nThis can be done manually by visiting OmahaProxy in a browser, or automatically:\nOne-liner for the latest stable mac version: curl -so- https://omahaproxy.appspot.com/mac > VERSION\nOne-liner for the latest win64 beta version: curl -so- https://omahaproxy.appspot.com/all | grep \"win64,beta\" | awk -F, 'NR==1{print $3}' > VERSION\n\n\n\nrun $ ./script/update\n\nBrew some tea -- this may run for 30m or more.\nIt will probably fail applying patches.\n\n\n\n\nFix *.patch files in the patches/ and patches-mas/ folders.\n(Optional) script/update applies patches, but if multiple tries are needed\nyou can manually run the same script that update calls:\n$ ./script/apply-patches\n\n\nThere is a second script, script/patch.py that may be useful.\nRead ./script/patch.py -h for more information.\n\n\nRun the build when all patches can be applied without errors\n\n\n$ ./script/build\nIf some patches are no longer compatible with the Chromium code,\nfix compilation errors.\n\n\nWhen the build succeeds, create a dist for Electron\n\n\n\n$ ./script/create-dist --no_zip\n\nIt will create a dist/main folder in the libcc repo's root.\nYou will need this to build Electron.\n\n\n\n\n(Optional) Update script contents if there are errors resulting from files\nthat were removed or renamed. (--no_zip prevents script from create dist\narchives. You don't need them.)\n\n\n\nUpdate Electron's code\n\n\nGet the code:\n$ git clone git@github.com:electron/electron.git\n$ cd electron\n\n\nIf you have libcc built on your machine in its own repo,\ntell Electron to use it:\n$ ./script/bootstrap.py -v \\\n --libcc_source_path /src \\\n --libcc_shared_library_path /shared_library \\\n --libcc_static_library_path /static_library\n\nIf you haven't yet built libcc but it's already supposed to be upgraded\nto a new Chromium, bootstrap Electron as usual\n$ ./script/bootstrap.py -v\n\n\nEnsure that libcc submodule (vendor/libchromiumcontent) points to the\nright revision\n\n\nSet CLANG_REVISION in script/update-clang.sh to match the version\nChromium is using.\n\n\nLocated in electron/libchromiumcontent/src/tools/clang/scripts/update.py\n\n\nCheckout Chromium if you haven't already:\n\n\n\nhttps://chromium.googlesource.com/chromium/src.git/+/{VERSION}/tools/clang/scripts/update.py\n\n(Replace the {VERSION} placeholder in the url above to the Chromium\nversion libcc uses.)\n\n\n\n\nBuild Electron.\n\n\nTry to build Debug version first: $ ./script/build.py -c D\nYou will need it to run tests\n\n\nFix compilation and linking errors\nEnsure that Release build can be built too\n\n\n$ ./script/build.py -c R\nOften the Release build will have different linking errors that you'll\nneed to fix.\nSome compilation and linking errors are caused by missing source/object\nfiles in the libcc dist\n\n\nUpdate ./script/create-dist in the libcc repo, recreate a dist, and\nrun Electron bootstrap script once again.\n\n\n\nTips for fixing compilation errors\n\nFix build config errors first\nFix fatal errors first, like missing files and errors related to compiler\nflags or defines\n\nTry to identify complex errors as soon as possible.\n\nAsk for help if you're not sure how to fix them\n\n\nDisable all Electron features, fix the build, then enable them one by one\nAdd more build flags to disable features in build-time.\n\nWhen a Debug build of Electron succeeds, run the tests:\n$ ./script/test.py\nFix the failing tests.\nFollow all the steps above to fix Electron code on all supported platforms.\n\n\nUpdating Crashpad\nIf there are any compilation errors related to the Crashpad, it probably means\nyou need to update the fork to a newer revision. See\nUpgrading Crashpad\nfor instructions on how to do that.\n\n\nUpdating NodeJS\nUpgrade vendor/node to the Node release that corresponds to the v8 version\nused in the new Chromium release. See the v8 versions in Node on\nSee Upgrading Node\nfor instructions on this.\n\n\nVerify ffmpeg support\nElectron ships with a version of ffmpeg that includes proprietary codecs by\ndefault. A version without these codecs is built and distributed with each\nrelease as well. Each Chrome upgrade should verify that switching this version\nis still supported.\nYou can verify Electron's support for multiple ffmpeg builds by loading the\nfollowing page. It should work with the default ffmpeg library distributed\nwith Electron and not work with the ffmpeg library built without proprietary\ncodecs.\n\n\n \n \n Proprietary Codec Check\n \n \n

Checking if Electron is using proprietary codecs by loading video from http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4

\n

\n \n \n \n\n\n\nUseful links\n\nChrome Release Schedule\nOmahaProxy\nChromium Issue Tracker\n\n" + }, + { + "type": "tutorial", + "title": "Upgrading Crashpad", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/upgrading-crashpad.md", + "url": "https://electronjs.org/docs/tutorial/upgrading-crashpad", + "slug": "upgrading-crashpad", + "body": "Upgrading Crashpad\n\nGet the version of crashpad that we're going to use.\n\n\n\nlibcc/src/third_party/crashpad/README.chromium will have a line Revision: with a checksum\n\nWe need to check out the corresponding branch.\n\n\n\nClone Google's crashpad (https://chromium.googlesource.com/crashpad/crashpad)\n\ngit clone https://chromium.googlesource.com/crashpad/crashpad\n\n\n\nCheck out the branch with the revision checksum:\n\ngit checkout \n\n\n\nAdd electron's crashpad fork as a remote\n\ngit remote add electron https://github.com/electron/crashpad\n\n\n\nCheck out a new branch for the update\n\ngit checkout -b electron-crashpad-vA.B.C.D\nA.B.C.D is the Chromium version found in libcc/VERSION\nand will be something like 62.0.3202.94\n\n\n\n\n\nMake a checklist of the Electron patches that need to be applied\nwith git log --oneline\n\nOr view https://github.com/electron/crashpad/commits/previous-branch-name\n\n\n\nFor each patch:\n\n\n\n\nIn electron-crashpad-vA.B.C.D, cherry-pick the patch's checksum\n\ngit cherry-pick \n\n\nResolve any conflicts\n\nMake sure it builds then add, commit, and push work to electron's crashpad fork\n\ngit push electron electron-crashpad-vA.B.C.D\n\n\n\n\nUpdate Electron to build the new crashpad:\n\n\ncd vendor/crashpad\ngit fetch\ngit checkout electron-crashpad-v62.0.3202.94\n\n\nRegenerate Ninja files against both targets\n\n\nFrom Electron root's root, run script/update.py\nscript/build.py -c D --target=crashpad_client\nscript/build.py -c D --target=crashpad_handler\nBoth should build with no errors\n\n\nPush changes to submodule reference\n\n\n(From electron root) git add vendor/crashpad\ngit push origin upgrade-to-chromium-62\n\n" + }, + { + "type": "tutorial", + "title": "Upgrading Node", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/upgrading-node.md", + "url": "https://electronjs.org/docs/tutorial/upgrading-node", + "slug": "upgrading-node", + "body": "Upgrading Node\n\n\nDiscussion\nOne upgrade issue is building all of Electron with a single copy\nof V8 to ensure compatibility. This is important because\nupstream Node and libchromiumcontent\nboth use their own versions of V8.\nUpgrading Node is much easier than upgrading libchromiumcontent,\nso fewer conflicts arise if one upgrades libchromiumcontent first,\nthen chooses the upstream Node release whose V8 is closest to it.\nElectron has its own Node fork\nwith modifications for the V8 build details mentioned above\nand for exposing API needed by Electron. Once an upstream Node\nrelease is chosen, it's placed in a branch in Electron's Node fork\nand any Electron Node patches are applied there.\nAnother factor is that the Node project patches its version of V8.\nAs mentioned above, Electron builds everything with a single copy\nof V8, so Node's V8 patches must be ported to that copy.\nOnce all of Electron's dependencies are building and using the same\ncopy of V8, the next step is to fix any Electron code issues caused\nby the Node upgrade.\n[FIXME] something about a Node debugger in Atom that we (e.g. deepak)\nuse and need to confirm doesn't break with the Node upgrade?\nSo in short, the primary steps are:\n\nUpdate Electron's Node fork to the desired version\nBackport Node's V8 patches to our copy of V8\nUpdate Electron to use new version of Node\n\n\nUpdate submodules\nUpdate Node.js build configuration\n\n\n\nUpdating Electron's Node fork\n\nEnsure that master on electron/node has updated release tags from nodejs/node\nCreate a branch in https://github.com/electron/node: electron-node-vX.X.X where the base that you're branching from is the tag for the desired update\n\n\nvX.X.X Must use a version of node compatible with our current version of chromium\n\n\nRe-apply our commits from the previous version of node we were using (vY.Y.Y) to v.X.X.X\n\n\nCheck release tag and select the range of commits we need to re-apply\n\nCherry-pick commit range:\n\nCheckout both vY.Y.Y & v.X.X.X\ngit cherry-pick FIRST_COMMIT_HASH..LAST_COMMIT_HASH\n\n\n\nResolve merge conflicts in each file encountered, then:\n\ngit add \ngit cherry-pick --continue\nRepeat until finished\n\n\n\n\n\nUpdating V8 Patches\nWe need to generate a patch file from each patch applied to V8.\n\nGet a copy of Electron's libcc fork\n\n\n$ git clone https://github.com/electron/libchromiumcontent\n\n\nRun script/update to get the latest libcc\n\n\nThis will be time-consuming\n\n\nRemove our copies of the old Node v8 patches\n\n\n(In libchromiumcontent repo) Read patches/v8/README.md to see which patchfiles\nwere created during the last update\n\nRemove those files from patches/v8/:\n\ngit rm the patchfiles\nedit patches/v8/README.md\ncommit these removals\n\n\n\n\nInspect Node repo to see what patches upstream Node\nused with their v8 after bumping its version\n\n\ngit log --oneline deps/V8\n\n\nCreate a checklist of the patches. This is useful for tracking your work and for\nhaving a quick reference of commit hashes to use in the git diff-tree step below.\nRead patches/v8/README.md to see which patchfiles came from the previous version of V8 and therefore need to be removed.\n\n\nDelete each patchfile referenced in patches/v8/README.md\n\n\nFor each patch, do:\n\n\n\n(In node repo) git diff-tree --patch HASH > ~/path_to_libchromiumcontent/patches/v8/xxx-patch_name.patch\n\nxxx is an incremented three-digit number (to force patch order)\npatch_name should loosely match the node commit messages,\ne.g. 030-cherry_pick_cc55747,patch if the Node commit message was \"cherry-pick cc55747\"\n\n\n\n(remainder of steps in libchromium repo)\nManually edit the .patch file to match upstream V8's directory:\n\n\nIf a diff section has no instances of deps/V8, remove it altogether.\n\nWe don’t want those patches because we’re only patching V8.\n\n\n\nReplace instances of a/deps/v8/filename.ext with a/filename.ext\n\nThis is needed because upstream Node keeps its V8 files in a subdirectory\n\n\n\n\nEnsure that local status is clean: git status to make sure there are no unstaged changes.\nConfirm that the patch applies cleanly with\nscript/patch.py -r src/V8 -p patches/v8/xxx-patch_name.patch.patch\n\nCreate a new copy of the patch:\n\ncd src/v8 && git diff > ../../test.patch && cd ../..\nThis is needed because the first patch has Node commit checksums that we don't want\n\n\n\nConfirm that checksums are the only difference between the two patches:\n\ndiff -u test.patch patches/v8/xxx-patch_name.patch\n\n\n\nReplace the old patch with the new:\n\nmv test.patch patches/v8/xxx-patch_name.patch\n\n\n\nAdd the patched code to the index without committing:\n\ncd src/v8 && git add . && cd ../..\nWe don't want to commit the changes (they're kept in the patchfiles)\nbut need them locally so that they don't show up in subsequent diffs\nwhile we iterate through more patches\n\n\n\nAdd the patch file to the index:\n\ngit add a patches/v8/\n\n\n\n(Optionally) commit each patch file to ensure you can back up if you mess up a step:\n\ngit commit patches/v8/\n\n\n\n\nUpdate patches/v8/README.md with references to all new patches that have been added so that the next person will know which need to be removed.\n\nUpdate Electron's submodule references:\n$ cd electron/vendor/node\nelectron/vendor/node$ git fetch\nelectron/vendor/node$ git checkout electron-node-vA.B.C\nelectron/vendor/node$ cd ../libchromiumcontent\nelectron/vendor/libchromiumcontent$ git fetch\nelectron/vendor/libchromiumcontent$ git checkout upgrade-to-chromium-X\nelectron/vendor/libchromiumcontent$ cd ../..\nelectron$ git add vendor\nelectron$ git commit -m \"update submodule referefences for node and libc\"\nelectron$ git pso upgrade-to-chromium-62\nelectron$ script/bootstrap.py -d\nelectron$ script/build.py -c -D\n\n\n\n\nNotes\n\nlibcc and V8 are treated as a single unit\n\nNode maintains its own fork of V8\n\nThey backport a small amount of things as needed\nDocumentation in node about how they work with V8\n\n\n\nWe update code such that we only use one copy of V8 across all of electron\n\nE.g electron, libcc, and node\n\n\n\nWe don’t track upstream closely due to logistics:\n\nUpstream uses multiple repos and so merging into a single repo\nwould result in lost history. So we only update when we’re planning\na node version bump in electron.\n\n\n\nlibcc is large and time-consuming to update, so we typically\nchoose the node version based on which of its releases has a version\nof V8 that’s closest to the version in libcc that we’re using.\n\nWe sometimes have to wait for the next periodic Node release\nbecause it will sync more closely with the version of V8 in the new libcc\n\n\n\nElectron keeps all its patches in libcc because it’s simpler than\nmaintaining different repos for patches for each upstream project.\n\nCrashpad, node, libcc, etc. patches are all kept in the same place\n\n\n\nBuilding node:\n\nThere’s a chance we need to change our build configuration\nto match the build flags that node wants in node/common.gypi\n\n\n\n" + }, + { + "type": "tutorial", + "title": "Using Native Node Modules", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/using-native-node-modules.md", + "url": "https://electronjs.org/docs/tutorial/using-native-node-modules", + "slug": "using-native-node-modules", + "body": "Using Native Node Modules\nThe native Node modules are supported by Electron, but since Electron is very\nlikely to use a different V8 version from the Node binary installed in your\nsystem, you have to manually specify the location of Electron's headers when\nbuilding native modules.\n\n\nHow to install native modules\nThree ways to install native modules:\n\n\nUsing npm\nBy setting a few environment variables, you can use npm to install modules\ndirectly.\nAn example of installing all dependencies for Electron:\n# Electron's version.\nexport npm_config_target=1.2.3\n# The architecture of Electron, can be ia32 or x64.\nexport npm_config_arch=x64\nexport npm_config_target_arch=x64\n# Download headers for Electron.\nexport npm_config_disturl=https://atom.io/download/electron\n# Tell node-pre-gyp that we are building for Electron.\nexport npm_config_runtime=electron\n# Tell node-pre-gyp to build module from source code.\nexport npm_config_build_from_source=true\n# Install all dependencies, and store cache to ~/.electron-gyp.\nHOME=~/.electron-gyp npm install\n\n\nInstalling modules and rebuilding for Electron\nYou can also choose to install modules like other Node projects, and then\nrebuild the modules for Electron with the electron-rebuild\npackage. This module can get the version of Electron and handle the manual steps\nof downloading headers and building native modules for your app.\nAn example of installing electron-rebuild and then rebuild modules with it:\nnpm install --save-dev electron-rebuild\n\n# Every time you run \"npm install\", run this:\n./node_modules/.bin/electron-rebuild\n\n# On Windows if you have trouble, try:\n.\\node_modules\\.bin\\electron-rebuild.cmd\n\n\nManually building for Electron\nIf you are a developer developing a native module and want to test it against\nElectron, you might want to rebuild the module for Electron manually. You can\nuse node-gyp directly to build for Electron:\ncd /path-to-module/\nHOME=~/.electron-gyp node-gyp rebuild --target=1.2.3 --arch=x64 --dist-url=https://atom.io/download/electron\nThe HOME=~/.electron-gyp changes where to find development headers. The\n--target=1.2.3 is version of Electron. The --dist-url=... specifies\nwhere to download the headers. The --arch=x64 says the module is built for\n64bit system.\n\n\nTroubleshooting\nIf you installed a native module and found it was not working, you need to check\nfollowing things:\n\nThe architecture of the module has to match Electron's architecture (ia32 or x64).\nAfter you upgrade Electron, you usually need to rebuild the modules.\nWhen in doubt, run electron-rebuild first.\n\n\n\nModules that rely on prebuild\nprebuild provides a way to\npublish native Node modules with prebuilt binaries for multiple versions of Node\nand Electron.\nIf modules provide binaries for the usage in Electron, make sure to omit\n--build-from-source and the npm_config_build_from_source environment\nvariable in order to take full advantage of the prebuilt binaries.\n\n\nModules that rely on node-pre-gyp\nThe node-pre-gyp tool provides a way to deploy native Node\nmodules with prebuilt binaries, and many popular modules are using it.\nUsually those modules work fine under Electron, but sometimes when Electron uses\na newer version of V8 than Node, and there are ABI changes, bad things may\nhappen. So in general it is recommended to always build native modules from\nsource code.\nIf you are following the npm way of installing modules, then this is done\nby default, if not, you have to pass --build-from-source to npm, or set the\nnpm_config_build_from_source environment variable.\n" + }, + { + "type": "tutorial", + "title": "Using Pepper Flash Plugin", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/using-pepper-flash-plugin.md", + "url": "https://electronjs.org/docs/tutorial/using-pepper-flash-plugin", + "slug": "using-pepper-flash-plugin", + "body": "Using Pepper Flash Plugin\nElectron supports the Pepper Flash plugin. To use the Pepper Flash plugin in\nElectron, you should manually specify the location of the Pepper Flash plugin\nand then enable it in your application.\n\n\nPrepare a Copy of Flash Plugin\nOn macOS and Linux, the details of the Pepper Flash plugin can be found by\nnavigating to chrome://plugins in the Chrome browser. Its location and version\nare useful for Electron's Pepper Flash support. You can also copy it to another\nlocation.\n\n\nAdd Electron Switch\nYou can directly add --ppapi-flash-path and --ppapi-flash-version to the\nElectron command line or by using the app.commandLine.appendSwitch method\nbefore the app ready event. Also, turn on plugins option of BrowserWindow.\nFor example:\nconst {app, BrowserWindow} = require('electron')\nconst path = require('path')\n\n// Specify flash path, supposing it is placed in the same directory with main.js.\nlet pluginName\nswitch (process.platform) {\n case 'win32':\n pluginName = 'pepflashplayer.dll'\n break\n case 'darwin':\n pluginName = 'PepperFlashPlayer.plugin'\n break\n case 'linux':\n pluginName = 'libpepflashplayer.so'\n break\n}\napp.commandLine.appendSwitch('ppapi-flash-path', path.join(__dirname, pluginName))\n\n// Optional: Specify flash version, for example, v17.0.0.169\napp.commandLine.appendSwitch('ppapi-flash-version', '17.0.0.169')\n\napp.on('ready', () => {\n let win = new BrowserWindow({\n width: 800,\n height: 600,\n webPreferences: {\n plugins: true\n }\n })\n win.loadURL(`file://${__dirname}/index.html`)\n // Something else\n})\nYou can also try loading the system wide Pepper Flash plugin instead of shipping\nthe plugins yourself, its path can be received by calling\napp.getPath('pepperFlashSystemPlugin').\n\n\nEnable Flash Plugin in a Tag\nAdd plugins attribute to tag.\n\n\n\nTroubleshooting\nYou can check if Pepper Flash plugin was loaded by inspecting\nnavigator.plugins in the console of devtools (although you can't know if the\nplugin's path is correct).\nThe architecture of Pepper Flash plugin has to match Electron's one. On Windows,\na common error is to use 32bit version of Flash plugin against 64bit version of\nElectron.\nOn Windows the path passed to --ppapi-flash-path has to use \\ as path\ndelimiter, using POSIX-style paths will not work.\nFor some operations, such as streaming media using RTMP, it is necessary to grant wider permissions to players’ .swf files. One way of accomplishing this, is to use nw-flash-trust.\n" + }, + { + "type": "tutorial", + "title": "Using Selenium and WebDriver", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/using-selenium-and-webdriver.md", + "url": "https://electronjs.org/docs/tutorial/using-selenium-and-webdriver", + "slug": "using-selenium-and-webdriver", + "body": "Using Selenium and WebDriver\nFrom ChromeDriver - WebDriver for Chrome:\n\nWebDriver is an open source tool for automated testing of web apps across many\nbrowsers. It provides capabilities for navigating to web pages, user input,\nJavaScript execution, and more. ChromeDriver is a standalone server which\nimplements WebDriver's wire protocol for Chromium. It is being developed by\nmembers of the Chromium and WebDriver teams.\n\n\n\nSetting up Spectron\nSpectron is the officially supported ChromeDriver testing framework\nfor Electron. It is built on top of WebdriverIO and\nhas helpers to access Electron APIs in your tests and bundles ChromeDriver.\n$ npm install --save-dev spectron\n// A simple test to verify a visible window is opened with a title\nvar Application = require('spectron').Application\nvar assert = require('assert')\n\nvar app = new Application({\n path: '/Applications/MyApp.app/Contents/MacOS/MyApp'\n})\n\napp.start().then(function () {\n // Check if the window is visible\n return app.browserWindow.isVisible()\n}).then(function (isVisible) {\n // Verify the window is visible\n assert.equal(isVisible, true)\n}).then(function () {\n // Get the window's title\n return app.client.getTitle()\n}).then(function (title) {\n // Verify the window's title\n assert.equal(title, 'My App')\n}).catch(function (error) {\n // Log any failures\n console.error('Test failed', error.message)\n}).then(function () {\n // Stop the application\n return app.stop()\n})\n\n\nSetting up with WebDriverJs\nWebDriverJs provides\na Node package for testing with web driver, we will use it as an example.\n\n\n1. Start ChromeDriver\nFirst you need to download the chromedriver binary, and run it:\n$ npm install electron-chromedriver\n$ ./node_modules/.bin/chromedriver\nStarting ChromeDriver (v2.10.291558) on port 9515\nOnly local connections are allowed.\nRemember the port number 9515, which will be used later\n\n\n2. Install WebDriverJS\n$ npm install selenium-webdriver\n\n\n3. Connect to ChromeDriver\nThe usage of selenium-webdriver with Electron is the same with\nupstream, except that you have to manually specify how to connect\nchrome driver and where to find Electron's binary:\nconst webdriver = require('selenium-webdriver')\n\nconst driver = new webdriver.Builder()\n // The \"9515\" is the port opened by chrome driver.\n .usingServer('http://localhost:9515')\n .withCapabilities({\n chromeOptions: {\n // Here is the path to your Electron binary.\n binary: '/Path-to-Your-App.app/Contents/MacOS/Electron'\n }\n })\n .forBrowser('electron')\n .build()\n\ndriver.get('http://www.google.com')\ndriver.findElement(webdriver.By.name('q')).sendKeys('webdriver')\ndriver.findElement(webdriver.By.name('btnG')).click()\ndriver.wait(() => {\n return driver.getTitle().then((title) => {\n return title === 'webdriver - Google Search'\n })\n}, 1000)\n\ndriver.quit()\n\n\nSetting up with WebdriverIO\nWebdriverIO provides a Node package for testing with web\ndriver.\n\n\n1. Start ChromeDriver\nFirst you need to download the chromedriver binary, and run it:\n$ npm install electron-chromedriver\n$ ./node_modules/.bin/chromedriver --url-base=wd/hub --port=9515\nStarting ChromeDriver (v2.10.291558) on port 9515\nOnly local connections are allowed.\nRemember the port number 9515, which will be used later\n\n\n2. Install WebdriverIO\n$ npm install webdriverio\n\n\n3. Connect to chrome driver\nconst webdriverio = require('webdriverio')\nconst options = {\n host: 'localhost', // Use localhost as chrome driver server\n port: 9515, // \"9515\" is the port opened by chrome driver.\n desiredCapabilities: {\n browserName: 'chrome',\n chromeOptions: {\n binary: '/Path-to-Your-App/electron', // Path to your Electron binary.\n args: [/* cli arguments */] // Optional, perhaps 'app=' + /path/to/your/app/\n }\n }\n}\n\nlet client = webdriverio.remote(options)\n\nclient\n .init()\n .url('http://google.com')\n .setValue('#q', 'webdriverio')\n .click('#btnG')\n .getTitle().then((title) => {\n console.log('Title was: ' + title)\n })\n .end()\n\n\nWorkflow\nTo test your application without rebuilding Electron,\nplace\nyour app source into Electron's resource directory.\nAlternatively, pass an argument to run with your electron binary that points to\nyour app's folder. This eliminates the need to copy-paste your app into\nElectron's resource directory.\n" + }, + { + "type": "tutorial", + "title": "Using Widevine CDM Plugin", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/using-widevine-cdm-plugin.md", + "url": "https://electronjs.org/docs/tutorial/using-widevine-cdm-plugin", + "slug": "using-widevine-cdm-plugin", + "body": "Using Widevine CDM Plugin\nIn Electron you can use the Widevine CDM plugin shipped with Chrome browser.\n\n\nGetting the plugin\nElectron doesn't ship with the Widevine CDM plugin for license reasons, to get\nit, you need to install the official Chrome browser first, which should match\nthe architecture and Chrome version of the Electron build you use.\nNote: The major version of Chrome browser has to be the same with the Chrome\nversion used by Electron, otherwise the plugin will not work even though\nnavigator.plugins would show it has been loaded.\n\n\nWindows & macOS\nOpen chrome://components/ in Chrome browser, find WidevineCdm and make\nsure it is up to date, then you can find all the plugin binaries from the\nAPP_DATA/Google/Chrome/WidevineCDM/VERSION/_platform_specific/PLATFORM_ARCH/\ndirectory.\nAPP_DATA is system's location for storing app data, on Windows it is\n%LOCALAPPDATA%, on macOS it is ~/Library/Application Support. VERSION is\nWidevine CDM plugin's version string, like 1.4.8.866. PLATFORM is mac or\nwin. ARCH is x86 or x64.\nOn Windows the required binaries are widevinecdm.dll and\nwidevinecdmadapter.dll, on macOS they are libwidevinecdm.dylib and\nwidevinecdmadapter.plugin. You can copy them to anywhere you like, but they\nhave to be put together.\n\n\nLinux\nOn Linux the plugin binaries are shipped together with Chrome browser, you can\nfind them under /opt/google/chrome, the filenames are libwidevinecdm.so and\nlibwidevinecdmadapter.so.\n\n\nUsing the plugin\nAfter getting the plugin files, you should pass the widevinecdmadapter's path\nto Electron with --widevine-cdm-path command line switch, and the plugin's\nversion with --widevine-cdm-version switch.\nNote: Though only the widevinecdmadapter binary is passed to Electron, the\nwidevinecdm binary has to be put aside it.\nThe command line switches have to be passed before the ready event of app\nmodule gets emitted, and the page that uses this plugin must have plugin\nenabled.\nExample code:\nconst {app, BrowserWindow} = require('electron')\n\n// You have to pass the filename of `widevinecdmadapter` here, it is\n// * `widevinecdmadapter.plugin` on macOS,\n// * `libwidevinecdmadapter.so` on Linux,\n// * `widevinecdmadapter.dll` on Windows.\napp.commandLine.appendSwitch('widevine-cdm-path', '/path/to/widevinecdmadapter.plugin')\n// The version of plugin can be got from `chrome://plugins` page in Chrome.\napp.commandLine.appendSwitch('widevine-cdm-version', '1.4.8.866')\n\nlet win = null\napp.on('ready', () => {\n win = new BrowserWindow({\n webPreferences: {\n // The `plugins` have to be enabled.\n plugins: true\n }\n })\n win.show()\n})\n\n\nVerifying the plugin\nTo verify whether the plugin works, you can use following ways:\n\nOpen devtools and check whether navigator.plugins includes the Widevine\nCDM plugin.\nOpen https://shaka-player-demo.appspot.com/ and load a manifest that uses\nWidevine.\nOpen http://www.dash-player.com/demo/drm-test-area/, check whether the page\nsays bitdash uses Widevine in your browser, then play the video.\n\n" + }, + { + "type": "tutorial", + "title": "V8 Development", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/development/v8-development.md", + "url": "https://electronjs.org/docs/tutorial/v8-development", + "slug": "v8-development", + "body": "V8 Development\n\nA collection of resources for learning and using V8\n\n\nV8 Tracing\nV8 Profiler - Profiler combinations which are useful for profiling: --prof, --trace-ic, --trace-opt, --trace-deopt, --print-bytecode, --print-opt-code\nV8 Interpreter Design\nOptimizing compiler\nV8 GDB Debugging\n\nSee also Chromium Development\n" + }, + { + "type": "tutorial", + "title": "Windows Store Guide", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/windows-store-guide.md", + "url": "https://electronjs.org/docs/tutorial/windows-store-guide", + "slug": "windows-store-guide", + "body": "Windows Store Guide\nWith Windows 10, the good old win32 executable got a new sibling: The Universal\nWindows Platform. The new .appx format does not only enable a number of new\npowerful APIs like Cortana or Push Notifications, but through the Windows Store,\nalso simplifies installation and updating.\nMicrosoft developed a tool that compiles Electron apps as .appx packages,\nenabling developers to use some of the goodies found in the new application\nmodel. This guide explains how to use it - and what the capabilities and\nlimitations of an Electron AppX package are.\n\n\nBackground and Requirements\nWindows 10 \"Anniversary Update\" is able to run win32 .exe binaries by\nlaunching them together with a virtualized filesystem and registry. Both are\ncreated during compilation by running app and installer inside a Windows\nContainer, allowing Windows to identify exactly which modifications to the\noperating system are done during installation. Pairing the executable with a\nvirtual filesystem and a virtual registry allows Windows to enable one-click\ninstallation and uninstallation.\nIn addition, the exe is launched inside the appx model - meaning that it can use\nmany of the APIs available to the Universal Windows Platform. To gain even more\ncapabilities, an Electron app can pair up with an invisible UWP background task\nlaunched together with the exe - sort of launched as a sidekick to run tasks\nin the background, receive push notifications, or to communicate with other UWP\napplications.\nTo compile any existing Electron app, ensure that you have the following\nrequirements:\n\nWindows 10 with Anniversary Update (released August 2nd, 2016)\nThe Windows 10 SDK, downloadable here\nAt least Node 4 (to check, run node -v)\n\nThen, go and install the electron-windows-store CLI:\nnpm install -g electron-windows-store\n\n\nStep 1: Package Your Electron Application\nPackage the application using electron-packager (or a similar tool).\nMake sure to remove node_modules that you don't need in your final application, since\nany module you don't actually need will increase your application's size.\nThe output should look roughly like this:\n├── Ghost.exe\n├── LICENSE\n├── content_resources_200_percent.pak\n├── content_shell.pak\n├── d3dcompiler_47.dll\n├── ffmpeg.dll\n├── icudtl.dat\n├── libEGL.dll\n├── libGLESv2.dll\n├── locales\n│   ├── am.pak\n│   ├── ar.pak\n│   ├── [...]\n├── natives_blob.bin\n├── node.dll\n├── resources\n│   ├── app\n│   └── atom.asar\n├── snapshot_blob.bin\n├── squirrel.exe\n└── ui_resources_200_percent.pak\n\n\nStep 2: Running electron-windows-store\nFrom an elevated PowerShell (run it \"as Administrator\"), run\nelectron-windows-store with the required parameters, passing both the input\nand output directories, the app's name and version, and confirmation that\nnode_modules should be flattened.\nelectron-windows-store `\n --input-directory C:\\myelectronapp `\n --output-directory C:\\output\\myelectronapp `\n --flatten true `\n --package-version 1.0.0.0 `\n --package-name myelectronapp\nOnce executed, the tool goes to work: It accepts your Electron app as an input,\nflattening the node_modules. Then, it archives your application as app.zip.\nUsing an installer and a Windows Container, the tool creates an \"expanded\" AppX\npackage - including the Windows Application Manifest (AppXManifest.xml) as\nwell as the virtual file system and the virtual registry inside your output\nfolder.\nOnce the expanded AppX files are created, the tool uses the Windows App Packager\n(MakeAppx.exe) to create a single-file AppX package from those files on disk.\nFinally, the tool can be used to create a trusted certificate on your computer\nto sign the new AppX package. With the signed AppX package, the CLI can also\nautomatically install the package on your machine.\n\n\nStep 3: Using the AppX Package\nIn order to run your package, your users will need Windows 10 with the so-called\n\"Anniversary Update\" - details on how to update Windows can be found here.\nIn opposition to traditional UWP apps, packaged apps currently need to undergo a\nmanual verification process, for which you can apply here.\nIn the meantime, all users will be able to install your package by double-clicking it,\nso a submission to the store might not be necessary if you're looking for an\neasier installation method. In managed environments (usually enterprises), the\nAdd-AppxPackage PowerShell Cmdlet can be used to install it in an automated fashion.\nAnother important limitation is that the compiled AppX package still contains a\nwin32 executable - and will therefore not run on Xbox, HoloLens, or Phones.\n\n\nOptional: Add UWP Features using a BackgroundTask\nYou can pair your Electron app up with an invisible UWP background task that\ngets to make full use of Windows 10 features - like push notifications,\nCortana integration, or live tiles.\nTo check out how an Electron app that uses a background task to send toast\nnotifications and live tiles, check out the Microsoft-provided sample.\n\n\nOptional: Convert using Container Virtualization\nTo generate the AppX package, the electron-windows-store CLI uses a template\nthat should work for most Electron apps. However, if you are using a custom\ninstaller, or should you experience any trouble with the generated package, you\ncan attempt to create a package using compilation with a Windows Container - in\nthat mode, the CLI will install and run your application in blank Windows Container\nto determine what modifications your application is exactly doing to the operating\nsystem.\nBefore running the CLI for the first time, you will have to setup the \"Windows Desktop App\nConverter\". This will take a few minutes, but don't worry - you only have to do\nthis once. Download and Desktop App Converter from here.\nYou will receive two files: DesktopAppConverter.zip and BaseImage-14316.wim.\n\nUnzip DesktopAppConverter.zip. From an elevated PowerShell (opened with\n\"run as Administrator\", ensure that your systems execution policy allows us to\nrun everything we intend to run by calling Set-ExecutionPolicy bypass.\nThen, run the installation of the Desktop App Converter, passing in the\nlocation of the Windows base Image (downloaded as BaseImage-14316.wim), by\ncalling .\\DesktopAppConverter.ps1 -Setup -BaseImage .\\BaseImage-14316.wim.\nIf running the above command prompts you for a reboot, please restart your\nmachine and run the above command again after a successful restart.\n\nOnce installation succeeded, you can move on to compiling your Electron app.\n" + }, + { + "type": "tutorial", + "title": "Windows Taskbar", + "githubUrl": "https://github.com/electron/electron/tree/master/docs/tutorial/windows-taskbar.md", + "url": "https://electronjs.org/docs/tutorial/windows-taskbar", + "slug": "windows-taskbar", + "body": "Windows Taskbar\nElectron has APIs to configure the app's icon in the Windows taskbar. Supported\nare the creation of a JumpList,\ncustom thumbnails and toolbars,\nicon overlays, and the so-called\n\"Flash Frame\" effect, but\nElectron also uses the app's dock icon to implement cross-platform features\nlike recent documents and\napplication progress.\n\n\nJumpList\nWindows allows apps to define a custom context menu that shows up when users\nright-click the app's icon in the task bar. That context menu is called\nJumpList. You specify custom actions in the Tasks category of JumpList,\nas quoted from MSDN:\n\nApplications define tasks based on both the program's features and the key\nthings a user is expected to do with them. Tasks should be context-free, in\nthat the application does not need to be running for them to work. They\nshould also be the statistically most common actions that a normal user would\nperform in an application, such as compose an email message or open the\ncalendar in a mail program, create a new document in a word processor, launch\nan application in a certain mode, or launch one of its subcommands. An\napplication should not clutter the menu with advanced features that standard\nusers won't need or one-time actions such as registration. Do not use tasks\nfor promotional items such as upgrades or special offers.\nIt is strongly recommended that the task list be static. It should remain the\nsame regardless of the state or status of the application. While it is\npossible to vary the list dynamically, you should consider that this could\nconfuse the user who does not expect that portion of the destination list to\nchange.\n\nTasks of Internet Explorer:\n\nUnlike the dock menu in macOS which is a real menu, user tasks in Windows work\nlike application shortcuts such that when user clicks a task, a program will be\nexecuted with specified arguments.\nTo set user tasks for your application, you can use\napp.setUserTasks API:\nconst { app } = require('electron')\napp.setUserTasks([\n {\n program: process.execPath,\n arguments: '--new-window',\n iconPath: process.execPath,\n iconIndex: 0,\n title: 'New Window',\n description: 'Create a new window'\n }\n])\nTo clean your tasks list, call app.setUserTasks with an empty array:\nconst { app } = require('electron')\napp.setUserTasks([])\nThe user tasks will still show even after your application closes, so the icon\nand program path specified for a task should exist until your application is\nuninstalled.\n\n\nThumbnail Toolbars\nOn Windows you can add a thumbnail toolbar with specified buttons in a taskbar\nlayout of an application window. It provides users a way to access to a\nparticular window's command without restoring or activating the window.\nFrom MSDN, it's illustrated:\n\nThis toolbar is the familiar standard toolbar common control. It has a\nmaximum of seven buttons. Each button's ID, image, tooltip, and state are defined\nin a structure, which is then passed to the taskbar. The application can show,\nenable, disable, or hide buttons from the thumbnail toolbar as required by its\ncurrent state.\nFor example, Windows Media Player might offer standard media transport controls\nsuch as play, pause, mute, and stop.\n\nThumbnail toolbar of Windows Media Player:\n\nYou can use BrowserWindow.setThumbarButtons to set\nthumbnail toolbar in your application:\nconst { BrowserWindow } = require('electron')\nconst path = require('path')\n\nconst win = new BrowserWindow()\n\nwin.setThumbarButtons([\n {\n tooltip: 'button1',\n icon: path.join(__dirname, 'button1.png'),\n click () { console.log('button1 clicked') }\n }, {\n tooltip: 'button2',\n icon: path.join(__dirname, 'button2.png'),\n flags: ['enabled', 'dismissonclick'],\n click () { console.log('button2 clicked.') }\n }\n])\nTo clean thumbnail toolbar buttons, just call BrowserWindow.setThumbarButtons\nwith an empty array:\nconst { BrowserWindow } = require('electron')\n\nconst win = new BrowserWindow()\nwin.setThumbarButtons([])\n\n\nIcon Overlays in Taskbar\nOn Windows a taskbar button can use a small overlay to display application\nstatus, as quoted from MSDN:\n\nIcon overlays serve as a contextual notification of status, and are intended\nto negate the need for a separate notification area status icon to communicate\nthat information to the user. For instance, the new mail status in Microsoft\nOutlook, currently shown in the notification area, can now be indicated\nthrough an overlay on the taskbar button. Again, you must decide during your\ndevelopment cycle which method is best for your application. Overlay icons are\nintended to supply important, long-standing status or notifications such as\nnetwork status, messenger status, or new mail. The user should not be\npresented with constantly changing overlays or animations.\n\nOverlay on taskbar button:\n\nTo set the overlay icon for a window, you can use the\nBrowserWindow.setOverlayIcon API:\nconst {BrowserWindow} = require('electron')\nlet win = new BrowserWindow()\nwin.setOverlayIcon('path/to/overlay.png', 'Description for overlay')\n\n\nFlash Frame\nOn Windows you can highlight the taskbar button to get the user's attention.\nThis is similar to bouncing the dock icon on macOS.\nFrom the MSDN reference documentation:\n\nTypically, a window is flashed to inform the user that the window requires\nattention but that it does not currently have the keyboard focus.\n\nTo flash the BrowserWindow taskbar button, you can use the\nBrowserWindow.flashFrame API:\nconst {BrowserWindow} = require('electron')\nlet win = new BrowserWindow()\nwin.once('focus', () => win.flashFrame(false))\nwin.flashFrame(true)\nDon't forget to call the flashFrame method with false to turn off the flash. In\nthe above example, it is called when the window comes into focus, but you might\nuse a timeout or some other event to disable it.\n" } ] \ No newline at end of file diff --git a/lib/electron-apis.js b/lib/electron-apis.js new file mode 100644 index 0000000..15df026 --- /dev/null +++ b/lib/electron-apis.js @@ -0,0 +1,67 @@ +const apis = require('../electron-api.json') +const results = [] + +apis.forEach(api => { + // TODO constructorMethod + + const staticMethods = api.staticMethods || [] + staticMethods.forEach(method => { + method.type = 'api' + method.apiType = 'staticMethod' + method.title = `${api.name}.${method.name}${method.signature}` + method.tldr = getTLDR(method) + const slug = method.name.replace(/\W/g, '').toLowerCase() + method.url = `https://electronjs.org/docs/api/${api.slug}#${api.slug}${slug}` + delete method.signature + results.push(method) + }) + + const instanceMethods = api.instanceMethods || [] + instanceMethods.forEach(method => { + method.type = 'api' + method.apiType = 'instanceMethod' + method.title = `${api.instanceName}.${method.name}${method.signature}` + method.tldr = getTLDR(method) + const slug = method.name.replace(/\W/g, '').toLowerCase() + method.url = `https://electronjs.org/docs/api/${api.slug}#${api.slug}${slug}` + delete method.signature + results.push(method) + }) + + const events = api.events || [] + events.forEach(event => { + event.type = 'api' + event.apiType = 'event' + event.title = `${api.name}.on('${event.name}')` + event.url = `https://electronjs.org/docs/api/${api.slug}#event-${event.name}` + event.tldr = getTLDR(event) + results.push(event) + }) + + const instanceEvents = api.instanceEvents || [] + instanceEvents.forEach(event => { + event.type = 'api' + event.apiType = 'event' + event.title = `${api.instanceName}.on('${event.name}')` + event.url = `https://electronjs.org/docs/api/${api.slug}#event-${event.name}` + event.tldr = getTLDR(event) + results.push(event) + }) +}) + +function getTLDR (api) { + const { description, returns } = api + + if (!description && returns && returns.description) { + return ( + 'Returns ' + + returns.description.charAt(0).toLowerCase() + + returns.description.slice(1) + ) + } + + if (typeof description !== 'string' || !description.length) return null + return description.split('. ')[0] + '.' +} + +module.exports = results diff --git a/lib/tutorials.js b/lib/tutorials.js new file mode 100644 index 0000000..cd14a5e --- /dev/null +++ b/lib/tutorials.js @@ -0,0 +1,16 @@ +const {chain} = require('lodash') +const cheerio = require('cheerio') + +module.exports = chain(Object.values(require('electron-i18n').docs['en-US'])) + .filter(tutorial => !tutorial.isApiDoc && !tutorial.isApiStructureDoc) + .map(tutorial => { + const {title, githubUrl, slug, sections} = tutorial + const type = 'tutorial' + const html = sections.map(section => section.html).join('\n\n') + const body = cheerio.load(html).text() + if (!title && body.startsWith('Moved to')) return + const url = `https://electronjs.org/docs/tutorial/${slug}` + return {type, title, githubUrl, url, slug, body} + }) + .compact() // remove nulls + .value() diff --git a/package.json b/package.json index 8a32532..818c0b0 100644 --- a/package.json +++ b/package.json @@ -11,18 +11,21 @@ "pretest": "npm run build", "test": "tape test.js | tap-spec && standard --fix", "lint": "standard --fix", - "demo": "budo demo.js --live --no-debug --open", + "demo": "budo demo.js --live --no-debug --open --css demo.css", "repl": "local-repl" }, "devDependencies": { "budo": "^11.2.0", + "cheerio": "^1.0.0-rc.2", + "electron-i18n": "^1.86.0", "instantsearch.js": "^2.7.4", "is-url": "^1.2.4", "local-repl": "^4.0.0", + "lodash": "^4.17.10", "nanohtml": "^1.2.4", "prettier-standard": "^8.0.1", "standard": "^11.0.1", "tap-spec": "^4.1.1", "tape": "^4.9.0" } -} \ No newline at end of file +} diff --git a/script/build.js b/script/build.js index 422107a..370c442 100755 --- a/script/build.js +++ b/script/build.js @@ -1,65 +1,8 @@ #!/usr/bin/env node -const apis = require('../electron-api.json') -const results = [] - -apis.forEach(api => { - // TODO constructorMethod - - const staticMethods = api.staticMethods || [] - staticMethods.forEach(method => { - method.title = `${api.name}.${method.name}${method.signature}` - method.type = 'staticMethod' - method.tldr = getTLDR(method) - const slug = method.name.replace(/\W/g, '').toLowerCase() - method.url = `https://electronjs.org/docs/api/${api.slug}#${api.slug}${slug}` - delete method.signature - results.push(method) - }) - - const instanceMethods = api.instanceMethods || [] - instanceMethods.forEach(method => { - method.title = `${api.instanceName}.${method.name}${method.signature}` - method.type = 'instanceMethod' - method.tldr = getTLDR(method) - const slug = method.name.replace(/\W/g, '').toLowerCase() - method.url = `https://electronjs.org/docs/api/${api.slug}#${api.slug}${slug}` - delete method.signature - results.push(method) - }) - - const events = api.events || [] - events.forEach(event => { - event.title = `${api.name}.on('${event.name}')` - event.type = 'event' - event.url = `https://electronjs.org/docs/api/${api.slug}#event-${event.name}` - event.tldr = getTLDR(event) - results.push(event) - }) - - const instanceEvents = api.instanceEvents || [] - instanceEvents.forEach(event => { - event.title = `${api.instanceName}.on('${event.name}')` - event.type = 'event' - event.url = `https://electronjs.org/docs/api/${api.slug}#event-${event.name}` - event.tldr = getTLDR(event) - results.push(event) - }) -}) +const {chain} = require('lodash') +const apis = require('../lib/electron-apis') +const tutorials = require('../lib/tutorials.js') +const results = chain([apis, tutorials]).flatten().value() process.stdout.write(JSON.stringify(results, null, 2)) - -function getTLDR (api) { - const { description, returns } = api - - if (!description && returns && returns.description) { - return ( - 'Returns ' + - returns.description.charAt(0).toLowerCase() + - returns.description.slice(1) - ) - } - - if (typeof description !== 'string' || !description.length) return null - return description.split('. ')[0] + '.' -} diff --git a/test.js b/test.js index 88fec79..69a6298 100644 --- a/test.js +++ b/test.js @@ -1,12 +1,22 @@ -const apis = require('.') +const entries = require('.') const test = require('tape') -// const isURL = require('is-url') +const isURL = require('is-url') +const types = ['api', 'tutorial'] test('electron-search', t => { - t.ok(Array.isArray(apis), 'is an array') - t.ok(apis.length > 5, 'with hella entries') + // All Entries + // ---------------------------------------------------------------------- + t.ok(Array.isArray(entries), 'is an array') + t.ok(entries.length > 5, 'with hella entries') + entries.forEach(entry => { + t.ok(types.includes(entry.type), `${entry.title} has a known type`) + }) - // console.log(apis.map(api => api.title)) + // APIs + // ---------------------------------------------------------------------- + const apis = entries.filter(entry => entry.type === 'api') + + t.ok(apis.length > 5, 'lots of APIs') let staticMethod = apis.find(api => api.title === 'Menu.getApplicationMenu()') t.equal(staticMethod.url, 'https://electronjs.org/docs/api/menu#menugetapplicationmenu', 'sets proper URL on static methods') @@ -20,7 +30,22 @@ test('electron-search', t => { // t.ok(isURL(api.url), `${api.title} has a valid URL`) }) + // Tutorials + // ---------------------------------------------------------------------- + const tutorials = entries.filter(entry => entry.type === 'tutorial') + + tutorials.forEach(tutorial => { + if (!tutorial.title) console.log(tutorial) + t.equal(typeof tutorial.title, 'string', `${tutorial.title} has a title`) + t.equal(typeof tutorial.body, 'string', `${tutorial.title} has a body`) + t.ok(isURL(tutorial.githubUrl), `${tutorial.title} has a valid GitHub URL`) + }) + + // Packages + // ---------------------------------------------------------------------- + + // Repos + // ---------------------------------------------------------------------- + t.end() }) - -// https://electronjs.org/docs/api/browser-window#event-page-title-updated