├── .nvmrc ├── script ├── lib │ ├── __init__.py │ ├── electron.gitattributes │ └── npm.py ├── codesign │ ├── .gitignore │ ├── get-trusted-identity.sh │ └── codesign.cnf ├── release │ └── notes │ │ └── .gitignore ├── native-test-targets.json ├── .eslintrc.json ├── tar.py ├── gn-asar-hash.js └── generate-zip-manifest.py ├── spec ├── fixtures │ ├── blank.png │ ├── blank.html │ ├── esm │ │ ├── empty.html │ │ ├── local.mjs │ │ ├── package │ │ │ ├── package.json │ │ │ └── index.mjs │ │ ├── dynamic.mjs │ │ ├── exit.mjs │ │ ├── entrypoint.mjs │ │ ├── pre-app-ready-apis.mjs │ │ └── top-level-await.mjs │ ├── pages │ │ ├── blank.html │ │ ├── service-worker │ │ │ ├── empty.html │ │ │ ├── worker-no-node.js │ │ │ └── service-worker.js │ │ ├── fullscreen.html │ │ ├── save_page │ │ │ ├── test.css │ │ │ ├── test.js │ │ │ └── index.html │ │ ├── external-string.html │ │ ├── base-page.html │ │ ├── button.html │ │ ├── pdf-in-iframe.html │ │ ├── jquery.html │ │ ├── webview-isolated.html │ │ ├── webview-visibilitychange.html │ │ ├── theme-color.html │ │ ├── webview-no-script.html │ │ ├── webview-zoom-factor.html │ │ ├── useragent.html │ │ ├── will-navigate.html │ │ ├── b.html │ │ ├── ping.html │ │ ├── webview-stripped-preload.html │ │ ├── e.html │ │ ├── partition │ │ │ └── one.html │ │ ├── window-opener-postMessage.html │ │ ├── permissions │ │ │ ├── geolocation.html │ │ │ ├── midi.html │ │ │ ├── midi-sysex.html │ │ │ ├── media.html │ │ │ └── notification.html │ │ ├── form-with-data.html │ │ ├── ipc-message.html │ │ ├── set-global.html │ │ ├── window-open.html │ │ ├── window-open-size.html │ │ ├── base-page-security.html │ │ ├── cache-storage.html │ │ ├── storage │ │ │ ├── cookie.html │ │ │ ├── local_storage.html │ │ │ ├── session_storage.html │ │ │ ├── indexed_db.html │ │ │ └── web_sql.html │ │ ├── window-opener-node.html │ │ ├── webview-did-navigate-in-page-with-hash.html │ │ ├── window-no-javascript.html │ │ ├── webview-allowpopups.html │ │ ├── webview-did-navigate-in-page-with-history.html │ │ ├── onmouseup.html │ │ ├── send-after-node.html │ │ ├── webview-trusted-types.html │ │ ├── insecure-resources.html │ │ ├── close.html │ │ ├── history.html │ │ ├── onkeyup.html │ │ ├── native-module.html │ │ ├── zoom-factor.html │ │ ├── d.html │ │ ├── webframe-zoom.html │ │ ├── window-open-hide.html │ │ ├── window-opener-location.html │ │ ├── dom-ready.html │ │ ├── webview-will-navigate.html │ │ ├── base-page-security-onload-message.html │ │ ├── datalist-time.html │ │ ├── world-safe-preload.js │ │ ├── post.html │ │ ├── window-opener.html │ │ ├── c.html │ │ ├── window-opener-webview.html │ │ ├── webview-will-navigate-in-frame.html │ │ ├── webview-zoom-inherited.html │ │ ├── geolocation │ │ │ └── index.html │ │ ├── history-replace.html │ │ ├── iframe-protocol.html │ │ ├── webview-did-navigate-in-page.html │ │ ├── worker.html │ │ ├── beforeunload-false.html │ │ ├── datalist-text.html │ │ ├── media-id-reset.html │ │ ├── world-safe-preload-error.js │ │ ├── visibilitychange.html │ │ ├── webview-opener-no-node-integration.html │ │ ├── webview-devtools.html │ │ ├── video.html │ │ ├── fetch.html │ │ └── webframe-spell-check.html │ ├── test.asar │ │ ├── file │ │ ├── unpack.asar.unpacked │ │ │ ├── a.txt │ │ │ └── atom.png │ │ ├── a.asar │ │ ├── echo.asar │ │ ├── empty.asar │ │ ├── logo.asar │ │ ├── video.asar │ │ ├── script.asar │ │ ├── unpack.asar │ │ └── worker_threads.asar │ ├── hello.txt │ ├── extensions │ │ ├── chrome-scripting │ │ │ ├── content.js │ │ │ └── manifest.json │ │ ├── persistent-background-page │ │ │ ├── background.js │ │ │ └── manifest.json │ │ ├── ui-page │ │ │ ├── script.js │ │ │ ├── page-script-load.html │ │ │ ├── bare-page.html │ │ │ ├── page-get-background.html │ │ │ └── manifest.json │ │ ├── missing-manifest │ │ │ └── main.js │ │ ├── red-bg │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── content-script-document-idle │ │ │ ├── idle.js │ │ │ └── manifest.json │ │ ├── minimum-chrome-version │ │ │ ├── main.js │ │ │ └── manifest.json │ │ ├── content-script-document-end │ │ │ ├── end.js │ │ │ └── manifest.json │ │ ├── content-script-document-start │ │ │ ├── start.js │ │ │ └── manifest.json │ │ ├── content-script │ │ │ ├── all_frames-disabled.css │ │ │ ├── all_frames-enabled.css │ │ │ └── frame.html │ │ ├── lazy-background-page │ │ │ ├── page-get-background.html │ │ │ ├── page-runtime-get-background.html │ │ │ ├── background.js │ │ │ ├── get-background-page.js │ │ │ ├── content_script.js │ │ │ ├── runtime-get-background-page.js │ │ │ └── manifest.json │ │ ├── devtools-extension │ │ │ ├── foo.js │ │ │ ├── manifest.json │ │ │ ├── index.html │ │ │ ├── index.js │ │ │ └── foo.html │ │ ├── chrome-i18n │ │ │ ├── v2 │ │ │ │ ├── _locales │ │ │ │ │ └── en │ │ │ │ │ │ └── messages.json │ │ │ │ └── manifest.json │ │ │ └── v3 │ │ │ │ ├── _locales │ │ │ │ └── es │ │ │ │ │ └── messages.json │ │ │ │ └── manifest.json │ │ ├── chrome-action-fail │ │ │ └── popup.html │ │ ├── load-error │ │ │ └── manifest.json │ │ ├── chrome-tabs │ │ │ ├── no-privileges │ │ │ │ ├── background.js │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ └── api-async │ │ │ │ └── manifest.json │ │ ├── host-permissions │ │ │ ├── privileged-tab-info │ │ │ │ ├── background.js │ │ │ │ ├── main.js │ │ │ │ └── manifest.json │ │ │ └── malformed │ │ │ │ └── manifest.json │ │ ├── mv3-service-worker │ │ │ └── background.js │ │ ├── chrome-webRequest │ │ │ ├── manifest.json │ │ │ └── background.js │ │ ├── chrome-webRequest-wss │ │ │ ├── manifest.json │ │ │ └── background.js │ │ ├── chrome-runtime │ │ │ ├── background.js │ │ │ └── manifest.json │ │ └── chrome-storage │ │ │ ├── manifest.json │ │ │ └── main.js │ ├── module │ │ ├── fail.js │ │ ├── noop.js │ │ ├── test.coffee │ │ ├── preload-set-global.js │ │ ├── uv-dlopen.js │ │ ├── preload-electron.js │ │ ├── process-stdout.js │ │ ├── set-global-preload-1.js │ │ ├── set-global.js │ │ ├── preload-error-exception.js │ │ ├── preload-error-syntax.js │ │ ├── set-global-preload-2.js │ │ ├── set-global-preload-3.js │ │ ├── declare-buffer.js │ │ ├── declare-global.js │ │ ├── declare-process.js │ │ ├── isolated-ping.js │ │ ├── hello.js │ │ ├── ping.js │ │ ├── preload-node-off-wrapper.js │ │ ├── original-fs.js │ │ ├── get-global-preload.js │ │ ├── process_args.js │ │ ├── hello-child.js │ │ ├── module-paths.js │ │ ├── asar.js │ │ ├── echo-renamed.js │ │ ├── check-arguments.js │ │ ├── delay-exit.js │ │ ├── create_socket.js │ │ ├── preload-webview.js │ │ ├── run-as-node.js │ │ ├── preload-sandboxæø åü.js │ │ ├── empty.js │ │ ├── preload-ipc.js │ │ ├── print-crash-parameters.js │ │ ├── send-later.js │ │ ├── echo.js │ │ ├── preload.js │ │ ├── locale-compare.js │ │ ├── set-immediate.js │ │ ├── preload-context.js │ │ ├── preload-required-module.js │ │ ├── preload-node-off.js │ │ └── no-asar.js │ ├── api │ │ ├── context-bridge │ │ │ ├── empty.html │ │ │ ├── context-bridge-mutability │ │ │ │ ├── package.json │ │ │ │ └── preload.js │ │ │ └── can-bind-preload.js │ │ ├── utility-process │ │ │ ├── crash.js │ │ │ ├── empty.js │ │ │ ├── endless.js │ │ │ ├── esm.mjs │ │ │ ├── exception.js │ │ │ ├── exception.mjs │ │ │ ├── log.js │ │ │ ├── env-app │ │ │ │ ├── test.js │ │ │ │ └── package.json │ │ │ ├── custom-exit.js │ │ │ ├── post-message.js │ │ │ ├── dns-result-order.js │ │ │ ├── inherit-stderr │ │ │ │ ├── package.json │ │ │ │ ├── test.js │ │ │ │ └── main.js │ │ │ ├── inherit-stdout │ │ │ │ ├── package.json │ │ │ │ ├── test.js │ │ │ │ └── main.js │ │ │ ├── suid.js │ │ │ ├── preload.js │ │ │ ├── receive-message.js │ │ │ ├── eval.js │ │ │ └── post-message-queue.js │ │ ├── loaded-from-dataurl.js │ │ ├── native-window-open-child.html │ │ ├── net-log │ │ │ └── package.json │ │ ├── quit-app │ │ │ ├── package.json │ │ │ └── main.js │ │ ├── test-menu-null │ │ │ ├── package.json │ │ │ └── main.js │ │ ├── app-path │ │ │ ├── package.json │ │ │ └── lib │ │ │ │ └── index.js │ │ ├── command-line │ │ │ ├── package.json │ │ │ └── main.js │ │ ├── cookie-app │ │ │ └── package.json │ │ ├── default-menu │ │ │ └── package.json │ │ ├── relaunch │ │ │ └── package.json │ │ ├── singleton │ │ │ └── package.json │ │ ├── test-menu-visibility │ │ │ └── package.json │ │ ├── locale-check │ │ │ └── package.json │ │ ├── unhandled-rejection.js │ │ ├── blank.html │ │ ├── did-fail-load-iframe.html │ │ ├── service-workers │ │ │ ├── sw.js │ │ │ ├── sw-logs.js │ │ │ ├── index.html │ │ │ └── logs.html │ │ ├── singleton-data │ │ │ └── package.json │ │ ├── window-all-closed │ │ │ └── package.json │ │ ├── ipc-main-listeners │ │ │ ├── package.json │ │ │ └── main.js │ │ ├── mixed-sandbox-app │ │ │ ├── electron-app-mixed-sandbox-preload.js │ │ │ └── package.json │ │ ├── safe-storage │ │ │ ├── encrypt-app │ │ │ │ └── package.json │ │ │ └── decrypt-app │ │ │ │ └── package.json │ │ ├── singleton-userdata │ │ │ └── package.json │ │ ├── first-party-sets │ │ │ ├── base │ │ │ │ └── package.json │ │ │ └── command-line │ │ │ │ ├── package.json │ │ │ │ └── main.js │ │ ├── new-window-webview-preload.js │ │ ├── exit-closes-all-windows-app │ │ │ └── package.json │ │ ├── electron-main-module │ │ │ ├── app.asar │ │ │ └── app │ │ │ │ └── index.js │ │ ├── shared-worker │ │ │ ├── shared-worker1.js │ │ │ └── shared-worker2.js │ │ ├── isolated-process.js │ │ ├── new-window-preload.js │ │ ├── localstorage.html │ │ ├── native-window-open-isolated-preload.js │ │ ├── beforeunload-undefined.html │ │ ├── window-open-location-final.html │ │ ├── isolated-fetch-preload.js │ │ ├── native-window-open-iframe.html │ │ ├── send-sync-message.html │ │ ├── window-open-location-open.html │ │ ├── unload.html │ │ ├── globals.html │ │ ├── native-window-open-noopener.html │ │ ├── native-window-open-no-allowpopups.html │ │ ├── close.html │ │ ├── new-window.html │ │ ├── native-window-open-isolated.html │ │ ├── window-open-location-change.html │ │ ├── frame-subscriber.html │ │ ├── offscreen-rendering.html │ │ ├── unhandled-rejection-handled.js │ │ ├── beforeunload-empty-string.html │ │ ├── beforeunload-false.html │ │ ├── preload.html │ │ ├── native-window-open-file.html │ │ ├── no-leak.html │ │ └── native-window-open-blank.html │ ├── sub-frames │ │ ├── test.js │ │ ├── debug-frames.html │ │ ├── preload.js │ │ ├── frame.html │ │ ├── frame-container.html │ │ ├── frame-with-frame-container.html │ │ └── frame-with-frame.html │ ├── devtools-extensions │ │ ├── bad-manifest │ │ │ └── manifest.json │ │ └── foo │ │ │ ├── devtools.js │ │ │ ├── foo.html │ │ │ ├── _locales │ │ │ └── en │ │ │ │ └── messages.json │ │ │ ├── manifest.json │ │ │ └── index.html │ ├── native-addon │ │ ├── uv-dlopen │ │ │ ├── foo.cpp │ │ │ ├── package.json │ │ │ └── binding.gyp │ │ └── echo │ │ │ ├── lib │ │ │ └── echo.js │ │ │ ├── package.json │ │ │ └── binding.gyp │ ├── apps │ │ ├── crash │ │ │ ├── node-crash.js │ │ │ ├── package.json │ │ │ ├── node-extra-args.js │ │ │ ├── fork.js │ │ │ └── sandbox-preload.js │ │ ├── self-module-paths │ │ │ ├── worker.js │ │ │ ├── package.json │ │ │ └── index.html │ │ ├── set-path │ │ │ └── package.json │ │ ├── refresh-page │ │ │ ├── package.json │ │ │ └── main.html │ │ ├── remote-control │ │ │ └── package.json │ │ ├── xwindow-icon │ │ │ ├── package.json │ │ │ ├── icon.png │ │ │ └── main.js │ │ ├── open-new-window-from-link │ │ │ ├── preload.js │ │ │ ├── package.json │ │ │ ├── new-window-page.html │ │ │ └── index.html │ │ └── libuv-hang │ │ │ └── renderer.js │ ├── crash-cases │ │ ├── native-window-open-exit │ │ │ ├── index.html │ │ │ └── preload.js │ │ ├── js-execute-iframe │ │ │ └── page2.html │ │ ├── setimmediate-renderer-crash │ │ │ └── preload.js │ │ ├── webcontents-create-leak-exit │ │ │ └── index.js │ │ ├── early-in-memory-session-create │ │ │ └── index.js │ │ ├── webcontentsview-create-leak-exit │ │ │ └── index.js │ │ ├── in-memory-session-double-free │ │ │ └── index.js │ │ ├── webview-contents-error-on-creation │ │ │ └── index.js │ │ ├── webview-attach-destroyed │ │ │ └── index.js │ │ ├── fs-promises-renderer-crash │ │ │ └── index.html │ │ └── transparent-window-get-background-color │ │ │ └── index.js │ ├── cat.pdf │ ├── assets │ │ ├── LICENSE │ │ ├── 1x1.png │ │ ├── 2x2.jpg │ │ ├── 3x3.png │ │ ├── icon.ico │ │ ├── logo.png │ │ ├── tone.wav │ │ ├── capybara.png │ │ ├── shortcut.lnk │ │ └── logo_Template.png │ ├── workers │ │ ├── worker.js │ │ ├── worker_node.js │ │ ├── shared_worker.js │ │ ├── shared_worker_node.js │ │ ├── workers.asar │ │ └── load_worker.html │ ├── cat-spin.mp4 │ ├── certificates │ │ └── client.p12 │ ├── video-source-image.webp │ ├── snapshot-items-available │ │ └── package.json │ ├── auto-update │ │ ├── check │ │ │ └── package.json │ │ ├── update │ │ │ └── package.json │ │ ├── initial │ │ │ ├── package.json │ │ │ └── index.js │ │ ├── update-json │ │ │ └── package.json │ │ ├── update-stack │ │ │ └── package.json │ │ └── check-with-headers │ │ │ └── package.json │ ├── chromium │ │ └── spellchecker.html │ ├── testsnap.js │ └── webview │ │ └── fullscreen │ │ └── frame.html ├── .gitignore ├── is-valid-window │ ├── .gitignore │ ├── lib │ │ └── is-valid-window.js │ ├── src │ │ ├── impl_posix.cc │ │ ├── impl.h │ │ ├── impl_win.cc │ │ └── impl_darwin.mm │ ├── README.md │ └── package.json ├── ambient.d.ts └── .eslintrc.json ├── .circleci ├── .gitignore └── config │ └── package.json ├── .dockerignore ├── docs ├── fiddles │ ├── windows │ │ ├── crashes-and-hangs │ │ │ └── .keep │ │ └── manage-windows │ │ │ ├── new-window │ │ │ ├── preload.js │ │ │ └── renderer.js │ │ │ ├── frameless-window │ │ │ ├── preload.js │ │ │ └── renderer.js │ │ │ └── manage-window-state │ │ │ └── preload.js │ ├── ipc │ │ ├── webview-new-window │ │ │ ├── child.html │ │ │ ├── index.html │ │ │ ├── renderer.js │ │ │ └── preload.js │ │ ├── pattern-1 │ │ │ ├── preload.js │ │ │ └── renderer.js │ │ ├── pattern-2 │ │ │ ├── preload.js │ │ │ └── renderer.js │ │ └── pattern-3 │ │ │ ├── renderer.js │ │ │ └── preload.js │ ├── native-ui │ │ ├── dialogs │ │ │ ├── error-dialog │ │ │ │ ├── renderer.js │ │ │ │ └── preload.js │ │ │ ├── save-dialog │ │ │ │ ├── preload.js │ │ │ │ └── renderer.js │ │ │ ├── open-file-or-directory │ │ │ │ ├── preload.js │ │ │ │ └── renderer.js │ │ │ └── information-dialog │ │ │ │ ├── preload.js │ │ │ │ └── renderer.js │ │ ├── drag-and-drop │ │ │ ├── preload.js │ │ │ └── renderer.js │ │ └── external-links-file-manager │ │ │ ├── preload.js │ │ │ └── renderer.js │ ├── system │ │ ├── system-information │ │ │ └── get-version-information │ │ │ │ ├── preload.js │ │ │ │ └── renderer.js │ │ ├── clipboard │ │ │ ├── copy │ │ │ │ ├── preload.js │ │ │ │ └── renderer.js │ │ │ └── paste │ │ │ │ ├── preload.js │ │ │ │ └── renderer.js │ │ ├── protocol-handler │ │ │ └── launch-app-from-URL-in-another-app │ │ │ │ ├── preload.js │ │ │ │ └── renderer.js │ │ └── system-app-user-information │ │ │ └── app-information │ │ │ ├── preload.js │ │ │ └── renderer.js │ ├── features │ │ ├── drag-and-drop │ │ │ ├── preload.js │ │ │ └── renderer.js │ │ ├── dark-mode │ │ │ ├── preload.js │ │ │ └── styles.css │ │ ├── keyboard-shortcuts │ │ │ ├── web-apis │ │ │ │ └── renderer.js │ │ │ ├── interception-from-main │ │ │ │ └── index.html │ │ │ ├── global │ │ │ │ └── index.html │ │ │ └── local │ │ │ │ └── index.html │ │ ├── online-detection │ │ │ ├── renderer.js │ │ │ └── index.html │ │ ├── notifications │ │ │ ├── renderer │ │ │ │ └── renderer.js │ │ │ └── main │ │ │ │ └── index.html │ │ └── macos-dock-menu │ │ │ └── index.html │ ├── menus │ │ └── customize-menus │ │ │ ├── preload.js │ │ │ └── renderer.js │ ├── tutorial-preload │ │ ├── renderer.js │ │ └── preload.js │ ├── media │ │ └── screenshot │ │ │ └── take-screenshot │ │ │ ├── preload.js │ │ │ └── renderer.js │ └── quick-start │ │ └── preload.js ├── api │ └── structures │ │ ├── size.md │ │ ├── crash-report.md │ │ ├── extension-info.md │ │ ├── file-filter.md │ │ ├── web-source.md │ │ ├── bluetooth-device.md │ │ ├── memory-usage-details.md │ │ ├── upload-raw-data.md │ │ ├── resolved-host.md │ │ ├── shared-worker-info.md │ │ ├── protocol-response-upload-data.md │ │ ├── scrubber-item.md │ │ ├── file-path-with-headers.md │ │ ├── protocol-request.md │ │ ├── mime-typed-buffer.md │ │ ├── sharing-item.md │ │ ├── resolved-endpoint.md │ │ ├── point.md │ │ ├── product-subscription-period.md │ │ ├── segmented-control-segment.md │ │ ├── upload-data.md │ │ ├── extension.md │ │ ├── certificate-principal.md │ │ ├── keyboard-input-event.md │ │ ├── cpu-usage.md │ │ ├── user-default-types.md │ │ ├── ipc-renderer-event.md │ │ ├── rectangle.md │ │ ├── service-worker-info.md │ │ ├── upload-file.md │ │ ├── hid-device.md │ │ └── ipc-main-invoke-event.md ├── images │ ├── dark_mode.gif │ ├── gatekeeper.png │ ├── drag-and-drop.gif │ ├── chrome-processes.png │ ├── local-shortcut.png │ ├── macos-dock-menu.png │ ├── preload-example.png │ ├── recent-documents.png │ ├── represented-file.png │ ├── vs-tools-options.png │ ├── connection-status.png │ ├── dock-progress-bar.png │ ├── linux-progress-bar.png │ ├── macos-progress-bar.png │ ├── performance-cpu-prof.png │ ├── performance-heap-prof.png │ ├── simplest-electron-app.png │ ├── versioning-sketch-0.png │ ├── versioning-sketch-1.png │ ├── versioning-sketch-2.png │ ├── versioning-sketch-3.png │ ├── versioning-sketch-4.png │ ├── versioning-sketch-5.png │ ├── versioning-sketch-6.png │ ├── versioning-sketch-7.png │ ├── windows-progress-bar.png │ ├── windows-taskbar-jumplist.png │ ├── mission-control-progress-bar.png │ ├── vs-options-debugging-symbols.png │ ├── windows-taskbar-icon-overlay.png │ ├── subpixel-rendering-screenshot.gif │ ├── web-contents-text-selection-after.png │ ├── windows-taskbar-thumbnail-toolbar.png │ └── web-contents-text-selection-before.png └── tutorial │ ├── using-pepper-flash-plugin.md │ └── support.md ├── patches ├── ffmpeg │ └── .patches ├── openscreen │ └── .patches ├── Mantle │ └── .patches ├── nan │ └── .patches ├── perfetto │ └── .patches ├── README.md ├── libvpx │ └── .patches ├── ReactiveObjC │ └── .patches ├── boringssl │ └── .patches ├── devtools-frontend │ └── .patches ├── angle │ └── .patches ├── DirectXShaderCompiler │ └── .patches └── webrtc │ └── .patches ├── spec-chromium └── configs │ └── browsertests.yml ├── .husky ├── pre-commit └── pre-push ├── .clang-tidy ├── .markdownlint.json ├── shell ├── browser │ ├── ui │ │ ├── electron_gtk.fragment │ │ └── electron_gdk_pixbuf.sigs │ ├── resources │ │ ├── mac │ │ │ └── electron.icns │ │ └── win │ │ │ └── electron.ico │ └── native_window_features.cc └── app │ ├── BRANDING.json │ ├── uv_stdio_fix.h │ └── node_main.h ├── default_app ├── icon.png ├── package.json └── .eslintrc.json ├── lib ├── browser │ ├── api │ │ ├── content-tracing.ts │ │ ├── tray.ts │ │ ├── view.ts │ │ ├── clipboard.ts │ │ ├── browser-view.ts │ │ ├── safe-storage.ts │ │ ├── native-theme.ts │ │ ├── global-shortcut.ts │ │ ├── auto-updater │ │ │ └── auto-updater-native.ts │ │ ├── power-save-blocker.ts │ │ ├── push-notifications.ts │ │ ├── ipc-main.ts │ │ ├── auto-updater.ts │ │ ├── views │ │ │ └── image-view.ts │ │ ├── notification.ts │ │ ├── web-contents-view.ts │ │ ├── exports │ │ │ └── electron.ts │ │ └── system-preferences.ts │ └── ipc-main-internal.ts ├── common │ ├── api │ │ ├── shell.ts │ │ ├── native-image.ts │ │ └── module-list.ts │ └── webpack-globals-provider.ts ├── renderer │ ├── api │ │ ├── web-frame.ts │ │ ├── exports │ │ │ └── electron.ts │ │ └── crash-reporter.ts │ └── .eslintrc.json ├── utility │ └── api │ │ ├── module-list.ts │ │ └── exports │ │ └── electron.ts ├── sandboxed_renderer │ ├── api │ │ └── exports │ │ │ └── electron.ts │ └── .eslintrc.json ├── worker │ └── .eslintrc.json └── isolated_renderer │ └── .eslintrc.json ├── .markdownlint.autofix.json ├── tsconfig.spec.json ├── .remarkrc ├── .env.example ├── tsconfig.electron.json ├── .github └── FUNDING.yml ├── .git-blame-ignore-revs ├── tsconfig.script.json ├── .devcontainer └── update-content-command.sh ├── tsconfig.default_app.json ├── filenames.libcxxabi.gni └── npm └── package.json /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /script/lib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/blank.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /spec/fixtures/blank.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/esm/empty.html: -------------------------------------------------------------------------------- 1 | Hi -------------------------------------------------------------------------------- /spec/fixtures/pages/blank.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /script/codesign/.gitignore: -------------------------------------------------------------------------------- 1 | .working -------------------------------------------------------------------------------- /script/release/notes/.gitignore: -------------------------------------------------------------------------------- 1 | .cache -------------------------------------------------------------------------------- /spec/fixtures/test.asar/file: -------------------------------------------------------------------------------- 1 | file 2 | -------------------------------------------------------------------------------- /.circleci/.gitignore: -------------------------------------------------------------------------------- 1 | config-staging 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !tools/xvfb-init.sh 3 | -------------------------------------------------------------------------------- /spec/fixtures/hello.txt: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /docs/fiddles/windows/crashes-and-hangs/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/pages/service-worker/empty.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-scripting/content.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/module/fail.js: -------------------------------------------------------------------------------- 1 | process.exit(1); 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/noop.js: -------------------------------------------------------------------------------- 1 | process.exit(0); 2 | -------------------------------------------------------------------------------- /spec/fixtures/pages/fullscreen.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/pages/save_page/test.css: -------------------------------------------------------------------------------- 1 | h1 { } 2 | -------------------------------------------------------------------------------- /patches/ffmpeg/.patches: -------------------------------------------------------------------------------- 1 | link_with_loader_path.patch 2 | -------------------------------------------------------------------------------- /spec/fixtures/api/context-bridge/empty.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/module/test.coffee: -------------------------------------------------------------------------------- 1 | module.exports = yes 2 | -------------------------------------------------------------------------------- /spec/fixtures/pages/save_page/test.js: -------------------------------------------------------------------------------- 1 | // do nothing 2 | -------------------------------------------------------------------------------- /spec/fixtures/sub-frames/test.js: -------------------------------------------------------------------------------- 1 | console.log('hello'); 2 | -------------------------------------------------------------------------------- /spec/fixtures/test.asar/unpack.asar.unpacked/a.txt: -------------------------------------------------------------------------------- 1 | a 2 | -------------------------------------------------------------------------------- /patches/openscreen/.patches: -------------------------------------------------------------------------------- 1 | cherry-pick-971d6055e7b7.patch 2 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/crash.js: -------------------------------------------------------------------------------- 1 | process.crash(); 2 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/empty.js: -------------------------------------------------------------------------------- 1 | process.exit(0); 2 | -------------------------------------------------------------------------------- /patches/Mantle/.patches: -------------------------------------------------------------------------------- 1 | remove_mtlmanagedobjectadapter_h.patch 2 | -------------------------------------------------------------------------------- /spec/fixtures/api/loaded-from-dataurl.js: -------------------------------------------------------------------------------- 1 | window.ping = 'pong'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/api/native-window-open-child.html: -------------------------------------------------------------------------------- 1 |

Hello

2 | -------------------------------------------------------------------------------- /spec/fixtures/devtools-extensions/bad-manifest/manifest.json: -------------------------------------------------------------------------------- 1 | } 2 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/persistent-background-page/background.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/module/preload-set-global.js: -------------------------------------------------------------------------------- 1 | window.foo = 'bar'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/native-addon/uv-dlopen/foo.cpp: -------------------------------------------------------------------------------- 1 | extern "C" void foo() {} -------------------------------------------------------------------------------- /script/lib/electron.gitattributes: -------------------------------------------------------------------------------- 1 | *.mm diff=objc 2 | *.m diff=objc 3 | -------------------------------------------------------------------------------- /script/native-test-targets.json: -------------------------------------------------------------------------------- 1 | [ 2 | "shell_browser_ui_unittests" 3 | ] -------------------------------------------------------------------------------- /spec/fixtures/module/uv-dlopen.js: -------------------------------------------------------------------------------- 1 | require('@electron-ci/uv-dlopen'); 2 | -------------------------------------------------------------------------------- /patches/nan/.patches: -------------------------------------------------------------------------------- 1 | use_new_constructor_for_scriptorigin_when_17_x.patch 2 | -------------------------------------------------------------------------------- /spec-chromium/configs/browsertests.yml: -------------------------------------------------------------------------------- 1 | tests: 2 | - content_browsertests 3 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/endless.js: -------------------------------------------------------------------------------- 1 | setInterval(() => {}, 2000); 2 | -------------------------------------------------------------------------------- /spec/fixtures/pages/external-string.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /patches/perfetto/.patches: -------------------------------------------------------------------------------- 1 | define_ssize_t_to_be_intptr_t_to_match_libuv.patch 2 | -------------------------------------------------------------------------------- /spec/fixtures/apps/crash/node-crash.js: -------------------------------------------------------------------------------- 1 | process.nextTick(() => process.crash()); 2 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/ui-page/script.js: -------------------------------------------------------------------------------- 1 | document.write('script loaded ok'); 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/preload-electron.js: -------------------------------------------------------------------------------- 1 | window.electron = require('electron'); 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/process-stdout.js: -------------------------------------------------------------------------------- 1 | process.stdout.write('pipes stdio'); 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/set-global-preload-1.js: -------------------------------------------------------------------------------- 1 | window.preload1 = 'preload-1'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/set-global.js: -------------------------------------------------------------------------------- 1 | if (!window.test) window.test = 'preload'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/pages/base-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run precommit -------------------------------------------------------------------------------- /patches/README.md: -------------------------------------------------------------------------------- 1 | See [/docs/development/patches.md](/docs/development/patches.md). 2 | -------------------------------------------------------------------------------- /spec/fixtures/apps/self-module-paths/worker.js: -------------------------------------------------------------------------------- 1 | self.postMessage(self.module.paths); 2 | -------------------------------------------------------------------------------- /spec/fixtures/esm/local.mjs: -------------------------------------------------------------------------------- 1 | export function add (a, b) { 2 | return a + b; 3 | }; 4 | -------------------------------------------------------------------------------- /spec/fixtures/module/preload-error-exception.js: -------------------------------------------------------------------------------- 1 | throw new Error('Hello World!'); 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/preload-error-syntax.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line 2 | foobar 3 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run prepack 5 | -------------------------------------------------------------------------------- /docs/api/structures/size.md: -------------------------------------------------------------------------------- 1 | # Size Object 2 | 3 | * `width` number 4 | * `height` number 5 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/ui-page/page-script-load.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/set-global-preload-2.js: -------------------------------------------------------------------------------- 1 | window.preload2 = window.preload1 + '-2'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/set-global-preload-3.js: -------------------------------------------------------------------------------- 1 | window.preload3 = window.preload2 + '-3'; 2 | -------------------------------------------------------------------------------- /.clang-tidy: -------------------------------------------------------------------------------- 1 | --- 2 | Checks: '-modernize-use-nullptr' 3 | InheritParentConfig: true 4 | ... 5 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@electron/lint-roller/configs/markdownlint.json" 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/esm.mjs: -------------------------------------------------------------------------------- 1 | console.log(import.meta.url); 2 | process.exit(0); 3 | -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/native-window-open-exit/index.html: -------------------------------------------------------------------------------- 1 | 2 | MAIN PAGE 3 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/missing-manifest/main.js: -------------------------------------------------------------------------------- 1 | console.log('oh no where is my manifest'); 2 | -------------------------------------------------------------------------------- /docs/api/structures/crash-report.md: -------------------------------------------------------------------------------- 1 | # CrashReport Object 2 | 3 | * `date` Date 4 | * `id` string 5 | -------------------------------------------------------------------------------- /shell/browser/ui/electron_gtk.fragment: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/exception.js: -------------------------------------------------------------------------------- 1 | nonExistingFunc(); // eslint-disable-line no-undef 2 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/exception.mjs: -------------------------------------------------------------------------------- 1 | nonExistingFunc(); // eslint-disable-line no-undef 2 | -------------------------------------------------------------------------------- /spec/fixtures/esm/package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "index.mjs", 3 | "type": "module" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/red-bg/main.js: -------------------------------------------------------------------------------- 1 | document.documentElement.style.backgroundColor = 'red'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/ui-page/bare-page.html: -------------------------------------------------------------------------------- 1 | 2 | ui page loaded ok 3 | -------------------------------------------------------------------------------- /default_app/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/default_app/icon.png -------------------------------------------------------------------------------- /spec/fixtures/cat.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/cat.pdf -------------------------------------------------------------------------------- /spec/fixtures/extensions/ui-page/page-get-background.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/declare-buffer.js: -------------------------------------------------------------------------------- 1 | const Buffer = 'declared Buffer'; 2 | module.exports = Buffer; 3 | -------------------------------------------------------------------------------- /spec/fixtures/module/declare-global.js: -------------------------------------------------------------------------------- 1 | const global = 'declared global'; 2 | module.exports = global; 3 | -------------------------------------------------------------------------------- /docs/api/structures/extension-info.md: -------------------------------------------------------------------------------- 1 | # ExtensionInfo Object 2 | 3 | * `name` string 4 | * `version` string 5 | -------------------------------------------------------------------------------- /docs/api/structures/file-filter.md: -------------------------------------------------------------------------------- 1 | # FileFilter Object 2 | 3 | * `name` string 4 | * `extensions` string[] 5 | -------------------------------------------------------------------------------- /docs/api/structures/web-source.md: -------------------------------------------------------------------------------- 1 | # WebSource Object 2 | 3 | * `code` string 4 | * `url` string (optional) 5 | -------------------------------------------------------------------------------- /lib/browser/api/content-tracing.ts: -------------------------------------------------------------------------------- 1 | export default process._linkedBinding('electron_browser_content_tracing'); 2 | -------------------------------------------------------------------------------- /spec/fixtures/api/net-log/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-net-log", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/apps/crash/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-crash", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/assets/LICENSE: -------------------------------------------------------------------------------- 1 | tone.wav 2 | http://soundbible.com/1815-A-Tone.html 3 | License: Public Domain 4 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/content-script-document-idle/idle.js: -------------------------------------------------------------------------------- 1 | document.body.style.backgroundColor = 'red'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/declare-process.js: -------------------------------------------------------------------------------- 1 | const process = 'declared process'; 2 | module.exports = process; 3 | -------------------------------------------------------------------------------- /spec/fixtures/native-addon/echo/lib/echo.js: -------------------------------------------------------------------------------- 1 | module.exports = require('../build/Release/echo.node').Print; 2 | -------------------------------------------------------------------------------- /spec/fixtures/pages/button.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /spec/fixtures/workers/worker.js: -------------------------------------------------------------------------------- 1 | this.onmessage = function (msg) { 2 | this.postMessage(msg.data); 3 | }; 4 | -------------------------------------------------------------------------------- /docs/images/dark_mode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/dark_mode.gif -------------------------------------------------------------------------------- /docs/images/gatekeeper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/gatekeeper.png -------------------------------------------------------------------------------- /spec/fixtures/api/quit-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-quit-app", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/test-menu-null/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-menu", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/apps/set-path/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-set-path", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/cat-spin.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/cat-spin.mp4 -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/js-execute-iframe/page2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | HELLO 4 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/minimum-chrome-version/main.js: -------------------------------------------------------------------------------- 1 | document.documentElement.style.backgroundColor = 'blue'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/isolated-ping.js: -------------------------------------------------------------------------------- 1 | const { ipcRenderer } = require('electron'); 2 | ipcRenderer.send('pong'); 3 | -------------------------------------------------------------------------------- /.markdownlint.autofix.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": false, 3 | "no-trailing-spaces": { 4 | "br_spaces": 0 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/api/structures/bluetooth-device.md: -------------------------------------------------------------------------------- 1 | # BluetoothDevice Object 2 | 3 | * `deviceName` string 4 | * `deviceId` string 5 | -------------------------------------------------------------------------------- /docs/images/drag-and-drop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/drag-and-drop.gif -------------------------------------------------------------------------------- /lib/browser/api/tray.ts: -------------------------------------------------------------------------------- 1 | const { Tray } = process._linkedBinding('electron_browser_tray'); 2 | 3 | export default Tray; 4 | -------------------------------------------------------------------------------- /lib/browser/api/view.ts: -------------------------------------------------------------------------------- 1 | const { View } = process._linkedBinding('electron_browser_view'); 2 | 3 | export default View; 4 | -------------------------------------------------------------------------------- /lib/common/api/shell.ts: -------------------------------------------------------------------------------- 1 | const shell = process._linkedBinding('electron_common_shell'); 2 | 3 | export default shell; 4 | -------------------------------------------------------------------------------- /spec/fixtures/api/app-path/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-app-path", 3 | "main": "lib/index.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/command-line/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-command-line", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/cookie-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-cookie-app", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/default-menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-default-menu", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/relaunch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-relaunch", 3 | "main": "main.js" 4 | } 5 | 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/singleton/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-singleton", 3 | "main": "main.js" 4 | } 5 | 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/test-menu-visibility/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-menu", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/log.js: -------------------------------------------------------------------------------- 1 | console.log('hello'); 2 | process.stderr.write('world'); 3 | process.exit(0); 4 | -------------------------------------------------------------------------------- /spec/fixtures/assets/1x1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/assets/1x1.png -------------------------------------------------------------------------------- /spec/fixtures/assets/2x2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/assets/2x2.jpg -------------------------------------------------------------------------------- /spec/fixtures/assets/3x3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/assets/3x3.png -------------------------------------------------------------------------------- /spec/fixtures/assets/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/assets/icon.ico -------------------------------------------------------------------------------- /spec/fixtures/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/assets/logo.png -------------------------------------------------------------------------------- /spec/fixtures/assets/tone.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/assets/tone.wav -------------------------------------------------------------------------------- /spec/fixtures/extensions/content-script-document-end/end.js: -------------------------------------------------------------------------------- 1 | document.documentElement.style.backgroundColor = 'red'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/content-script-document-start/start.js: -------------------------------------------------------------------------------- 1 | document.documentElement.style.backgroundColor = 'red'; 2 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/content-script/all_frames-disabled.css: -------------------------------------------------------------------------------- 1 | #all_frames_disabled { 2 | background: blue; 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/content-script/all_frames-enabled.css: -------------------------------------------------------------------------------- 1 | #all_frames_enabled { 2 | background: red; 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/lazy-background-page/page-get-background.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/fiddles/ipc/webview-new-window/child.html: -------------------------------------------------------------------------------- 1 | 2 | new window 3 | 4 | -------------------------------------------------------------------------------- /docs/images/chrome-processes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/chrome-processes.png -------------------------------------------------------------------------------- /docs/images/local-shortcut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/local-shortcut.png -------------------------------------------------------------------------------- /docs/images/macos-dock-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/macos-dock-menu.png -------------------------------------------------------------------------------- /docs/images/preload-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/preload-example.png -------------------------------------------------------------------------------- /docs/images/recent-documents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/recent-documents.png -------------------------------------------------------------------------------- /docs/images/represented-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/represented-file.png -------------------------------------------------------------------------------- /docs/images/vs-tools-options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/vs-tools-options.png -------------------------------------------------------------------------------- /patches/libvpx/.patches: -------------------------------------------------------------------------------- 1 | fix_to_buffer_alloc_for_vp9_bitstream_worker_data.patch 2 | vp9_fix_to_integer_overflow_test.patch 3 | -------------------------------------------------------------------------------- /spec/fixtures/api/locale-check/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-locale-check", 3 | "main": "main.js" 4 | } 5 | 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/unhandled-rejection.js: -------------------------------------------------------------------------------- 1 | const main = async () => { 2 | throw new Error('oops'); 3 | }; 4 | 5 | main(); 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/env-app/test.js: -------------------------------------------------------------------------------- 1 | process.parentPort.postMessage(process.env.FROM); 2 | process.exit(0); 3 | -------------------------------------------------------------------------------- /spec/fixtures/apps/refresh-page/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-refresh-page", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/apps/remote-control/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-remote-control", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/module/hello.js: -------------------------------------------------------------------------------- 1 | class Hello { 2 | say () { 3 | return 'hi'; 4 | } 5 | } 6 | module.exports = Hello; 7 | -------------------------------------------------------------------------------- /spec/fixtures/module/ping.js: -------------------------------------------------------------------------------- 1 | process.on('message', function (msg) { 2 | process.send(msg); 3 | process.exit(0); 4 | }); 5 | -------------------------------------------------------------------------------- /spec/fixtures/test.asar/a.asar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/test.asar/a.asar -------------------------------------------------------------------------------- /spec/is-valid-window/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /build 3 | *.swp 4 | *.log 5 | *~ 6 | .node-version 7 | package-lock.json 8 | -------------------------------------------------------------------------------- /spec/is-valid-window/lib/is-valid-window.js: -------------------------------------------------------------------------------- 1 | module.exports = require('../build/Release/is_valid_window.node').isValidWindow; 2 | -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": [ 4 | "spec", 5 | "typings" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /docs/images/connection-status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/connection-status.png -------------------------------------------------------------------------------- /docs/images/dock-progress-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/dock-progress-bar.png -------------------------------------------------------------------------------- /docs/images/linux-progress-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/linux-progress-bar.png -------------------------------------------------------------------------------- /docs/images/macos-progress-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/macos-progress-bar.png -------------------------------------------------------------------------------- /spec/fixtures/api/blank.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/did-fail-load-iframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/service-workers/sw.js: -------------------------------------------------------------------------------- 1 | self.addEventListener('install', function () { 2 | console.log('Installed'); 3 | }); 4 | -------------------------------------------------------------------------------- /spec/fixtures/api/singleton-data/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-singleton-data", 3 | "main": "main.js" 4 | } 5 | 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/window-all-closed/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-window-all-closed", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/apps/xwindow-icon/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-xwindow-icon", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/assets/capybara.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/assets/capybara.png -------------------------------------------------------------------------------- /spec/fixtures/assets/shortcut.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/assets/shortcut.lnk -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/setimmediate-renderer-crash/preload.js: -------------------------------------------------------------------------------- 1 | setImmediate(() => { 2 | throw new Error('oh no'); 3 | }); 4 | -------------------------------------------------------------------------------- /spec/fixtures/module/preload-node-off-wrapper.js: -------------------------------------------------------------------------------- 1 | setImmediate(function () { 2 | require('./preload-required-module'); 3 | }); 4 | -------------------------------------------------------------------------------- /spec/fixtures/test.asar/echo.asar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/test.asar/echo.asar -------------------------------------------------------------------------------- /spec/fixtures/test.asar/empty.asar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/test.asar/empty.asar -------------------------------------------------------------------------------- /spec/fixtures/test.asar/logo.asar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/test.asar/logo.asar -------------------------------------------------------------------------------- /spec/fixtures/test.asar/video.asar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/test.asar/video.asar -------------------------------------------------------------------------------- /.remarkrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | ["remark-lint-code-block-style", "fenced"], 4 | ["remark-lint-fenced-code-flag"] 5 | ] 6 | } -------------------------------------------------------------------------------- /docs/images/performance-cpu-prof.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/performance-cpu-prof.png -------------------------------------------------------------------------------- /docs/images/performance-heap-prof.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/performance-heap-prof.png -------------------------------------------------------------------------------- /docs/images/simplest-electron-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/simplest-electron-app.png -------------------------------------------------------------------------------- /docs/images/versioning-sketch-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/versioning-sketch-0.png -------------------------------------------------------------------------------- /docs/images/versioning-sketch-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/versioning-sketch-1.png -------------------------------------------------------------------------------- /docs/images/versioning-sketch-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/versioning-sketch-2.png -------------------------------------------------------------------------------- /docs/images/versioning-sketch-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/versioning-sketch-3.png -------------------------------------------------------------------------------- /docs/images/versioning-sketch-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/versioning-sketch-4.png -------------------------------------------------------------------------------- /docs/images/versioning-sketch-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/versioning-sketch-5.png -------------------------------------------------------------------------------- /docs/images/versioning-sketch-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/versioning-sketch-6.png -------------------------------------------------------------------------------- /docs/images/versioning-sketch-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/versioning-sketch-7.png -------------------------------------------------------------------------------- /docs/images/windows-progress-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/windows-progress-bar.png -------------------------------------------------------------------------------- /lib/browser/api/clipboard.ts: -------------------------------------------------------------------------------- 1 | const clipboard = process._linkedBinding('electron_common_clipboard'); 2 | 3 | export default clipboard; 4 | -------------------------------------------------------------------------------- /spec/fixtures/api/ipc-main-listeners/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-ipc-main-listeners", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/mixed-sandbox-app/electron-app-mixed-sandbox-preload.js: -------------------------------------------------------------------------------- 1 | require('electron').ipcRenderer.send('argv', process.argv); 2 | -------------------------------------------------------------------------------- /spec/fixtures/api/mixed-sandbox-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-mixed-sandbox", 3 | "main": "main.js" 4 | } 5 | 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/safe-storage/encrypt-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-safe-storage", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/singleton-userdata/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-singleton-userdata", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/apps/open-new-window-from-link/preload.js: -------------------------------------------------------------------------------- 1 | window.addEventListener('click', e => { 2 | console.log('click', e); 3 | }); 4 | -------------------------------------------------------------------------------- /spec/fixtures/apps/self-module-paths/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-self-module-paths", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/certificates/client.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/certificates/client.p12 -------------------------------------------------------------------------------- /spec/fixtures/extensions/lazy-background-page/page-runtime-get-background.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/original-fs.js: -------------------------------------------------------------------------------- 1 | process.on('message', function () { 2 | process.send(typeof require('original-fs')); 3 | }); 4 | -------------------------------------------------------------------------------- /spec/fixtures/test.asar/script.asar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/test.asar/script.asar -------------------------------------------------------------------------------- /spec/fixtures/test.asar/unpack.asar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/test.asar/unpack.asar -------------------------------------------------------------------------------- /spec/fixtures/video-source-image.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/video-source-image.webp -------------------------------------------------------------------------------- /spec/fixtures/workers/worker_node.js: -------------------------------------------------------------------------------- 1 | self.postMessage([typeof process, typeof setImmediate, typeof global, typeof Buffer].join(' ')); 2 | -------------------------------------------------------------------------------- /default_app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron", 3 | "productName": "Electron", 4 | "main": "main.js", 5 | "type": "module" 6 | } 7 | -------------------------------------------------------------------------------- /spec/ambient.d.ts: -------------------------------------------------------------------------------- 1 | declare let standardScheme: string; 2 | declare let serviceWorkerScheme: string; 3 | 4 | declare module 'dbus-native'; 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/first-party-sets/base/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-first-party-sets-base", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/new-window-webview-preload.js: -------------------------------------------------------------------------------- 1 | const { ipcRenderer } = require('electron'); 2 | 3 | window.ipcRenderer = ipcRenderer; 4 | -------------------------------------------------------------------------------- /spec/fixtures/api/safe-storage/decrypt-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-safe-storage", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/custom-exit.js: -------------------------------------------------------------------------------- 1 | const arg = process.argv[2]; 2 | const code = arg.split('=')[1]; 3 | process.exit(code); 4 | -------------------------------------------------------------------------------- /spec/fixtures/assets/logo_Template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/assets/logo_Template.png -------------------------------------------------------------------------------- /spec/fixtures/devtools-extensions/foo/devtools.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | chrome.devtools.panels.create('Foo', 'foo.png', 'index.html'); 3 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/devtools-extension/foo.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | chrome.devtools.panels.create('Foo', 'icon.png', 'index.html'); 3 | -------------------------------------------------------------------------------- /spec/fixtures/module/get-global-preload.js: -------------------------------------------------------------------------------- 1 | require('electron').ipcRenderer.send('vars', window.preload1, window.preload2, window.preload3); 2 | -------------------------------------------------------------------------------- /spec/fixtures/module/process_args.js: -------------------------------------------------------------------------------- 1 | process.on('message', function () { 2 | process.send(process.argv); 3 | process.exit(0); 4 | }); 5 | -------------------------------------------------------------------------------- /spec/fixtures/snapshot-items-available/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-snapshot-items-available", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /docs/api/structures/memory-usage-details.md: -------------------------------------------------------------------------------- 1 | # MemoryUsageDetails Object 2 | 3 | * `count` number 4 | * `size` number 5 | * `liveSize` number 6 | -------------------------------------------------------------------------------- /docs/images/windows-taskbar-jumplist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/docs/images/windows-taskbar-jumplist.png -------------------------------------------------------------------------------- /lib/renderer/api/web-frame.ts: -------------------------------------------------------------------------------- 1 | const { mainFrame } = process._linkedBinding('electron_renderer_web_frame'); 2 | 3 | export default mainFrame; 4 | -------------------------------------------------------------------------------- /shell/app/BRANDING.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_name": "electron", 3 | "product_name": "Electron", 4 | "mac_bundle_id": "com.github.Electron" 5 | } 6 | -------------------------------------------------------------------------------- /shell/browser/resources/mac/electron.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/shell/browser/resources/mac/electron.icns -------------------------------------------------------------------------------- /shell/browser/resources/win/electron.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/shell/browser/resources/win/electron.ico -------------------------------------------------------------------------------- /spec/fixtures/api/exit-closes-all-windows-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-exit-closes-all-windows", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/env-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-utility-process-env-app", 3 | "main": "main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/apps/xwindow-icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alex313031/electron-win7-old/HEAD/spec/fixtures/apps/xwindow-icon/icon.png -------------------------------------------------------------------------------- /spec/fixtures/auto-update/check/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-check", 3 | "version": "1.0.0", 4 | "main": "./index.js" 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/auto-update/update/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-update", 3 | "version": "1.0.0", 4 | "main": "./index.js" 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/module/hello-child.js: -------------------------------------------------------------------------------- 1 | class Hello { 2 | say () { 3 | return 'hi child window'; 4 | } 5 | } 6 | module.exports = Hello; 7 | -------------------------------------------------------------------------------- /spec/fixtures/native-addon/echo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "./lib/echo.js", 3 | "name": "@electron-ci/echo", 4 | "version": "0.0.1" 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/pages/pdf-in-iframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/is-valid-window/README.md: -------------------------------------------------------------------------------- 1 | # is-valid-window 2 | 3 | Validates if a pointer to window is valid. Used by Electron to validate the 4 | result of `TopLevelWindow.getNativeWindowHandle`. 5 | 6 | ## License 7 | 8 | Public domain. 9 | -------------------------------------------------------------------------------- /tsconfig.script.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "noEmit": true, 6 | "skipLibCheck": true 7 | }, 8 | "include": [ 9 | "script" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/drag-and-drop/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | dragStart: () => ipcRenderer.send('ondragstart') 5 | }) 6 | -------------------------------------------------------------------------------- /spec/fixtures/devtools-extensions/foo/_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": { 3 | "message": "foo - $BAZ$ ($2)", 4 | "placeholders": { 5 | "baz": { 6 | "content": "$1" 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /spec/fixtures/pages/base-page-security.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/api/structures/mime-typed-buffer.md: -------------------------------------------------------------------------------- 1 | # MimeTypedBuffer Object 2 | 3 | * `mimeType` string (optional) - MIME type of the buffer. 4 | * `charset` string (optional) - Charset of the buffer. 5 | * `data` Buffer - The actual Buffer content. 6 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/dialogs/save-dialog/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | saveDialog: () => ipcRenderer.invoke('save-dialog') 5 | }) 6 | -------------------------------------------------------------------------------- /patches/DirectXShaderCompiler/.patches: -------------------------------------------------------------------------------- 1 | fix_hlmatrixlowerpass_leaving_call_to_dangling_functionval.patch 2 | cherry-pick-a65e511a14b4.patch 3 | cherry-pick-bc18aec94c82.patch 4 | cherry-pick-bd7aa9779873.patch 5 | cherry-pick-2a434fd0af6b.patch 6 | -------------------------------------------------------------------------------- /spec/fixtures/module/preload.js: -------------------------------------------------------------------------------- 1 | const types = { 2 | require: typeof require, 3 | module: typeof module, 4 | exports: typeof exports, 5 | process: typeof process, 6 | Buffer: typeof Buffer 7 | }; 8 | console.log(JSON.stringify(types)); 9 | -------------------------------------------------------------------------------- /spec/fixtures/pages/cache-storage.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /spec/fixtures/pages/storage/cookie.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /spec/fixtures/workers/shared_worker_node.js: -------------------------------------------------------------------------------- 1 | self.onconnect = function (event) { 2 | const port = event.ports[0]; 3 | port.start(); 4 | port.postMessage([typeof process, typeof setImmediate, typeof global, typeof Buffer].join(' ')); 5 | }; 6 | -------------------------------------------------------------------------------- /spec/is-valid-window/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "./lib/is-valid-window.js", 3 | "name": "is-valid-window", 4 | "version": "0.0.5", 5 | "licenses": "Public Domain", 6 | "dependencies": { 7 | "nan": "2.x" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /docs/fiddles/features/drag-and-drop/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electron', { 4 | startDrag: (fileName) => ipcRenderer.send('ondragstart', fileName) 5 | }) 6 | -------------------------------------------------------------------------------- /docs/fiddles/menus/customize-menus/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | showContextMenu: () => ipcRenderer.send('show-context-menu') 5 | }) 6 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/drag-and-drop/renderer.js: -------------------------------------------------------------------------------- 1 | const dragFileLink = document.getElementById('drag-file-link') 2 | 3 | dragFileLink.addEventListener('dragstart', event => { 4 | event.preventDefault() 5 | window.electronAPI.dragStart() 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/apps/crash/node-extra-args.js: -------------------------------------------------------------------------------- 1 | process.on('message', function () { 2 | process.send(process.argv); 3 | }); 4 | 5 | // Allow time to send args, then crash the app. 6 | setTimeout(() => process.nextTick(() => process.crash()), 10000); 7 | -------------------------------------------------------------------------------- /spec/fixtures/apps/refresh-page/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/module/locale-compare.js: -------------------------------------------------------------------------------- 1 | process.on('message', function () { 2 | process.send([ 3 | 'a'.localeCompare('a'), 4 | 'ä'.localeCompare('z', 'de'), 5 | 'ä'.localeCompare('a', 'sv', { sensitivity: 'base' }) 6 | ]); 7 | }); 8 | -------------------------------------------------------------------------------- /spec/fixtures/pages/storage/local_storage.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /spec/fixtures/pages/window-opener-node.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/api/structures/sharing-item.md: -------------------------------------------------------------------------------- 1 | # SharingItem Object 2 | 3 | * `texts` string[] (optional) - An array of text to share. 4 | * `filePaths` string[] (optional) - An array of files to share. 5 | * `urls` string[] (optional) - An array of URLs to share. 6 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/dialogs/error-dialog/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | openErrorDialog: () => ipcRenderer.send('open-error-dialog') 5 | }) 6 | -------------------------------------------------------------------------------- /docs/fiddles/system/clipboard/copy/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('clipboard', { 4 | writeText: (text) => ipcRenderer.invoke('clipboard:writeText', text) 5 | }) 6 | -------------------------------------------------------------------------------- /docs/fiddles/windows/manage-windows/new-window/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | newWindow: (args) => ipcRenderer.send('new-window', args) 5 | }) 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/ipc-main-listeners/main.js: -------------------------------------------------------------------------------- 1 | const { app, ipcMain } = require('electron'); 2 | 3 | app.whenReady().then(() => { 4 | process.stdout.write(JSON.stringify(ipcMain.eventNames())); 5 | process.stdout.end(); 6 | 7 | app.quit(); 8 | }); 9 | -------------------------------------------------------------------------------- /spec/fixtures/apps/libuv-hang/renderer.js: -------------------------------------------------------------------------------- 1 | const { run, ipcRenderer } = window.api; 2 | 3 | run().then(async () => { 4 | const count = await ipcRenderer.invoke('reload-successful'); 5 | if (count < 3) location.reload(); 6 | }).catch(console.log); 7 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-tabs/no-privileges/background.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | 3 | chrome.runtime.onMessage.addListener((_request, sender, sendResponse) => { 4 | chrome.tabs.get(sender.tab.id).then(sendResponse); 5 | return true; 6 | }); 7 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-did-navigate-in-page-with-hash.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.circleci/config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@electron/circleci-config", 3 | "version": "0.0.0", 4 | "private": true, 5 | "license": "MIT", 6 | "dependencies": { 7 | "fs-extra": "^10.1.0", 8 | "js-yaml": "^4.1.0" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.devcontainer/update-content-command.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | 5 | buildtools=$HOME/.electron_build_tools 6 | 7 | export PATH="$PATH:$buildtools/src" 8 | 9 | # Sync latest 10 | e d gclient sync --with_branch_heads --with_tags 11 | -------------------------------------------------------------------------------- /docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('shell', { 4 | open: () => ipcRenderer.send('shell:open') 5 | }) 6 | -------------------------------------------------------------------------------- /docs/tutorial/using-pepper-flash-plugin.md: -------------------------------------------------------------------------------- 1 | # Pepper Flash Plugin 2 | 3 | Electron no longer supports the Pepper Flash plugin, as Chrome has removed support. 4 | 5 | See [Chromium's Flash Roadmap](https://www.chromium.org/flash-roadmap) for more 6 | details. 7 | -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/early-in-memory-session-create/index.js: -------------------------------------------------------------------------------- 1 | const { app, session } = require('electron'); 2 | 3 | app.on('ready', () => { 4 | session.fromPartition('in-memory'); 5 | setImmediate(() => { 6 | process.exit(0); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /spec/fixtures/devtools-extensions/foo/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "foo", 4 | "permissions": [ 5 | "storage" 6 | ], 7 | "version": "1.0", 8 | "devtools_page": "foo.html", 9 | "default_locale": "en" 10 | } 11 | -------------------------------------------------------------------------------- /spec/fixtures/esm/top-level-await.mjs: -------------------------------------------------------------------------------- 1 | import * as electron from 'electron'; 2 | 3 | // Cheeky delay 4 | await new Promise((resolve) => setTimeout(resolve, 500)); 5 | 6 | console.log('Top level await, ready:', electron.app.isReady()); 7 | process.exit(0); 8 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/host-permissions/privileged-tab-info/background.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | 3 | chrome.runtime.onMessage.addListener((_request, _sender, sendResponse) => { 4 | chrome.tabs.query({}).then(sendResponse); 5 | return true; 6 | }); 7 | -------------------------------------------------------------------------------- /spec/fixtures/pages/storage/session_storage.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /spec/fixtures/pages/window-no-javascript.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | CLICK 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/testsnap.js: -------------------------------------------------------------------------------- 1 | // taken from https://chromium.googlesource.com/v8/v8.git/+/HEAD/test/cctest/test-serialize.cc 2 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 3 | function f () { return g() * 2; } 4 | function g () { return 43; } 5 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/dialogs/open-file-or-directory/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | openFileDialog: () => ipcRenderer.invoke('open-file-dialog') 5 | }) 6 | -------------------------------------------------------------------------------- /docs/fiddles/tutorial-preload/renderer.js: -------------------------------------------------------------------------------- 1 | const information = document.getElementById('info') 2 | information.innerText = `This app is using Chrome (v${window.versions.chrome()}), Node.js (v${window.versions.node()}), and Electron (v${window.versions.electron()})` 3 | -------------------------------------------------------------------------------- /lib/browser/api/views/image-view.ts: -------------------------------------------------------------------------------- 1 | import { View } from 'electron/main'; 2 | 3 | const { ImageView } = process._linkedBinding('electron_browser_image_view'); 4 | 5 | Object.setPrototypeOf(ImageView.prototype, View.prototype); 6 | 7 | export default ImageView; 8 | -------------------------------------------------------------------------------- /spec/fixtures/api/app-path/lib/index.js: -------------------------------------------------------------------------------- 1 | const { app } = require('electron'); 2 | 3 | const payload = { 4 | appPath: app.getAppPath() 5 | }; 6 | 7 | process.stdout.write(JSON.stringify(payload)); 8 | process.stdout.end(); 9 | 10 | process.exit(); 11 | -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/webcontentsview-create-leak-exit/index.js: -------------------------------------------------------------------------------- 1 | const { WebContentsView, app } = require('electron'); 2 | app.whenReady().then(function () { 3 | // eslint-disable-next-line no-new 4 | new WebContentsView({}); 5 | 6 | app.quit(); 7 | }); 8 | -------------------------------------------------------------------------------- /spec/fixtures/pages/storage/indexed_db.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /spec/is-valid-window/src/impl.h: -------------------------------------------------------------------------------- 1 | #ifndef SRC_IMPL_H_ 2 | #define SRC_IMPL_H_ 3 | 4 | #include 5 | 6 | namespace impl { 7 | 8 | bool IsValidWindow(char* handle, size_t size); 9 | 10 | } // namespace impl 11 | 12 | #endif // SRC_IMPL_H_ 13 | -------------------------------------------------------------------------------- /docs/fiddles/system/system-app-user-information/app-information/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | getAppPath: () => ipcRenderer.invoke('get-app-path') 5 | }) 6 | -------------------------------------------------------------------------------- /lib/browser/api/notification.ts: -------------------------------------------------------------------------------- 1 | const { 2 | Notification: ElectronNotification, 3 | isSupported 4 | } = process._linkedBinding('electron_browser_notification'); 5 | 6 | ElectronNotification.isSupported = isSupported; 7 | 8 | export default ElectronNotification; 9 | -------------------------------------------------------------------------------- /spec/fixtures/api/isolated-fetch-preload.js: -------------------------------------------------------------------------------- 1 | const { ipcRenderer } = require('electron'); 2 | 3 | // Ensure fetch works from isolated world origin 4 | fetch('https://localhost:1234').catch(err => { 5 | ipcRenderer.send('isolated-fetch-error', err.message); 6 | }); 7 | -------------------------------------------------------------------------------- /docs/api/structures/resolved-endpoint.md: -------------------------------------------------------------------------------- 1 | # ResolvedEndpoint Object 2 | 3 | * `address` string 4 | * `family` string - One of the following: 5 | * `ipv4` - Corresponds to `AF_INET` 6 | * `ipv6` - Corresponds to `AF_INET6` 7 | * `unspec` - Corresponds to `AF_UNSPEC` 8 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/dialogs/information-dialog/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | openInformationDialog: () => ipcRenderer.invoke('open-information-dialog') 5 | }) 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/native-window-open-iframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/eval.js: -------------------------------------------------------------------------------- 1 | const vm = require('node:vm'); 2 | 3 | const contextObject = { result: 0 }; 4 | vm.createContext(contextObject); 5 | vm.runInContext('eval(\'result = 42\')', contextObject); 6 | process.parentPort.postMessage(contextObject.result); 7 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/devtools-extension/foo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | foo 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/host-permissions/malformed/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "malformed", 3 | "version": "0.1", 4 | "manifest_version": 3, 5 | "description": "Extension with invalid host_permissions", 6 | "host_permissions": [ 7 | "malformed_host" 8 | ] 9 | } -------------------------------------------------------------------------------- /docs/fiddles/ipc/pattern-1/renderer.js: -------------------------------------------------------------------------------- 1 | const setButton = document.getElementById('btn') 2 | const titleInput = document.getElementById('title') 3 | setButton.addEventListener('click', () => { 4 | const title = titleInput.value 5 | window.electronAPI.setTitle(title) 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/native-window-open-exit/preload.js: -------------------------------------------------------------------------------- 1 | const { ipcRenderer } = require('electron'); 2 | 3 | window.addEventListener('DOMContentLoaded', () => { 4 | window.open('127.0.0.1:7001', '_blank'); 5 | setTimeout(() => ipcRenderer.send('test-done')); 6 | }); 7 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/persistent-background-page/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "persistent-background-page", 3 | "version": "1.0", 4 | "background": { 5 | "scripts": ["background.js"], 6 | "persistent": true 7 | }, 8 | "manifest_version": 2 9 | } 10 | -------------------------------------------------------------------------------- /docs/fiddles/media/screenshot/take-screenshot/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | takeScreenshot: () => ipcRenderer.invoke('take-screenshot', window.devicePixelRatio) 5 | }) 6 | -------------------------------------------------------------------------------- /lib/common/api/module-list.ts: -------------------------------------------------------------------------------- 1 | // Common modules, please sort alphabetically 2 | export const commonModuleList: ElectronInternal.ModuleEntry[] = [ 3 | { name: 'nativeImage', loader: () => require('./native-image') }, 4 | { name: 'shell', loader: () => require('./shell') } 5 | ]; 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/send-sync-message.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/api/window-open-location-open.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-allowpopups.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-did-navigate-in-page-with-history.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tsconfig.default_app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "default_app", 5 | "module": "ESNext", 6 | "moduleResolution": "node" 7 | }, 8 | "include": [ 9 | "default_app", 10 | "typings" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /docs/fiddles/menus/customize-menus/renderer.js: -------------------------------------------------------------------------------- 1 | // Tell main process to show the menu when demo button is clicked 2 | const contextMenuBtn = document.getElementById('context-menu') 3 | 4 | contextMenuBtn.addEventListener('click', () => { 5 | window.electronAPI.showContextMenu() 6 | }) 7 | -------------------------------------------------------------------------------- /docs/fiddles/windows/manage-windows/frameless-window/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | createFramelessWindow: (args) => ipcRenderer.send('create-frameless-window', args) 5 | }) 6 | -------------------------------------------------------------------------------- /lib/browser/api/web-contents-view.ts: -------------------------------------------------------------------------------- 1 | import { View } from 'electron/main'; 2 | 3 | const { WebContentsView } = process._linkedBinding('electron_browser_web_contents_view'); 4 | 5 | Object.setPrototypeOf(WebContentsView.prototype, View.prototype); 6 | 7 | export default WebContentsView; 8 | -------------------------------------------------------------------------------- /spec/fixtures/devtools-extensions/foo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a custom devtools extension 10 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/mv3-service-worker/background.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | 3 | chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => { 4 | if (message === 'fetch-confirmation') { 5 | sendResponse({ message: 'Hello from background.js' }); 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /spec/fixtures/pages/permissions/media.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /docs/api/structures/point.md: -------------------------------------------------------------------------------- 1 | # Point Object 2 | 3 | * `x` number 4 | * `y` number 5 | 6 | **Note:** Both `x` and `y` must be whole integers, when providing a point object 7 | as input to an Electron API we will automatically round your `x` and `y` values 8 | to the nearest whole integer. 9 | -------------------------------------------------------------------------------- /docs/api/structures/product-subscription-period.md: -------------------------------------------------------------------------------- 1 | # ProductSubscriptionPeriod Object 2 | 3 | * `numberOfUnits` number - The number of units per subscription period. 4 | * `unit` string - The increment of time that a subscription period is specified in. Can be `day`, `week`, `month`, `year`. 5 | -------------------------------------------------------------------------------- /docs/fiddles/features/dark-mode/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('darkMode', { 4 | toggle: () => ipcRenderer.invoke('dark-mode:toggle'), 5 | system: () => ipcRenderer.invoke('dark-mode:system') 6 | }) 7 | -------------------------------------------------------------------------------- /docs/fiddles/tutorial-preload/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('versions', { 4 | node: () => process.versions.node, 5 | chrome: () => process.versions.chrome, 6 | electron: () => process.versions.electron 7 | }) 8 | -------------------------------------------------------------------------------- /spec/fixtures/api/unload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/pages/onmouseup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/pages/send-after-node.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-trusted-types.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/fiddles/windows/manage-windows/new-window/renderer.js: -------------------------------------------------------------------------------- 1 | const newWindowBtn = document.getElementById('new-window') 2 | 3 | newWindowBtn.addEventListener('click', (event) => { 4 | const url = 'https://electronjs.org' 5 | window.electronAPI.newWindow({ url, width: 400, height: 320 }) 6 | }) 7 | -------------------------------------------------------------------------------- /lib/sandboxed_renderer/api/exports/electron.ts: -------------------------------------------------------------------------------- 1 | import { defineProperties } from '@electron/internal/common/define-properties'; 2 | import { moduleList } from '@electron/internal/sandboxed_renderer/api/module-list'; 3 | 4 | module.exports = {}; 5 | 6 | defineProperties(module.exports, moduleList); 7 | -------------------------------------------------------------------------------- /lib/utility/api/exports/electron.ts: -------------------------------------------------------------------------------- 1 | import { defineProperties } from '@electron/internal/common/define-properties'; 2 | import { utilityNodeModuleList } from '@electron/internal/utility/api/module-list'; 3 | 4 | module.exports = {}; 5 | 6 | defineProperties(module.exports, utilityNodeModuleList); 7 | -------------------------------------------------------------------------------- /spec/fixtures/pages/insecure-resources.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/fiddles/features/dark-mode/styles.css: -------------------------------------------------------------------------------- 1 | :root { 2 | color-scheme: light dark; 3 | } 4 | 5 | @media (prefers-color-scheme: dark) { 6 | body { background: #333; color: white; } 7 | } 8 | 9 | @media (prefers-color-scheme: light) { 10 | body { background: #ddd; color: black; } 11 | } 12 | -------------------------------------------------------------------------------- /filenames.libcxxabi.gni: -------------------------------------------------------------------------------- 1 | libcxxabi_headers = [ 2 | "//third_party/libc++abi/src/include/CMakeLists.txt", 3 | "//third_party/libc++abi/src/include/__cxxabi_config.h", 4 | "//third_party/libc++abi/src/include/cxxabi.h", 5 | ] 6 | 7 | libcxxabi_licenses = [ "//third_party/libc++abi/src/LICENSE.TXT" ] 8 | -------------------------------------------------------------------------------- /spec/fixtures/api/context-bridge/context-bridge-mutability/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge } = require('electron'); 2 | 3 | contextBridge.exposeInMainWorld('str', 'some-text'); 4 | contextBridge.exposeInMainWorld('obj', { prop: 'obj-prop' }); 5 | contextBridge.exposeInMainWorld('arr', [1, 2, 3, 4]); 6 | -------------------------------------------------------------------------------- /spec/fixtures/api/globals.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Document 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/apps/crash/fork.js: -------------------------------------------------------------------------------- 1 | const path = require('node:path'); 2 | const childProcess = require('node:child_process'); 3 | 4 | const crashPath = path.join(__dirname, 'node-crash.js'); 5 | const child = childProcess.fork(crashPath, { silent: true }); 6 | child.on('exit', () => process.exit(0)); 7 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/red-bg/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "red-bg", 3 | "version": "1.0", 4 | "content_scripts": [ 5 | { 6 | "matches": [""], 7 | "js": ["main.js"], 8 | "run_at": "document_start" 9 | } 10 | ], 11 | "manifest_version": 2 12 | } 13 | -------------------------------------------------------------------------------- /spec/fixtures/pages/close.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/pages/history.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /spec/fixtures/pages/onkeyup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/fiddles/ipc/pattern-2/renderer.js: -------------------------------------------------------------------------------- 1 | const btn = document.getElementById('btn') 2 | const filePathElement = document.getElementById('filePath') 3 | 4 | btn.addEventListener('click', async () => { 5 | const filePath = await window.electronAPI.openFile() 6 | filePathElement.innerText = filePath 7 | }) 8 | -------------------------------------------------------------------------------- /script/tar.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import tarfile 4 | 5 | source = sys.argv[1] 6 | target = sys.argv[2] 7 | 8 | os.chdir(os.path.dirname(source)) 9 | 10 | tarball = tarfile.open(name=os.path.basename(target), mode='w:gz') 11 | tarball.add(os.path.relpath(source)) 12 | tarball.close() 13 | -------------------------------------------------------------------------------- /spec/fixtures/api/native-window-open-noopener.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | noopener example 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/api/service-workers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/pages/native-module.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/pages/service-worker/worker-no-node.js: -------------------------------------------------------------------------------- 1 | self.clients.matchAll({ includeUncontrolled: true }).then((clients) => { 2 | if (!clients?.length) return; 3 | 4 | const msg = [typeof process, typeof setImmediate, typeof global, typeof Buffer].join(' '); 5 | clients[0].postMessage(msg); 6 | }); 7 | -------------------------------------------------------------------------------- /spec/fixtures/pages/zoom-factor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/dialogs/save-dialog/renderer.js: -------------------------------------------------------------------------------- 1 | const saveBtn = document.getElementById('save-dialog') 2 | 3 | saveBtn.addEventListener('click', async () => { 4 | const path = await window.electronAPI.saveDialog() 5 | document.getElementById('file-saved').innerHTML = `Path selected: ${path}` 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/api/service-workers/logs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /docs/api/structures/segmented-control-segment.md: -------------------------------------------------------------------------------- 1 | # SegmentedControlSegment Object 2 | 3 | * `label` string (optional) - The text to appear in this segment. 4 | * `icon` NativeImage (optional) - The image to appear in this segment. 5 | * `enabled` boolean (optional) - Whether this segment is selectable. Default: true. 6 | -------------------------------------------------------------------------------- /docs/api/structures/upload-data.md: -------------------------------------------------------------------------------- 1 | # UploadData Object 2 | 3 | * `bytes` Buffer - Content being sent. 4 | * `file` string (optional) - Path of file being uploaded. 5 | * `blobUUID` string (optional) - UUID of blob data. Use [ses.getBlobData](../session.md#sesgetblobdataidentifier) method 6 | to retrieve the data. 7 | -------------------------------------------------------------------------------- /docs/fiddles/system/clipboard/paste/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('clipboard', { 4 | readText: () => ipcRenderer.invoke('clipboard:readText'), 5 | writeText: (text) => ipcRenderer.invoke('clipboard:writeText', text) 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/post-message-queue.js: -------------------------------------------------------------------------------- 1 | setTimeout(() => { 2 | let called = 0; 3 | let result = ''; 4 | process.parentPort.on('message', (e) => { 5 | result += e.data; 6 | if (++called === 3) { 7 | process.parentPort.postMessage(result); 8 | } 9 | }); 10 | }, 3000); 11 | -------------------------------------------------------------------------------- /spec/fixtures/module/set-immediate.js: -------------------------------------------------------------------------------- 1 | process.on('uncaughtException', function (error) { 2 | process.send(error.message); 3 | process.exit(1); 4 | }); 5 | 6 | process.on('message', function () { 7 | setImmediate(function () { 8 | process.send('ok'); 9 | process.exit(0); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /spec/fixtures/native-addon/uv-dlopen/binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [ 3 | { 4 | "target_name": "test_module", 5 | "sources": [ "main.cpp" ], 6 | }, 7 | { 8 | "target_name": "libfoo", 9 | "type": "shared_library", 10 | "sources": [ "foo.cpp" ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /spec/fixtures/pages/d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webframe-zoom.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/pages/window-open-hide.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/pages/window-opener-location.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/external-links-file-manager/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | openHomeDir: () => ipcRenderer.send('open-home-dir'), 5 | openExternal: (url) => ipcRenderer.send('open-external', url) 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/pages/dom-ready.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-will-navigate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Test 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /patches/webrtc/.patches: -------------------------------------------------------------------------------- 1 | fix_fallback_to_x11_capturer_on_wayland.patch 2 | fix_mark_pipewire_capturer_as_failed_after_session_is_closed.patch 3 | fix_check_pipewire_init_before_creating_generic_capturer.patch 4 | tighten_som_dchecks_to_checks_in_vp9_packetization.patch 5 | m122_merge_limit_max_frame_size_in_dav1d_decoder.patch 6 | -------------------------------------------------------------------------------- /spec/fixtures/pages/base-page-security-onload-message.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /lib/common/webpack-globals-provider.ts: -------------------------------------------------------------------------------- 1 | // Captures original globals into a scope to ensure that userland modifications do 2 | // not impact Electron. Note that users doing: 3 | // 4 | // global.Promise.resolve = myFn 5 | // 6 | // Will mutate this captured one as well and that is OK. 7 | 8 | export const Promise = global.Promise; 9 | -------------------------------------------------------------------------------- /spec/fixtures/api/native-window-open-no-allowpopups.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-webRequest/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chrome-webRequest", 3 | "version": "1.0", 4 | "background": { 5 | "scripts": ["background.js"], 6 | "persistent": true 7 | }, 8 | "permissions": ["webRequest", "webRequestBlocking", ""], 9 | "manifest_version": 2 10 | } 11 | -------------------------------------------------------------------------------- /spec/fixtures/pages/datalist-time.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/pages/world-safe-preload.js: -------------------------------------------------------------------------------- 1 | const { ipcRenderer, webFrame } = require('electron'); 2 | 3 | webFrame.executeJavaScript(`(() => { 4 | return {}; 5 | })()`).then((obj) => { 6 | // Considered safe if the object is constructed in this world 7 | ipcRenderer.send('executejs-safe', obj.constructor === Object); 8 | }); 9 | -------------------------------------------------------------------------------- /docs/fiddles/features/keyboard-shortcuts/web-apis/renderer.js: -------------------------------------------------------------------------------- 1 | function handleKeyPress (event) { 2 | // You can put code here to handle the keypress. 3 | document.getElementById('last-keypress').innerText = event.key 4 | console.log(`You pressed ${event.key}`) 5 | } 6 | 7 | window.addEventListener('keyup', handleKeyPress, true) 8 | -------------------------------------------------------------------------------- /docs/fiddles/ipc/pattern-3/renderer.js: -------------------------------------------------------------------------------- 1 | const counter = document.getElementById('counter') 2 | 3 | window.electronAPI.onUpdateCounter((value) => { 4 | const oldValue = Number(counter.innerText) 5 | const newValue = oldValue + value 6 | counter.innerText = newValue.toString() 7 | window.electronAPI.counterValue(newValue) 8 | }) 9 | -------------------------------------------------------------------------------- /shell/browser/ui/electron_gdk_pixbuf.sigs: -------------------------------------------------------------------------------- 1 | GdkPixbuf* gdk_pixbuf_new(GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample, int width, int height) 2 | GdkPixbuf* gdk_pixbuf_scale_simple(const GdkPixbuf* src, int dest_width, int dest_height, GdkInterpType interp_type) 3 | guchar* gdk_pixbuf_get_pixels(const GdkPixbuf* pixbuf) 4 | -------------------------------------------------------------------------------- /spec/fixtures/api/close.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-webRequest-wss/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chrome-webRequest", 3 | "version": "1.0", 4 | "background": { 5 | "scripts": ["background.js"], 6 | "persistent": true 7 | }, 8 | "permissions": ["webRequest", "webRequestBlocking", ""], 9 | "manifest_version": 2 10 | } 11 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-webRequest/background.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | 3 | chrome.webRequest.onBeforeRequest.addListener( 4 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 5 | (details) => { 6 | return { cancel: true }; 7 | }, 8 | { urls: ['*://127.0.0.1:*'] }, 9 | ['blocking'] 10 | ); 11 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/content-script/frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Document 6 | 7 | 8 | This is a frame, it has no children 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/module/preload-context.js: -------------------------------------------------------------------------------- 1 | var test = 'test'; // eslint-disable-line no-var,@typescript-eslint/no-unused-vars 2 | 3 | const types = { 4 | require: typeof require, 5 | electron: typeof electron, 6 | window: typeof window, 7 | localVar: typeof window.test 8 | }; 9 | 10 | console.log(JSON.stringify(types)); 11 | -------------------------------------------------------------------------------- /spec/fixtures/pages/storage/web_sql.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/sub-frames/preload.js: -------------------------------------------------------------------------------- 1 | const { ipcRenderer, webFrame } = require('electron'); 2 | 3 | window.isolatedGlobal = true; 4 | 5 | ipcRenderer.send('preload-ran', window.location.href, webFrame.routingId); 6 | 7 | ipcRenderer.on('preload-ping', () => { 8 | ipcRenderer.send('preload-pong', webFrame.routingId); 9 | }); 10 | -------------------------------------------------------------------------------- /docs/api/structures/extension.md: -------------------------------------------------------------------------------- 1 | # Extension Object 2 | 3 | * `id` string 4 | * `manifest` any - Copy of the [extension's manifest data](https://developer.chrome.com/extensions/manifest). 5 | * `name` string 6 | * `path` string - The extension's file path. 7 | * `version` string 8 | * `url` string - The extension's `chrome-extension://` URL. 9 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/dialogs/open-file-or-directory/renderer.js: -------------------------------------------------------------------------------- 1 | const selectDirBtn = document.getElementById('select-directory') 2 | 3 | selectDirBtn.addEventListener('click', async () => { 4 | const path = await window.electronAPI.openFileDialog() 5 | document.getElementById('selected-file').innerHTML = `You selected: ${path}` 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/in-memory-session-double-free/index.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow } = require('electron'); 2 | 3 | app.on('ready', async () => { 4 | const win = new BrowserWindow({ show: false, webPreferences: { partition: '123321' } }); 5 | await win.loadURL('data:text/html,'); 6 | setTimeout(() => app.quit()); 7 | }); 8 | -------------------------------------------------------------------------------- /spec/fixtures/pages/post.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

5 |
6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/pages/window-opener.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/fiddles/features/online-detection/renderer.js: -------------------------------------------------------------------------------- 1 | function onlineStatusIndicator () { 2 | document.getElementById('status').innerHTML = navigator.onLine ? 'online' : 'offline' 3 | } 4 | 5 | window.addEventListener('online', onlineStatusIndicator) 6 | window.addEventListener('offline', onlineStatusIndicator) 7 | 8 | onlineStatusIndicator() 9 | -------------------------------------------------------------------------------- /docs/fiddles/ipc/pattern-3/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | onUpdateCounter: (callback) => ipcRenderer.on('update-counter', (_event, value) => callback(value)), 5 | counterValue: (value) => ipcRenderer.send('counter-value', value) 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/api/new-window.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-i18n/v2/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "__MSG_extName__", 3 | "default_locale": "en", 4 | "version": "1.0", 5 | "content_scripts": [ 6 | { 7 | "matches": [""], 8 | "js": ["main.js"], 9 | "run_at": "document_start" 10 | } 11 | ], 12 | "manifest_version": 2 13 | } 14 | -------------------------------------------------------------------------------- /spec/fixtures/pages/c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/fiddles/ipc/webview-new-window/preload.js: -------------------------------------------------------------------------------- 1 | const { ipcRenderer } = require('electron/renderer') 2 | const webview = document.getElementById('webview') 3 | ipcRenderer.on('webview-new-window', (e, webContentsId, details) => { 4 | console.log('webview-new-window', webContentsId, details) 5 | webview.dispatchEvent(new Event('new-window')) 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/api/native-window-open-isolated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/api/structures/certificate-principal.md: -------------------------------------------------------------------------------- 1 | # CertificatePrincipal Object 2 | 3 | * `commonName` string - Common Name. 4 | * `organizations` string[] - Organization names. 5 | * `organizationUnits` string[] - Organization Unit names. 6 | * `locality` string - Locality. 7 | * `state` string - State or province. 8 | * `country` string - Country or region. 9 | -------------------------------------------------------------------------------- /docs/api/structures/keyboard-input-event.md: -------------------------------------------------------------------------------- 1 | # KeyboardInputEvent Object extends `InputEvent` 2 | 3 | * `type` string - The type of the event, can be `rawKeyDown`, `keyDown`, `keyUp` or `char`. 4 | * `keyCode` string - The character that will be sent 5 | as the keyboard event. Should only use the valid key codes in 6 | [Accelerator](../accelerator.md). 7 | -------------------------------------------------------------------------------- /docs/fiddles/system/system-information/get-version-information/renderer.js: -------------------------------------------------------------------------------- 1 | const versionInfoBtn = document.getElementById('version-info') 2 | 3 | versionInfoBtn.addEventListener('click', () => { 4 | const message = `This app is using Electron version: ${window.electronVersion}` 5 | document.getElementById('got-version-info').innerHTML = message 6 | }) 7 | -------------------------------------------------------------------------------- /docs/fiddles/windows/manage-windows/manage-window-state/preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron/renderer') 2 | 3 | contextBridge.exposeInMainWorld('electronAPI', { 4 | createDemoWindow: () => ipcRenderer.send('create-demo-window'), 5 | onBoundsChanged: (callback) => ipcRenderer.on('bounds-changed', () => callback()) 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-runtime/background.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | 3 | chrome.runtime.onMessage.addListener((message, sender, reply) => { 4 | switch (message) { 5 | case 'getPlatformInfo': 6 | chrome.runtime.getPlatformInfo(reply); 7 | break; 8 | } 9 | 10 | // Respond asynchronously 11 | return true; 12 | }); 13 | -------------------------------------------------------------------------------- /spec/is-valid-window/src/impl_win.cc: -------------------------------------------------------------------------------- 1 | #include "impl.h" 2 | 3 | #include 4 | 5 | namespace impl { 6 | 7 | bool IsValidWindow(char* handle, size_t size) { 8 | if (size != sizeof(HWND)) 9 | return false; 10 | HWND window = *reinterpret_cast(handle); 11 | return ::IsWindow(window); 12 | } 13 | 14 | } // namespace impl 15 | -------------------------------------------------------------------------------- /docs/fiddles/features/drag-and-drop/renderer.js: -------------------------------------------------------------------------------- 1 | document.getElementById('drag1').ondragstart = (event) => { 2 | event.preventDefault() 3 | window.electron.startDrag('drag-and-drop-1.md') 4 | } 5 | 6 | document.getElementById('drag2').ondragstart = (event) => { 7 | event.preventDefault() 8 | window.electron.startDrag('drag-and-drop-2.md') 9 | } 10 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/lazy-background-page/get-background-page.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | window.completionPromise = new Promise((resolve) => { 3 | window.completionPromiseResolve = resolve; 4 | }); 5 | chrome.runtime.sendMessage({ some: 'message' }, () => { 6 | window.completionPromiseResolve(chrome.extension.getBackgroundPage().receivedMessage); 7 | }); 8 | -------------------------------------------------------------------------------- /docs/api/structures/cpu-usage.md: -------------------------------------------------------------------------------- 1 | # CPUUsage Object 2 | 3 | * `percentCPUUsage` number - Percentage of CPU used since the last call to getCPUUsage. 4 | First call returns 0. 5 | * `idleWakeupsPerSecond` number - The number of average idle CPU wakeups per second 6 | since the last call to getCPUUsage. First call returns 0. Will always return 0 on 7 | Windows. 8 | -------------------------------------------------------------------------------- /docs/api/structures/user-default-types.md: -------------------------------------------------------------------------------- 1 | # UserDefaultTypes Object 2 | 3 | * `string` string 4 | * `boolean` boolean 5 | * `integer` number 6 | * `float` number 7 | * `double` number 8 | * `url` string 9 | * `array` Array\ 10 | * `dictionary` Record\ 11 | 12 | This type is a helper alias, no object will never exist of this type. 13 | -------------------------------------------------------------------------------- /docs/fiddles/system/clipboard/paste/renderer.js: -------------------------------------------------------------------------------- 1 | const pasteBtn = document.getElementById('paste-to') 2 | 3 | pasteBtn.addEventListener('click', async () => { 4 | await window.clipboard.writeText('What a demo!') 5 | const message = `Clipboard contents: ${await window.clipboard.readText()}` 6 | document.getElementById('paste-from').innerHTML = message 7 | }) 8 | -------------------------------------------------------------------------------- /docs/tutorial/support.md: -------------------------------------------------------------------------------- 1 | # This doc has moved! 2 | 3 | * For information on supported releases, see the [Electron Releases](./electron-timelines.md) doc. 4 | * For community support on Electron, see the [Community page](https://www.electronjs.org/community). 5 | * For platform support info, see the [README](https://github.com/electron/electron/blob/main/README.md). 6 | -------------------------------------------------------------------------------- /script/codesign/get-trusted-identity.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | valid_certs=$(security find-identity -p codesigning -v) 6 | if [[ $valid_certs == *"1)"* ]]; then 7 | first_valid_cert=$(echo $valid_certs | sed 's/ \".*//' | sed 's/.* //') 8 | echo $first_valid_cert 9 | exit 0 10 | else 11 | # No Certificate 12 | exit 0 13 | fi 14 | -------------------------------------------------------------------------------- /spec/fixtures/api/context-bridge/can-bind-preload.js: -------------------------------------------------------------------------------- 1 | const { contextBridge, ipcRenderer } = require('electron'); 2 | 3 | console.info(contextBridge); 4 | 5 | let bound = false; 6 | try { 7 | contextBridge.exposeInMainWorld('test', {}); 8 | bound = true; 9 | } catch { 10 | // Ignore 11 | } 12 | 13 | ipcRenderer.send('context-bridge-bound', bound); 14 | -------------------------------------------------------------------------------- /spec/fixtures/pages/window-opener-webview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/fiddles/windows/manage-windows/frameless-window/renderer.js: -------------------------------------------------------------------------------- 1 | const newWindowBtn = document.getElementById('frameless-window') 2 | 3 | newWindowBtn.addEventListener('click', () => { 4 | const url = 'data:text/html,

Hello World!

Close this Window' 5 | window.electronAPI.createFramelessWindow({ url }) 6 | }) 7 | -------------------------------------------------------------------------------- /spec/fixtures/api/quit-app/main.js: -------------------------------------------------------------------------------- 1 | const { app } = require('electron'); 2 | 3 | app.whenReady().then(function () { 4 | // This setImmediate call gets the spec passing on Linux 5 | setImmediate(function () { 6 | app.exit(123); 7 | }); 8 | }); 9 | 10 | process.on('exit', function (code) { 11 | console.log('Exit event with code: ' + code); 12 | }); 13 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-storage/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chrome-storage", 3 | "version": "1.0", 4 | "content_scripts": [ 5 | { 6 | "matches": [""], 7 | "js": ["main.js"], 8 | "run_at": "document_start" 9 | } 10 | ], 11 | "permissions": [ 12 | "storage" 13 | ], 14 | "manifest_version": 2 15 | } 16 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/content-script-document-end/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "document-end", 3 | "version": "1.0", 4 | "description": "", 5 | "content_scripts": [ 6 | { 7 | "matches": [""], 8 | "js": ["end.js"], 9 | "run_at": "document_end" 10 | } 11 | ], 12 | "manifest_version": 2 13 | } 14 | -------------------------------------------------------------------------------- /docs/fiddles/system/system-app-user-information/app-information/renderer.js: -------------------------------------------------------------------------------- 1 | const appInfoBtn = document.getElementById('app-info') 2 | 3 | appInfoBtn.addEventListener('click', async () => { 4 | const path = await window.electronAPI.getAppPath() 5 | const message = `This app is located at: ${path}` 6 | document.getElementById('got-app-info').innerHTML = message 7 | }) 8 | -------------------------------------------------------------------------------- /shell/app/uv_stdio_fix.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 Slack Technologies, Inc. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef ELECTRON_SHELL_APP_UV_STDIO_FIX_H_ 6 | #define ELECTRON_SHELL_APP_UV_STDIO_FIX_H_ 7 | 8 | void FixStdioStreams(); 9 | 10 | #endif // ELECTRON_SHELL_APP_UV_STDIO_FIX_H_ 11 | -------------------------------------------------------------------------------- /spec/fixtures/api/window-open-location-change.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | foo 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/content-script-document-idle/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "document-idle", 3 | "version": "1.0", 4 | "description": "", 5 | "content_scripts": [ 6 | { 7 | "matches": [""], 8 | "js": ["idle.js"], 9 | "run_at": "document_idle" 10 | } 11 | ], 12 | "manifest_version": 2 13 | } 14 | -------------------------------------------------------------------------------- /spec/fixtures/module/preload-required-module.js: -------------------------------------------------------------------------------- 1 | try { 2 | const types = { 3 | process: typeof process, 4 | setImmediate: typeof setImmediate, 5 | global: typeof global, 6 | Buffer: typeof Buffer, 7 | 'global.Buffer': typeof global.Buffer 8 | }; 9 | console.log(JSON.stringify(types)); 10 | } catch (e) { 11 | console.log(e.message); 12 | } 13 | -------------------------------------------------------------------------------- /spec/fixtures/sub-frames/frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | This is a frame, it has no children 11 | 12 | -------------------------------------------------------------------------------- /docs/api/structures/ipc-renderer-event.md: -------------------------------------------------------------------------------- 1 | # IpcRendererEvent Object extends `Event` 2 | 3 | * `sender` [IpcRenderer](../ipc-renderer.md) - The `IpcRenderer` instance that emitted the event originally 4 | * `ports` [MessagePort][][] - A list of MessagePorts that were transferred with this message 5 | 6 | [MessagePort]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort 7 | -------------------------------------------------------------------------------- /docs/api/structures/rectangle.md: -------------------------------------------------------------------------------- 1 | # Rectangle Object 2 | 3 | * `x` number - The x coordinate of the origin of the rectangle (must be an integer). 4 | * `y` number - The y coordinate of the origin of the rectangle (must be an integer). 5 | * `width` number - The width of the rectangle (must be an integer). 6 | * `height` number - The height of the rectangle (must be an integer). 7 | -------------------------------------------------------------------------------- /docs/fiddles/system/clipboard/copy/renderer.js: -------------------------------------------------------------------------------- 1 | const copyBtn = document.getElementById('copy-to') 2 | const copyInput = document.getElementById('copy-to-input') 3 | 4 | copyBtn.addEventListener('click', () => { 5 | if (copyInput.value !== '') copyInput.value = '' 6 | copyInput.placeholder = 'Copied! Paste here to see.' 7 | window.clipboard.writeText('Electron Demo!') 8 | }) 9 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/content-script-document-start/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "document-start", 3 | "version": "1.0", 4 | "description": "", 5 | "content_scripts": [ 6 | { 7 | "matches": [""], 8 | "js": ["start.js"], 9 | "run_at": "document_start" 10 | } 11 | ], 12 | "manifest_version": 2 13 | } 14 | -------------------------------------------------------------------------------- /docs/fiddles/media/screenshot/take-screenshot/renderer.js: -------------------------------------------------------------------------------- 1 | const screenshot = document.getElementById('screen-shot') 2 | const screenshotMsg = document.getElementById('screenshot-path') 3 | 4 | screenshot.addEventListener('click', async (event) => { 5 | screenshotMsg.textContent = 'Gathering screens...' 6 | screenshotMsg.textContent = await window.electronAPI.takeScreenshot() 7 | }) 8 | -------------------------------------------------------------------------------- /lib/renderer/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-restricted-imports": [ 4 | "error", 5 | { 6 | "paths": [ 7 | "electron", 8 | "electron/main" 9 | ], 10 | "patterns": [ 11 | "./*", 12 | "../*", 13 | "@electron/internal/browser/*" 14 | ] 15 | } 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/worker/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-restricted-imports": [ 4 | "error", 5 | { 6 | "paths": [ 7 | "electron", 8 | "electron/main" 9 | ], 10 | "patterns": [ 11 | "./*", 12 | "../*", 13 | "@electron/internal/browser/*" 14 | ] 15 | } 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /script/gn-asar-hash.js: -------------------------------------------------------------------------------- 1 | const asar = require('@electron/asar'); 2 | const crypto = require('node:crypto'); 3 | const fs = require('node:fs'); 4 | 5 | const archive = process.argv[2]; 6 | const hashFile = process.argv[3]; 7 | 8 | const { headerString } = asar.getRawHeader(archive); 9 | fs.writeFileSync(hashFile, crypto.createHash('SHA256').update(headerString).digest('hex')); 10 | -------------------------------------------------------------------------------- /spec/fixtures/api/frame-subscriber.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/api/offscreen-rendering.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-tabs/no-privileges/main.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | 3 | chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { 4 | sendResponse(request); 5 | }); 6 | 7 | window.addEventListener('message', () => { 8 | chrome.runtime.sendMessage({}, response => { 9 | console.log(JSON.stringify(response)); 10 | }); 11 | }, false); 12 | -------------------------------------------------------------------------------- /spec/fixtures/module/preload-node-off.js: -------------------------------------------------------------------------------- 1 | setImmediate(function () { 2 | try { 3 | const types = { 4 | process: typeof process, 5 | setImmediate: typeof setImmediate, 6 | global: typeof global, 7 | Buffer: typeof Buffer 8 | }; 9 | console.log(JSON.stringify(types)); 10 | } catch (e) { 11 | console.log(e.message); 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-will-navigate-in-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-zoom-inherited.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/lazy-background-page/content_script.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | chrome.runtime.sendMessage({ some: 'message' }, (response) => { 3 | const script = document.createElement('script'); 4 | script.textContent = `require('electron').ipcRenderer.send('bg-page-message-response', ${JSON.stringify(response)})`; 5 | document.documentElement.appendChild(script); 6 | }); 7 | -------------------------------------------------------------------------------- /spec/fixtures/pages/geolocation/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/pages/history-replace.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/pages/iframe-protocol.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-did-navigate-in-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Click me. 4 | This is content. 5 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/pages/worker.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/is-valid-window/src/impl_darwin.mm: -------------------------------------------------------------------------------- 1 | #include "impl.h" 2 | 3 | #include 4 | 5 | namespace impl { 6 | 7 | bool IsValidWindow(char* handle, size_t size) { 8 | if (size != sizeof(NSView*)) 9 | return false; 10 | NSView* view = *reinterpret_cast(handle); 11 | return [view isKindOfClass:[NSView class]]; 12 | } 13 | 14 | } // namespace impl 15 | -------------------------------------------------------------------------------- /lib/isolated_renderer/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-restricted-imports": [ 4 | "error", 5 | { 6 | "paths": [ 7 | "electron", 8 | "electron/main" 9 | ], 10 | "patterns": [ 11 | "./*", 12 | "../*", 13 | "@electron/internal/browser/*" 14 | ] 15 | } 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/sandboxed_renderer/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-restricted-imports": [ 4 | "error", 5 | { 6 | "paths": [ 7 | "electron", 8 | "electron/main" 9 | ], 10 | "patterns": [ 11 | "./*", 12 | "../*", 13 | "@electron/internal/browser/*" 14 | ] 15 | } 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /spec/fixtures/api/command-line/main.js: -------------------------------------------------------------------------------- 1 | const { app } = require('electron'); 2 | 3 | app.whenReady().then(() => { 4 | const payload = { 5 | hasSwitch: app.commandLine.hasSwitch('foobar'), 6 | getSwitchValue: app.commandLine.getSwitchValue('foobar') 7 | }; 8 | 9 | process.stdout.write(JSON.stringify(payload)); 10 | process.stdout.end(); 11 | 12 | app.quit(); 13 | }); 14 | -------------------------------------------------------------------------------- /spec/fixtures/api/unhandled-rejection-handled.js: -------------------------------------------------------------------------------- 1 | const { app } = require('electron'); 2 | 3 | const handleUnhandledRejection = (reason) => { 4 | console.error(`Unhandled Rejection: ${reason.stack}`); 5 | app.quit(); 6 | }; 7 | 8 | const main = async () => { 9 | process.on('unhandledRejection', handleUnhandledRejection); 10 | throw new Error('oops'); 11 | }; 12 | 13 | main(); 14 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-i18n/v3/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chrome-i18n", 3 | "version": "1.0", 4 | "default_locale": "es", 5 | "content_scripts": [ 6 | { 7 | "matches": [ 8 | "" 9 | ], 10 | "js": [ 11 | "main.js" 12 | ], 13 | "run_at": "document_start" 14 | } 15 | ], 16 | "manifest_version": 3 17 | } 18 | -------------------------------------------------------------------------------- /docs/fiddles/quick-start/preload.js: -------------------------------------------------------------------------------- 1 | window.addEventListener('DOMContentLoaded', () => { 2 | const replaceText = (selector, text) => { 3 | const element = document.getElementById(selector) 4 | if (element) element.innerText = text 5 | } 6 | 7 | for (const type of ['chrome', 'node', 'electron']) { 8 | replaceText(`${type}-version`, process.versions[type]) 9 | } 10 | }) 11 | -------------------------------------------------------------------------------- /spec/fixtures/pages/beforeunload-false.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /spec/fixtures/pages/datalist-text.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spec/fixtures/pages/media-id-reset.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /spec/fixtures/pages/service-worker/service-worker.js: -------------------------------------------------------------------------------- 1 | self.addEventListener('fetch', function (event) { 2 | const requestUrl = new URL(event.request.url); 3 | 4 | if (requestUrl.pathname === '/echo' && 5 | event.request.headers.has('X-Mock-Response')) { 6 | const mockResponse = new Response('Hello from serviceWorker!'); 7 | event.respondWith(mockResponse); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /docs/fiddles/features/notifications/renderer/renderer.js: -------------------------------------------------------------------------------- 1 | const NOTIFICATION_TITLE = 'Title' 2 | const NOTIFICATION_BODY = 'Notification from the Renderer process. Click to log to console.' 3 | const CLICK_MESSAGE = 'Notification clicked!' 4 | 5 | new window.Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }) 6 | .onclick = () => { document.getElementById('output').innerText = CLICK_MESSAGE } 7 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/dialogs/information-dialog/renderer.js: -------------------------------------------------------------------------------- 1 | const informationBtn = document.getElementById('information-dialog') 2 | 3 | informationBtn.addEventListener('click', async () => { 4 | const index = await window.electronAPI.openInformationDialog() 5 | const message = `You selected: ${index === 0 ? 'yes' : 'no'}` 6 | document.getElementById('info-selection').innerHTML = message 7 | }) 8 | -------------------------------------------------------------------------------- /spec/fixtures/api/beforeunload-empty-string.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spec/fixtures/api/beforeunload-false.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/webview-contents-error-on-creation/index.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow } = require('electron'); 2 | 3 | app.whenReady().then(() => { 4 | const mainWindow = new BrowserWindow({ 5 | show: false 6 | }); 7 | mainWindow.loadFile('about:blank'); 8 | 9 | app.on('web-contents-created', () => { 10 | throw new Error(); 11 | }); 12 | 13 | app.quit(); 14 | }); 15 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/minimum-chrome-version/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chrome-too-low-version", 3 | "version": "1.0", 4 | "minimum_chrome_version": "999", 5 | "content_scripts": [ 6 | { 7 | "matches": [""], 8 | "js": ["main.js"], 9 | "run_at": "document_start" 10 | } 11 | ], 12 | "permissions": ["storage"], 13 | "manifest_version": 3 14 | } 15 | -------------------------------------------------------------------------------- /spec/fixtures/pages/permissions/notification.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/api/preload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/webview-attach-destroyed/index.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow } = require('electron'); 2 | 3 | app.whenReady().then(() => { 4 | const w = new BrowserWindow({ show: false, webPreferences: { webviewTag: true } }); 5 | w.loadURL('data:text/html,'); 6 | app.on('web-contents-created', () => { 7 | w.close(); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-webRequest-wss/background.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | 3 | chrome.webRequest.onBeforeSendHeaders.addListener( 4 | (details) => { 5 | if (details.requestHeaders) { 6 | details.requestHeaders.foo = 'bar'; 7 | } 8 | return { cancel: false, requestHeaders: details.requestHeaders }; 9 | }, 10 | { urls: ['*://127.0.0.1:*'] }, 11 | ['blocking'] 12 | ); 13 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/host-permissions/privileged-tab-info/main.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | 3 | chrome.runtime.onMessage.addListener((request, _sender, sendResponse) => { 4 | sendResponse(request); 5 | }); 6 | 7 | window.addEventListener('message', () => { 8 | chrome.runtime.sendMessage({ method: 'query' }, response => { 9 | console.log(JSON.stringify(response)); 10 | }); 11 | }, false); 12 | -------------------------------------------------------------------------------- /spec/fixtures/pages/world-safe-preload-error.js: -------------------------------------------------------------------------------- 1 | const { ipcRenderer, webFrame } = require('electron'); 2 | 3 | webFrame.executeJavaScript(`(() => { 4 | return Object(Symbol('a')); 5 | })()`).catch((err) => { 6 | // Considered safe if the object is constructed in this world 7 | ipcRenderer.send('executejs-safe', err); 8 | }).then(() => { 9 | ipcRenderer.send('executejs-safe', null); 10 | }); 11 | -------------------------------------------------------------------------------- /docs/fiddles/features/macos-dock-menu/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World! 6 | 7 | 8 | 9 |

Hello World!

10 |

Right click the dock icon to see the custom menu options.

11 | 12 | 13 | -------------------------------------------------------------------------------- /npm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "index.js", 3 | "types": "electron.d.ts", 4 | "bin": { 5 | "electron": "cli.js" 6 | }, 7 | "scripts": { 8 | "postinstall": "node install.js" 9 | }, 10 | "dependencies": { 11 | "@electron/get": "^2.0.0", 12 | "@types/node": "^18.11.18", 13 | "extract-zip": "^2.0.1" 14 | }, 15 | "engines": { 16 | "node": ">= 12.20.55" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /spec/fixtures/apps/open-new-window-from-link/new-window-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Window From Link 7 | 8 | 9 | I'm a window opened from a link! 10 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/apps/xwindow-icon/main.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow } = require('electron'); 2 | const path = require('node:path'); 3 | 4 | app.whenReady().then(() => { 5 | const w = new BrowserWindow({ 6 | show: false, 7 | icon: path.join(__dirname, 'icon.png') 8 | }); 9 | w.webContents.on('did-finish-load', () => { 10 | app.quit(); 11 | }); 12 | w.loadURL('about:blank'); 13 | }); 14 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-runtime/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chrome-runtime", 3 | "version": "1.0", 4 | "content_scripts": [ 5 | { 6 | "matches": [""], 7 | "js": ["main.js"], 8 | "run_at": "document_end" 9 | } 10 | ], 11 | "background": { 12 | "scripts": ["background.js"], 13 | "persistent": false 14 | }, 15 | "manifest_version": 2 16 | } 17 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-storage/main.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | chrome.storage.local.set({ key: 'value' }, () => { 3 | chrome.storage.local.get(['key'], ({ key }) => { 4 | const script = document.createElement('script'); 5 | script.textContent = `require('electron').ipcRenderer.send('storage-success', ${JSON.stringify(key)})`; 6 | document.documentElement.appendChild(script); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/lazy-background-page/runtime-get-background-page.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | window.completionPromise = new Promise((resolve) => { 3 | window.completionPromiseResolve = resolve; 4 | }); 5 | chrome.runtime.sendMessage({ some: 'message' }, () => { 6 | chrome.runtime.getBackgroundPage((bgPage) => { 7 | window.completionPromiseResolve(bgPage.receivedMessage); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /spec/fixtures/apps/open-new-window-from-link/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hello World! 7 | 8 | 9 | Open New Window 10 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/module/no-asar.js: -------------------------------------------------------------------------------- 1 | const fs = require('node:fs'); 2 | const path = require('node:path'); 3 | 4 | const stats = fs.statSync(path.join(__dirname, '..', 'test.asar', 'a.asar')); 5 | 6 | const details = { 7 | isFile: stats.isFile(), 8 | size: stats.size 9 | }; 10 | 11 | if (process.send != null) { 12 | process.send(details); 13 | } else { 14 | console.log(JSON.stringify(details)); 15 | } 16 | -------------------------------------------------------------------------------- /spec/fixtures/workers/workers.asar: -------------------------------------------------------------------------------- 1 | hd_{"files":{"shared_worker.js":{"size":163,"offset":"0"},"worker.js":{"size":67,"offset":"163"}}}this.onconnect = function (event) { 2 | const port = event.ports[0]; 3 | port.start(); 4 | port.onmessage = function (event) { 5 | port.postMessage(event.data); 6 | }; 7 | }; 8 | this.onmessage = function (msg) { 9 | this.postMessage(msg.data); 10 | }; 11 | -------------------------------------------------------------------------------- /docs/fiddles/features/online-detection/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World! 6 | 7 | 8 | 9 |

Connection status:

10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /lib/browser/api/exports/electron.ts: -------------------------------------------------------------------------------- 1 | import { defineProperties } from '@electron/internal/common/define-properties'; 2 | import { commonModuleList } from '@electron/internal/common/api/module-list'; 3 | import { browserModuleList } from '@electron/internal/browser/api/module-list'; 4 | 5 | module.exports = {}; 6 | 7 | defineProperties(module.exports, commonModuleList); 8 | defineProperties(module.exports, browserModuleList); 9 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-tabs/api-async/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "api-async", 3 | "version": "1.0", 4 | "content_scripts": [ 5 | { 6 | "matches": [ ""], 7 | "js": ["main.js"], 8 | "run_at": "document_start" 9 | } 10 | ], 11 | "permissions": ["tabs"], 12 | "background": { 13 | "service_worker": "background.js" 14 | }, 15 | "manifest_version": 3 16 | } 17 | -------------------------------------------------------------------------------- /spec/fixtures/pages/visibilitychange.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/sub-frames/frame-container.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | This is the root page 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/workers/load_worker.html: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /docs/fiddles/features/notifications/main/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World! 6 | 7 | 8 | 9 |

Hello World!

10 |

After launching this application, you should see the system notification.

11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/renderer/api/exports/electron.ts: -------------------------------------------------------------------------------- 1 | import { defineProperties } from '@electron/internal/common/define-properties'; 2 | import { commonModuleList } from '@electron/internal/common/api/module-list'; 3 | import { rendererModuleList } from '@electron/internal/renderer/api/module-list'; 4 | 5 | module.exports = {}; 6 | 7 | defineProperties(module.exports, commonModuleList); 8 | defineProperties(module.exports, rendererModuleList); 9 | -------------------------------------------------------------------------------- /spec/fixtures/api/native-window-open-file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/inherit-stderr/main.js: -------------------------------------------------------------------------------- 1 | const { app, utilityProcess } = require('electron'); 2 | const path = require('node:path'); 3 | 4 | app.whenReady().then(() => { 5 | const payload = app.commandLine.getSwitchValue('payload'); 6 | const child = utilityProcess.fork(path.join(__dirname, 'test.js'), [`--payload=${payload}`]); 7 | child.on('exit', () => { 8 | app.quit(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /spec/fixtures/api/utility-process/inherit-stdout/main.js: -------------------------------------------------------------------------------- 1 | const { app, utilityProcess } = require('electron'); 2 | const path = require('node:path'); 3 | 4 | app.whenReady().then(() => { 5 | const payload = app.commandLine.getSwitchValue('payload'); 6 | const child = utilityProcess.fork(path.join(__dirname, 'test.js'), [`--payload=${payload}`]); 7 | child.on('exit', () => { 8 | app.quit(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /spec/fixtures/auto-update/initial/index.js: -------------------------------------------------------------------------------- 1 | process.on('uncaughtException', (err) => { 2 | console.error(err); 3 | process.exit(1); 4 | }); 5 | 6 | const { autoUpdater } = require('electron'); 7 | 8 | const feedUrl = process.argv[1]; 9 | 10 | console.log('Setting Feed URL'); 11 | 12 | autoUpdater.setFeedURL({ 13 | url: feedUrl 14 | }); 15 | 16 | console.log('Feed URL Set:', feedUrl); 17 | 18 | process.exit(0); 19 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/host-permissions/privileged-tab-info/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "privileged-tab-info", 3 | "version": "0.1", 4 | "manifest_version": 3, 5 | "content_scripts": [{ 6 | "matches": [ ""], 7 | "js": ["main.js"], 8 | "run_at": "document_start" 9 | }], 10 | "host_permissions": ["http://*/*"], 11 | "background": { 12 | "service_worker": "background.js" 13 | } 14 | } -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-opener-no-node-integration.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/api/structures/service-worker-info.md: -------------------------------------------------------------------------------- 1 | # ServiceWorkerInfo Object 2 | 3 | * `scriptUrl` string - The full URL to the script that this service worker runs 4 | * `scope` string - The base URL that this service worker is active for. 5 | * `renderProcessId` number - The virtual ID of the process that this service worker is running in. This is not an OS level PID. This aligns with the ID set used for `webContents.getProcessId()`. 6 | -------------------------------------------------------------------------------- /docs/api/structures/upload-file.md: -------------------------------------------------------------------------------- 1 | # UploadFile Object 2 | 3 | * `type` 'file' - `file`. 4 | * `filePath` string - Path of file to be uploaded. 5 | * `offset` Integer (optional) - Defaults to `0`. 6 | * `length` Integer (optional) - Number of bytes to read from `offset`. 7 | Defaults to `0`. 8 | * `modificationTime` Double (optional) - Last Modification time in 9 | number of seconds since the UNIX epoch. Defaults to `0`. 10 | -------------------------------------------------------------------------------- /docs/fiddles/features/keyboard-shortcuts/interception-from-main/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World! 6 | 7 | 8 | 9 |

Hello World!

10 |

Hit Ctrl+I to see a message printed to the console.

11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/renderer.js: -------------------------------------------------------------------------------- 1 | // This file is required by the index.html file and will 2 | // be executed in the renderer process for that window. 3 | // All APIs exposed by the context bridge are available here. 4 | 5 | // Binds the buttons to the context bridge API. 6 | document.getElementById('open-in-browser').addEventListener('click', () => { 7 | window.shell.open() 8 | }) 9 | -------------------------------------------------------------------------------- /shell/app/node_main.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 GitHub, Inc. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef ELECTRON_SHELL_APP_NODE_MAIN_H_ 6 | #define ELECTRON_SHELL_APP_NODE_MAIN_H_ 7 | 8 | namespace electron { 9 | 10 | int NodeMain(int argc, char* argv[]); 11 | 12 | } // namespace electron 13 | 14 | #endif // ELECTRON_SHELL_APP_NODE_MAIN_H_ 15 | -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/fs-promises-renderer-crash/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /spec/fixtures/crash-cases/transparent-window-get-background-color/index.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow } = require('electron'); 2 | 3 | function createWindow () { 4 | // Create the browser window. 5 | const mainWindow = new BrowserWindow({ 6 | transparent: true 7 | }); 8 | mainWindow.getBackgroundColor(); 9 | } 10 | 11 | app.on('ready', () => { 12 | createWindow(); 13 | setTimeout(() => app.quit()); 14 | }); 15 | -------------------------------------------------------------------------------- /spec/fixtures/pages/webview-devtools.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spec/fixtures/sub-frames/frame-with-frame-container.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | This is the root page 11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/fixtures/webview/fullscreen/frame.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | WebView 4 |
5 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /docs/api/structures/hid-device.md: -------------------------------------------------------------------------------- 1 | # HIDDevice Object 2 | 3 | * `deviceId` string - Unique identifier for the device. 4 | * `name` string - Name of the device. 5 | * `vendorId` Integer - The USB vendor ID. 6 | * `productId` Integer - The USB product ID. 7 | * `serialNumber` string (optional) - The USB device serial number. 8 | * `guid` string (optional) - Unique identifier for the HID interface. A device may have multiple HID interfaces. 9 | -------------------------------------------------------------------------------- /docs/fiddles/native-ui/external-links-file-manager/renderer.js: -------------------------------------------------------------------------------- 1 | const exLinksBtn = document.getElementById('open-ex-links') 2 | const fileManagerBtn = document.getElementById('open-file-manager') 3 | 4 | fileManagerBtn.addEventListener('click', (event) => { 5 | window.electronAPI.openHomeDir() 6 | }) 7 | 8 | exLinksBtn.addEventListener('click', (event) => { 9 | window.electronAPI.openExternal('https://electronjs.org') 10 | }) 11 | -------------------------------------------------------------------------------- /script/generate-zip-manifest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import zipfile 4 | import sys 5 | 6 | def main(zip_path, manifest_out): 7 | with open(manifest_out, 'w') as manifest, \ 8 | zipfile.ZipFile(zip_path, 'r', allowZip64=True) as z: 9 | for name in sorted(z.namelist()): 10 | manifest.write(name + '\n') 11 | return 0 12 | 13 | if __name__ == '__main__': 14 | sys.exit(main(sys.argv[1], sys.argv[2])) 15 | -------------------------------------------------------------------------------- /script/lib/npm.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import sys 3 | 4 | 5 | def npm(*npm_args): 6 | call_args = [__get_executable_name()] + list(npm_args) 7 | subprocess.check_call(call_args) 8 | 9 | 10 | def __get_executable_name(): 11 | executable = 'npm' 12 | if sys.platform == 'win32': 13 | executable += '.cmd' 14 | return executable 15 | 16 | 17 | if __name__ == '__main__': 18 | npm(*sys.argv[1:]) 19 | -------------------------------------------------------------------------------- /spec/fixtures/api/first-party-sets/command-line/main.js: -------------------------------------------------------------------------------- 1 | const { app } = require('electron'); 2 | 3 | app.whenReady().then(function () { 4 | const hasSwitch = app.commandLine.hasSwitch('use-first-party-set'); 5 | const value = app.commandLine.getSwitchValue('use-first-party-set'); 6 | if (hasSwitch) { 7 | process.stdout.write(JSON.stringify(value)); 8 | process.stdout.end(); 9 | } 10 | 11 | app.quit(); 12 | }); 13 | -------------------------------------------------------------------------------- /spec/fixtures/apps/crash/sandbox-preload.js: -------------------------------------------------------------------------------- 1 | const { crashReporter } = require('electron'); 2 | 3 | const params = new URLSearchParams(location.search); 4 | if (params.get('set_extra') === '1') { 5 | crashReporter.addExtraParameter('rendererSpecific', 'rs'); 6 | crashReporter.addExtraParameter('addedThenRemoved', 'to-be-removed'); 7 | crashReporter.removeExtraParameter('addedThenRemoved'); 8 | } 9 | 10 | process.crash(); 11 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/lazy-background-page/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lazy-background-page", 3 | "version": "1.0", 4 | "background": { 5 | "scripts": ["background.js"], 6 | "persistent": false 7 | }, 8 | "content_scripts": [ 9 | { 10 | "matches": [""], 11 | "js": ["content_script.js"], 12 | "run_at": "document_start" 13 | } 14 | ], 15 | "manifest_version": 2 16 | } 17 | -------------------------------------------------------------------------------- /spec/fixtures/sub-frames/frame-with-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | This is a frame, is has one child 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/renderer/api/crash-reporter.ts: -------------------------------------------------------------------------------- 1 | const binding = process._linkedBinding('electron_renderer_crash_reporter'); 2 | 3 | export default { 4 | addExtraParameter (key: string, value: string) { 5 | binding.addExtraParameter(key, value); 6 | }, 7 | 8 | removeExtraParameter (key: string) { 9 | binding.removeExtraParameter(key); 10 | }, 11 | 12 | getParameters () { 13 | return binding.getParameters(); 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /spec/fixtures/api/no-leak.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Document 5 | 6 | 7 | 16 | 17 | -------------------------------------------------------------------------------- /spec/fixtures/api/test-menu-null/main.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow } = require('electron'); 2 | 3 | let win; 4 | app.whenReady().then(function () { 5 | win = new BrowserWindow({}); 6 | win.setMenu(null); 7 | 8 | setTimeout(() => { 9 | if (win.isMenuBarVisible()) { 10 | console.log('Window has a menu'); 11 | } else { 12 | console.log('Window has no menu'); 13 | } 14 | app.quit(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-tabs/no-privileges/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "no-privileges", 3 | "version": "1.0", 4 | "content_scripts": [ 5 | { 6 | "matches": [ 7 | "" 8 | ], 9 | "js": [ 10 | "main.js" 11 | ], 12 | "run_at": "document_start" 13 | } 14 | ], 15 | "background": { 16 | "service_worker": "background.js" 17 | }, 18 | "manifest_version": 3 19 | } -------------------------------------------------------------------------------- /spec/fixtures/pages/video.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/fiddles/features/keyboard-shortcuts/global/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World! 6 | 7 | 8 | 9 |

Hello World!

10 |

Hit Alt+Ctrl+I on Windows or Opt+Cmd+I on Mac to see a message printed to the console.

11 | 12 | 13 | -------------------------------------------------------------------------------- /script/codesign/codesign.cnf: -------------------------------------------------------------------------------- 1 | [req] 2 | default_bits = 4096 3 | encrypt_key = no 4 | default_md = sha512 5 | distinguished_name = req_distinguished_name 6 | prompt = no 7 | 8 | [req_distinguished_name] 9 | C = CA 10 | ST = BC 11 | L = Vancouver 12 | O = ElectronJS 13 | OU = BuildAutomation 14 | CN = codesign.electronjs.org 15 | 16 | [extended] 17 | keyUsage = critical,digitalSignature 18 | extendedKeyUsage = critical,codeSigning 19 | -------------------------------------------------------------------------------- /docs/fiddles/features/keyboard-shortcuts/local/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World! 6 | 7 | 8 | 9 |

Hello World!

10 |

Hit Alt+Shift+I on Windows, or Opt+Cmd+I on mac to see a message printed to the console.

11 | 12 | 13 | -------------------------------------------------------------------------------- /spec/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "mocha": true, 5 | "serviceworker": true 6 | }, 7 | "globals": { 8 | "Bindings": true, 9 | "Components": true, 10 | "UI": true, 11 | "WebView": true 12 | }, 13 | "plugins": [ 14 | "mocha", 15 | "unicorn" 16 | ], 17 | "rules": { 18 | "mocha/no-exclusive-tests": "error", 19 | "unicorn/prefer-node-protocol": "error" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spec/fixtures/api/native-window-open-blank.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/pages/fetch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/api/structures/ipc-main-invoke-event.md: -------------------------------------------------------------------------------- 1 | # IpcMainInvokeEvent Object extends `Event` 2 | 3 | * `processId` Integer - The internal ID of the renderer process that sent this message 4 | * `frameId` Integer - The ID of the renderer frame that sent this message 5 | * `sender` [WebContents](../web-contents.md) - Returns the `webContents` that sent the message 6 | * `senderFrame` [WebFrameMain](../web-frame-main.md) _Readonly_ - The frame that sent this message 7 | -------------------------------------------------------------------------------- /lib/browser/api/system-preferences.ts: -------------------------------------------------------------------------------- 1 | const { systemPreferences } = process._linkedBinding('electron_browser_system_preferences'); 2 | 3 | if ('getEffectiveAppearance' in systemPreferences) { 4 | const nativeEAGetter = systemPreferences.getEffectiveAppearance; 5 | Object.defineProperty(systemPreferences, 'effectiveAppearance', { 6 | get: () => nativeEAGetter.call(systemPreferences) 7 | }); 8 | } 9 | 10 | export default systemPreferences; 11 | -------------------------------------------------------------------------------- /shell/browser/native_window_features.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 Slack Technologies, Inc. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "shell/browser/native_window_features.h" 6 | 7 | namespace features { 8 | const base::Feature kWaylandWindowDecorations{"WaylandWindowDecorations", 9 | base::FEATURE_ENABLED_BY_DEFAULT}; 10 | } 11 | -------------------------------------------------------------------------------- /spec/fixtures/extensions/chrome-scripting/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "execute-script", 3 | "version": "1.0", 4 | "permissions": [ 5 | "scripting" 6 | ], 7 | "host_permissions": [""], 8 | "content_scripts": [{ 9 | "matches": [ ""], 10 | "js": ["main.js"], 11 | "run_at": "document_start" 12 | }], 13 | "background": { 14 | "service_worker": "background.js" 15 | }, 16 | "manifest_version": 3 17 | } -------------------------------------------------------------------------------- /spec/fixtures/pages/webframe-spell-check.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------