* build: use goma for all release builds
* Make sure goma is setup everywhere it is needed
* Show ninja stats on release builds
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
desktopCapture.getSources() returns a promise which should resolve
when capturing finishes. Internally it creates an instance of
DesktopCapturer which is responsible for resolving or rejecting
the promise.
Between the time DesktopCapturer starts capturing frames and when
it finishes, it's possible for its handle to be GC'd leading to
it never resolving.
These changes pin the instance of DesktopCapturer until it either
finishes or errors.
fixes#25595
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
Move it from LoadURL to RenderViewCreated which is present
in all window creation cases and is called early enough to be
relevant from user prespective and after RenderWidgetHostView
is already present.
Co-authored-by: marekharanczyk <48673767+marekharanczyk@users.noreply.github.com>
* fix: replace default frameName title with null check (#27521)
* refactor: replace default frameName title with null check
* add isNativeWindowOpen check in makeBrowserWindowOptions
* modify snapshot test files
* replace title with frame-name again for proxy - not native open
* modify proxy snapshot title key-value to come after height key-value
* add nativewindowopen check to null title
* fix lint and json formatting
* reformat test cases for this branch
the merged changes included some rearrangements to the json items that
do not apply to this branch, so the items were reordered according to
this branch's previous files.
* remove default frameName title for native open call and modify test txts
* feat: add `win.setTopBrowserView()` so that BrowserViews can be raised (#27007)
* feat: Raise a browser view via `BrowserWindow.setTopBrowserView()`.
This is similar to removing and re-adding a browser view, but avoids a visible flicker as the browser view is not removed from the window when using `setTopBrowserView`. Note: if the given browser view is not attached to the window, it will be added.
This commit contains the macOS implementation.
* feat: setTopBrowserView support for Windows and Linux
* docs: add info about setTopBrowserView
* docs: Clarify behavior when browserView is not yet attached.
* fix: throw en error when browserView is not attached to the window
* fix: build error
* fix: test
* fix: add test case
* fix: tests
* fix: reparenting
* fix: close second window in tests
Co-authored-by: sentialx <sentialx@gmail.com>
* fix: build error
Co-authored-by: Stewart Lord <stew@offbynone.com>
* Use std::forward_list instead of base::LinkedList for better perf,
more consistent memory management. Better than std::list because we
don't need the double-linked-list behavior of std::list
* Use std::unordered_map instead of std::map for the v8 hash table
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
base::LinkedList does not delete its members on destruction. We need to
manually ensure the linkedlist is empty when the ObjectCache is
destroyed.
Fixes#27039
Notes: Fixed memory leak when sending non-primitives over the context
bridge
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
* chore: chromium backports M87-1
Contains applicable backports from M87-1 release
CVE-2020-16037
CVE-2020-16041
CVE-2020-16042
* chore: cherry-pick 381c4b5679 from chromium. (#26832)
* fix: message box missing an "OK" button in GTK (#26915)
Co-authored-by: Mimi <1119186082@qq.com>
* chore: cherry-pick d8d64b7cd244 from chromium (#26892)
* chore: cherry-pick 290fe9c6e245 from v8 (#26896)
* docs: add missing deprecated systemPreferences APIs to breaking-changes (#26934)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
* chore: cherry-pick 3abc372c9c00 from chromium (#26894)
* chore: cherry-pick 3abc372c9c00 from chromium
* resolve conflict
* fix: Avoid crashing in NativeViewHost::SetParentAccessible on Windows 10 (#26949)
* fix: Avoid crashing in NativeViewHost::SetParentAccessible on Windows
This fixes#26905. The patch was obtained from @deepak1556, who in turn
got it from the Microsoft Teams folks.
I believe the crash started happening due to the changes in
5c6c8e994b%5E!/#F15
This affects Electron 9 and later.
Notes: Fix occasional crash on Windows
* Update .patches
* update patches
Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Electron Bot <electron@github.com>
* fix: Upload all *.dll.pdb to symbol server (#26964)
Fixes#26961.
Notes: Add Electron DLLs like libGLESv2.dll to symbol server
Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
* fix: restrict sendToFrame to same-process frames by default (#26875) (#26927)
* fix: restrict sendToFrame to same-process frames by default (#26875)
* missed a conflict
* fix build
* fix build again
* fix usage of defer
* Bump v10.2.0
* chore: cherry-pick 6763a713f957 from skia (#26956)
* chore: chromium backports M87-1
PR feedback: add links to changes in the upstream
Co-authored-by: Andrey Belenko <anbelen@microsoft.com>
Co-authored-by: Pedro Pontes <pepontes@microsoft.com>
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Mimi <1119186082@qq.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
when using readdirSync on a deep directory within the archive, the code fails to get the stats of child paths.
Co-authored-by: Avi Vahl <avi.vahl@wix.com>
The call stack for one of our top crashes looks like this:
```
node::Abort (node_errors.cc:241)
node::Assert (node_errors.cc:256)
node::MakeCallback (callback.cc:226)
gin_helper::internal::CallMethodWithArgs (event_emitter_caller.cc:23)
gin_helper::EmitEvent<T> (event_emitter_caller.h:51)
gin_helper::EventEmitterMixin<T>::Emit<T> (event_emitter_mixin.h:81)
electron::api::DownloadItem::OnDownloadUpdated (electron_api_download_item.cc:115)
download::DownloadItemImpl::UpdateObservers (download_item_impl.cc:482)
content::DownloadManagerImpl::Shutdown (download_manager_impl.cc:508)
content::BrowserContext::~BrowserContext (browser_context.cc:476)
```
Full stack here: https://sentry.io/share/issue/9b030a0601b547188181b543c16ecda2/
During browser shutdown, the `DownloadManager` was being cleaned up
*after* the Node environment had already been destroyed. This caused the
`DownloadItem::OnDownloadUpdated` callback to crash when trying to emit
the JS `done` event.
To prevent this, we now manually shut down the `DownloadManager`
earlier. This is also mentioned in the comment on
`DownloadManager::Shutdown`:
```
// Shutdown the download manager. Content calls this when BrowserContext is
// being destructed. If the embedder needs this to be called earlier, it can
// call it. In that case, the delegate's Shutdown() method will only be called
// once.
```
Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
* fix: prevent crash when destroyed widget receives keyboard event
Activating a key to close a window will cause a silent crash. Handling the keyboard
event will lead to a nullptr dereferenced in Chromium code if the window widget has
already been destroyed.
* test: ensure BrowserWindow doesn't crash from keyboard events during close
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
* docs: update devtools extension tutorial
* Update docs/tutorial/devtools-extension.md
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
* update
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
* chore: cherry-pick 2d18de63acf1 from chromium
* resolve conflict
* modified patches from CRLF to LF
* Update cherry-pick-2d18de63acf1.patch
Remove test from patch
* fix: Avoid crashing in NativeViewHost::SetParentAccessible on Windows
This fixes#26905. The patch was obtained from @deepak1556, who in turn
got it from the Microsoft Teams folks.
I believe the crash started happening due to the changes in
5c6c8e994b%5E!/#F15
This affects Electron 9 and later.
Notes: Fix occasional crash on Windows
* Update .patches
* update patches
Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Electron Bot <electron@github.com>
* build: fix usage of octokit/rest and make uploading better
* Update with change from #26414
* Update with changes from #26425
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* fix: notifications successfully never timeout with included flag
* Correct return with if statement
Co-authored-by: mlaurencin <mlaurencin@microsoft.com>
* chore: bump chromium in DEPS to 85.0.4183.102
* chore: bump chromium in DEPS to 85.0.4183.121
* update patches
Co-authored-by: Electron Bot <anonymous@electronjs.org>
* fix: call node::Stop on exit
* also call Stop in node_main
* oop, we were already calling set_can_call_into_js(false)??
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
* Ensure electron delay loads the appropriate modules as chromium on windows
This change adds the same module delay load list that chromium uses for electron. Some modules were already getting delay loaded from other build files in chromium but not the main list via //build/config/win:delayloads. We do not include the list of delay loads in delayloads_not_for_child_dll as those have issues being loaded in sandboxes processes. This will reduce the overall reference set impact of the electron processes.
* fix: Ensure win modules are properly delayloaded
* chore: fix linting
Co-authored-by: Chris Davis <chrisdavis@outlook.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
* ci: cleanup up test app directories
* ci: use electron prefix for a testing apps so that the can be cleaned up
* Revert "ci: cleanup up test app directories"
This reverts commit a47daba812.
* fixup test due to app name change
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
* chore: bump chromium in DEPS to 85.0.4183.88
* chore: bump chromium in DEPS to 85.0.4183.90
* chore: bump chromium in DEPS to 85.0.4183.92
* chore: bump chromium in DEPS to 85.0.4183.93
* test: add tests for shell.moveItemToTrash (#25113)
* fix: make shell.moveItemToTrash return false on Windows when move unsuccessful (#25124)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL (#25065)
* refactor: wire will-navigate up to a navigation throttle instead of OpenURL
* spec: add test for x-site _top navigation
* chore: old code be old
* tests: fix early-in-memory-session-create crash test on WOA
ci: cleanup user app data directories on WOA
(cherry picked from commit 43106d28d8)
* Renable crash tests on WOA
* chore: bump chromium in DEPS to 85.0.4183.82
* chore: bump chromium in DEPS to 85.0.4183.83
* chore: bump chromium in DEPS to 85.0.4183.84
* update patches
Co-authored-by: Electron Bot <anonymous@electronjs.org>
* chore: bump chromium in DEPS to 85.0.4183.79
* chore: bump chromium in DEPS to 85.0.4183.80
* update patches
Co-authored-by: Electron Bot <anonymous@electronjs.org>
* chore: bump chromium in DEPS to 85.0.4183.75
* update patches
* chore: bump chromium in DEPS to 85.0.4183.78
Co-authored-by: Electron Bot <anonymous@electronjs.org>
* chore: bump chromium in DEPS to 85.0.4183.71
* chore: bump chromium in DEPS to 85.0.4183.72
* chore: bump chromium in DEPS to 85.0.4183.73
* chore: bump chromium in DEPS to 85.0.4183.74
* update patches
Co-authored-by: Electron Bot <anonymous@electronjs.org>
* chore: bump chromium in DEPS to 85.0.4183.69
* update patches
* Update patches
* Fixup patch update
* no, really fix it up this time
* chore: bump chromium in DEPS to 85.0.4183.70
* update patches
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
* chore: bump chromium in DEPS to 85.0.4183.40
* chore: bump chromium in DEPS to 85.0.4183.41
* chore: bump chromium in DEPS to 85.0.4183.42
* chore: bump chromium in DEPS to 85.0.4183.43
* chore: bump chromium in DEPS to 85.0.4183.44
* chore: bump chromium in DEPS to 85.0.4183.47
* chore: bump chromium in DEPS to 85.0.4183.49
* chore: bump chromium in DEPS to 85.0.4183.50
* chore: bump chromium in DEPS to 85.0.4183.51
* chore: bump chromium in DEPS to 85.0.4183.53
* chore: bump chromium in DEPS to 85.0.4183.54
* chore: bump chromium in DEPS to 85.0.4183.56
* update patches
* chore: bump chromium in DEPS to 85.0.4183.57
* update patches
* chore: bump chromium in DEPS to 85.0.4183.59
* update patches
* chore: bump chromium in DEPS to 85.0.4183.61
* chore: bump chromium in DEPS to 85.0.4183.62
* chore: bump chromium in DEPS to 85.0.4183.63
* chore: bump chromium in DEPS to 85.0.4183.64
* chore: bump chromium in DEPS to 85.0.4183.65
* update patches
* try to track down WOA failure
* tests: disable crash test on WOA
* chore: bump chromium in DEPS to 85.0.4183.66
* update patches
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
* build: ensure symbol files are named lowercase on disk so that boto can find them
* build: only do the lower case symbol copy on case sensitive file systems (#24876)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
* fix: add patch to avoid crash in worker with nodeintegration enabled
[worker_global_scope.cc(111)] Check failed: url_.IsValid().
* fix: loading dedicated/shared worker over custom protocols
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1798250
that distinguishes loading the main script resource of dedicated/shared
worker, this allows us to register a custom URLLoaderFactory.
* spec: add crash test for worker with nodeIntegrationInWorker
* update patches
* Remove extra patchlist patches
* Fixup patch
* update patches
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
* feat: add worldSafe flag for executeJS results
* chore: do not log warning for webContents.executeJS
* Apply suggestions from code review
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
* chore: apply PR feedback
* chore: split logic a bit
* chore: allow primitives through the world safe checl
* chore: clean up per PR feedback
* chore: flip boolean logic
* chore: update per PR feedback
* chore: fix typo
* chore: fix spec
* Update web-frame.ts
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
* fix: generate dumps under crashDumps folder in linux
* Update spec-main/api-crash-reporter-spec.ts
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
* fix: cleanup webview zoom level observers on navigation
* add spec
* webview should be on same partition
* wait for webview to finish loading
Co-authored-by: deepak1556 <hop2deep@gmail.com>
* fix: Use ElectronAdaptedContentView
* fix: Actually, nevermind, it's "BrowserAccessebilityCocoa"
* chore: Remove things instead of manually keeping them
Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
* fix: --trace-sync-io flag in Node.js
* Also handle set_trace_sync_io in ElectronBrowserMainParts
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
* chore: bump chromium in DEPS to 85.0.4183.21
* chore: bump chromium in DEPS to 85.0.4183.22
* chore: bump chromium in DEPS to 85.0.4183.23
* chore: bump chromium in DEPS to 85.0.4183.24
* update patches
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Address incorrect typing for isEnabled. The root cause of this was due
to missing backticks which caused the docs parser to think that the
return type of the `isEnabled` function was null, where it was supposed
to be a boolean type.
The side effect of this was that the generated typescript typings were
incorrect for this function.
Fixes#24409
Co-authored-by: Sam Saccone <samccone@gmail.com>
* test: use delay() helper (#24321)
* test: make sure tests fail properly instead of timing out (#24316)
* test: remove defer()
Co-authored-by: Milan Burda <miburda@microsoft.com>
* chore: bump chromium in DEPS to 85.0.4165.1
* chore: bump chromium in DEPS to 85.0.4166.1
* chore: bump chromium in DEPS to 85.0.4166.2
* chore: bump chromium in DEPS to 85.0.4166.3
* update patches
* fixup! Revert "[printing] Mojofy PrintHostMsg_CheckForCancel"
(cherry picked from commit 2cc1caf5d7d716ceefb23d5228a79544a2e91206)
* update patches
* Revert "[printing] Mojofy PrintHostMsg_CheckForCancel"
(cherry picked from commit c2b389957836ad77eb8e977872e6a8590666f3da)
* Remove WebImeTextSpan
https://chromium-review.googlesource.com/c/chromium/src/+/2225240
(cherry picked from commit d839261d71b156c972d3878f16f971e6b6d98f45)
* Remove PDFAnnotations flag altogether.
https://chromium-review.googlesource.com/c/chromium/src/+/2229317
(cherry picked from commit 50384ed12602d4a9da3209eacfca4faae78f9986)
* Rework find-from-selection so it's synchronous -- fixes flaky tests
https://chromium-review.googlesource.com/c/chromium/src/+/2181570
(cherry picked from commit 3e9241560390fb18969393beda425afc63f5a151)
* Use ExtensionSystem::is_ready() instead of ExtensionService::is_ready()
https://chromium-review.googlesource.com/c/chromium/src/+/2207499
(cherry picked from commit 2424589454a9a2ef9cc89c232b4ee87b0bf400cc)
* update sysroots
(cherry picked from commit b5ea653e602152dde00303d1cfb915d4df320983)
* chore: bump chromium in DEPS to 85.0.4167.1
* Take RFH as a parameter for DidUpdateFavicon/ManifestURL
https://chromium-review.googlesource.com/c/chromium/src/+/2224745
(cherry picked from commit ad40668221732e28bcc8b9b270ab4686c42e956a)
* update patches
* update patches
* Rename net::cookie_util::StripStatuses to StripAccessResults
https://chromium-review.googlesource.com/c/chromium/src/+/2212697
(cherry picked from commit bf3de1fe1cbb17feb46b40c81f0eb13b1e7b6412)
* use net::CookieAccessResultList instead of net::CookieAccessResultList
(cherry picked from commit 400da79504da2310b7c1177b4b3f9f83a3f2b305)
* chore: bump chromium in DEPS to 85.0.4168.1
* fix mas_no_private_api patch
https://chromium-review.googlesource.com/c/chromium/src/+/2230281
(cherry picked from commit 9b127147e0ba7ef1d4454099effe49327b1a5ab6)
* Update patches
* fix: add new navigation state REUSE_SITE_INSTANCE
To fix the new set of state checks added in
https://chromium-review.googlesource.com/c/chromium/src/+/2215141
(cherry picked from commit 3a91b684efdc7742e7c5efa65263f80e8a24ec4a)
* chore: bump chromium in DEPS to 85.0.4169.1
* update patches
* chore: bump chromium in DEPS to 85.0.4170.1
* chore: bump chromium in DEPS to 85.0.4171.1
* chore: bump chromium in DEPS to 85.0.4172.1
* chore: bump chromium in DEPS to 85.0.4173.1
* chore: bump chromium in DEPS to 85.0.4174.1
* chore: bump chromium in DEPS to 85.0.4175.3
* chore: bump chromium in DEPS to 85.0.4176.1
* chore: bump chromium in DEPS to 85.0.4177.2
* chore: bump chromium in DEPS to 85.0.4178.1
* chore: bump chromium in DEPS to 85.0.4178.3
* refactor: MessageLoop, you are terminated \o/
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2246173
(cherry picked from commit 0368131d60)
* chore: bump chromium in DEPS to 85.0.4178.4
* update patches
* update lib_src_switch_buffer_kmaxlength_to_size_t.patch
(cherry picked from commit c5efbdd166)
* [v8] Allow for 4GB TypedArrays
https: //chromium-review.googlesource.com/c/v8/v8/+/2249668
(cherry picked from commit 2c1d6bfd9d)
Co-Authored-By: Robo <hop2deep@gmail.com>
* Cleanup usages of old mojo types and remove unused code
https://chromium-review.googlesource.com/c/chromium/src/+/2235699
(cherry picked from commit e89cb21e8e)
* refactor: plumb DownloadSchedule to DownloadItem
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2242202
(cherry picked from commit 4d549ae2b0)
* chore: fix variable typo in IPC
(cherry picked from commit 7251b1e6c5)
* chore: s/BindPipeAndPassReceiver/BindNewPipeAndPassReceiver
(cherry picked from commit e89bd6c639)
* chore: XEvent becomes x11::Event
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2240355
(cherry picked from commit 4d832da740)
* fixup! refactor: MessageLoop, you are terminated \o/
(cherry picked from commit 902d72d740)
* fixup! chore: XEvent becomes x11::Event
(cherry picked from commit 27043549f3)
* chore: fix windows build
(cherry picked from commit 4977098eb3)
* chore: disable SameSite-by-default changes
https://chromium-review.googlesource.com/c/chromium/src/+/2231445
(cherry picked from commit d8318aafff)
* update printing.patch
(cherry picked from commit e2037f527f)
* Convert WidgetHostMsg_SelectionBoundsChanged/TextInputStateChanged
https://chromium-review.googlesource.com/c/chromium/src/+/2243531
(cherry picked from commit 60ff2e067d)
* [XProto] Replace usages of XID and ::Window with x11::Window
https://chromium-review.googlesource.com/c/chromium/src/+/2249389
(cherry picked from commit 97f5b59e06)
* Update VideoFrameMetadata to use base::Optionals
https://chromium-review.googlesource.com/c/chromium/src/+/2231706https://chromium-review.googlesource.com/c/chromium/src/+/2238361
(cherry picked from commit 4787e1f541)
* --disable-dev-shm-usage for gpu process crash
(cherry picked from commit 207d8a380a)
* update patches
* fixup: Cleanup usages of old mojo types and remove unused code
* update patches
* chore: bump chromium in DEPS to 85.0.4180.1
* build: update v8 headers
(cherry picked from commit 4808975f75)
* Update patches
* fixup: build: update v8 headers
* Fixup ssl_security_state_tab_helper.patch
* Add missing headers
* Adds icon loading service with sandbox for Windows.
https://chromium-review.googlesource.com/c/chromium/src/+/1987273
* disable app.getGPUInfo spec on linux
(cherry picked from commit b7ea16c4b7)
* Add missing headers for Linux and Windows
* Fixup Adds icon loading service with sandbox for Windows
* chore: bump chromium in DEPS to 85.0.4181.1
* update patches
* Fixup: (for real) Adds icon loading service with sandbox for Windows
* No more Vulkan info collection for UMA on Windows
https://chromium-review.googlesource.com/c/chromium/src/+/2252818
* extensions: Rename SharedUserScriptMaster to SharedUserScriptManager
https://chromium-review.googlesource.com/c/chromium/src/+/2258357
* Add missing headers
* fixup: extensions: Rename SharedUserScriptMaster to SharedUserScriptManager
* fixup: No more Vulkan info collection for UMA on Windows
* Add missing header
* Add resource for IDS_UTILITY_PROCESS_UTILITY_WIN_NAME
* fix build on windows
* fix gn check
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
* fix: let Node.js perform microtask checkpoint in the main process
* fix: don't specify v8::MicrotasksScope for explicit policy
* fix: remove checkpoint from some call-sites
We already perform checkpoint at the end of a task,
either through MicrotaskRunner or through NodeBindings.
There isn't a need to add them again when calling into JS
except when dealing with promises.
* fix: remove checkpoint from some call-sites
We already perform checkpoint at the end of a task,
either through MicrotaskRunner or through NodeBindings.
There isn't a need to add them again when calling into JS
except when dealing with promises.
* fix incorrect specs
* default constructor arguments are considered for explicit mark
* add regression spec
Co-authored-by: deepak1556 <hop2deep@gmail.com>
* test: load page with some content when testing extension
* test: use dom-ready to wait for page loaded with extension
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
* fix: default to NTLM v2 in the network service
* chore: update patch details
* update patches
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
* docs: move protocol-ns to protocol.md
* chore: fix up tests and implement missing pieces required for tests
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
The devtools profiler is not attached at the point we run out init scripts (or our apps preload scripts), we do not really want to change when we run these init scripts but for when a dev is doing performance work it makes sense to give them an option to make the devtools profiler actually work on both our init scripts and their preload script. This PR adds that logic behind an environment variable ELECTRON_PROFILE_INIT_SCRIPTS.
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
When application is activated thru macOS app switcher (cmd+tab) the
App's activate event is note emitted. The reason is that
`applicationShouldHandleReopen:hasVisibleWindows:` is sent only when app
is activated via Dock. Using `applicationDidBecomeActive:` is handling
all cases properly.
Co-authored-by: Lukas Weber <luweber@microsoft.com>
- [ ] PR title follows semantic [commit guidelines](https://github.com/electron/electron/blob/master/docs/development/pull-requests.md#commit-message-guidelines)
- [ ] [PR release notes](https://github.com/electron/clerk/blob/master/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/master/README.md#examples).
- [ ] This is **NOT A BREAKING CHANGE**. Breaking changes may not be merged to master until 11-x-y is branched.
@@ -28,15 +28,12 @@ The preferred method is to install Electron as a development dependency in your
app:
```sh
npm install electron --save-dev[--save-exact]
npm install electron --save-dev
```
The `--save-exact` flag is recommended for Electron prior to version 2, as it does not follow semantic
versioning. As of version 2.0.0, Electron follows semver, so you don't need `--save-exact` flag. For info on how to manage Electron versions in your apps, see
@@ -6,11 +6,7 @@ To report a security issue, email [security@electronjs.org](mailto:security@elec
The Electron team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
Report security bugs in third-party modules to the person or team maintaining the module. You can also report a vulnerability through the [npm contact form](https://www.npmjs.com/support) by selecting "I'm reporting a security vulnerability".
## The Electron Security Notification Process
For context on Electron's security notification process, please see the [Notifications](https://github.com/electron/governance/blob/master/wg-security/membership-and-notifications.md#notifications) section of the Security WG's [Membership and Notifications](https://github.com/electron/governance/blob/master/wg-security/membership-and-notifications.md) Governance document.
Report security bugs in third-party modules to the person or team maintaining the module. You can also report a vulnerability through the [Node Security Project](https://nodesecurity.io/report).
## Learning More About Security
To learn more about securing an Electron application, please see the [security tutorial](docs/tutorial/security.md).
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
if ($(7z a $zipfile src\third_party\angle\.git\HEAD;$LASTEXITCODE -ne 0)) {
Write-warning "Failed to add third_party\angle\.git\HEAD; continuing anyway"
}
}
- ps:>-
@@ -214,8 +207,7 @@ test_script:
echo "Skipping tests for $env:GN_CONFIG build"
}
- cd electron
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
- if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --trace-uncaught --enable-logging --disable-features=CalculateNativeWinOcclusion )
- if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --trace-uncaught --enable-logging)
- cd ..
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
*`url` String - a URL with the protocol name to check. Unlike the other
methods in this family, this accepts an entire URL, including `://` at a
minimum (e.g. `https://`).
Returns `Promise<Object>` - Resolve with an object containing the following:
*`icon` NativeImage - the display icon of the app handling the protocol.
*`path` String - installation path of the app handling the protocol.
*`name` String - display name of the app handling the protocol.
This method returns a promise that contains the application name, icon and path of the default handler for the protocol
(aka URI scheme) of a URL.
### `app.setUserTasks(tasks)` _Windows_
*`tasks` [Task[]](structures/task.md) - Array of `Task` objects
@@ -1026,7 +967,6 @@ if (!gotTheLock) {
// Create myWindow, load the rest of the app, etc...
app.whenReady().then(()=>{
myWindow=createWindow()
})
}
```
@@ -1142,10 +1082,8 @@ For `infoType` equal to `complete`:
For `infoType` equal to `basic`:
Promise is fulfilled with `Object` containing fewer attributes than when requested with `complete`. Here's an example of basic response:
```js
{
auxAttributes:
{
amdSwitchable:true,
{auxAttributes:
{amdSwitchable:true,
canSupportThreadedTextureMailbox:false,
directComposition:false,
directRendering:true,
@@ -1158,14 +1096,12 @@ For `infoType` equal to `basic`:
sandboxed:false,
softwareRendering:false,
supportsOverlays:false,
videoDecodeAcceleratorFlags:0
},
gpuDevice:
[{active:true,deviceId:26657,vendorId:4098},
{active:false,deviceId:3366,vendorId:32902}],
machineModelName:'MacBookPro',
machineModelVersion:'11.5'
}
videoDecodeAcceleratorFlags:0},
gpuDevice:
[{active:true,deviceId:26657,vendorId:4098},
{active:false,deviceId:3366,vendorId:32902}],
machineModelName:'MacBookPro',
machineModelVersion:'11.5'}
```
Using `basic` should be preferred if only basic information like `vendorId` or `driverId` is needed.
@@ -1217,13 +1153,6 @@ Returns `Object`:
should restore the state from the previous session. This indicates that the
app should restore the windows that were open the last time the app was
closed. This setting is not available on [MAS builds][mas-builds].
* `executableWillLaunchAtLogin` Boolean _Windows_ - `true` if app is set to open at login and its run key is not deactivated. This differs from `openAtLogin` as it ignores the `args` option, this property will be true if the given executable would be launched at login with **any** arguments.
*`launchItems` Object[] _Windows_
*`name` String _Windows_ - name value of a registry entry.
*`path` String _Windows_ - The executable to an app that corresponds to a registry entry.
*`args` String[] _Windows_ - the command-line arguments to pass to the executable.
*`scope` String _Windows_ - one of `user` or `machine`. Indicates whether the registry entry is under `HKEY_CURRENT USER` or `HKEY_LOCAL_MACHINE`.
*`enabled` Boolean _Windows_ - `true` if the app registry key is startup approved and therefore shows as `enabled` in Task Manager and Windows settings.
*`args` String[] (optional) _Windows_ - The command-line arguments to pass to
the executable. Defaults to an empty array. Take care to wrap paths in
quotes.
*`enabled` Boolean (optional) _Windows_ - `true` will change the startup approved registry key and `enable / disable` the App in Task Manager and Windows Settings.
Defaults to `true`.
*`name` String (optional) _Windows_ - value name to write into registry. Defaults to the app's AppUserModelId().
Set the app's login item settings.
To work with Electron's `autoUpdater` on Windows, which uses [Squirrel][Squirrel-Windows],
@@ -1296,7 +1223,7 @@ Show the app's about panel options. These options can be overridden with `app.se
* `authors` String[] (optional) _Linux_ - List of app authors.
* `website` String (optional) _Linux_ - The app's website.
* `iconPath` String (optional) _Linux_ _Windows_ - Path to the app's icon in a JPEG or PNG file format. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
* `iconPath` String (optional) _Linux_ _Windows_ - Path to the app's icon. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
Set the about panel options. This will override the values defined in the app's `.plist` file on macOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
@@ -1357,7 +1284,7 @@ method returns false. If we fail to perform the copy, then this method will
throw an error. The message in the error should be informative and tell
you exactly what went wrong.
By default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. If it _is_ running, the pre-existing running app will assume focus and the previously active app will quit itself. This behavior can be changed by providing the optional conflict handler, where the boolean returned by the handler determines whether or not the move conflict is resolved with default behavior. i.e. returning `false` will ensure no further action is taken, returning `true` will result in the default behavior and the method continuing.
By default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. If it _is_ running, the pre-existing running app will assume focus and the the previously active app will quit itself. This behavior can be changed by providing the optional conflict handler, where the boolean returned by the handler determines whether or not the move conflict is resolved with default behavior. i.e. returning `false` will ensure no further action is taken, returning `true` will result in the default behavior and the method continuing.
For example:
@@ -1485,12 +1412,3 @@ which native modules you can use in the renderer process. For more information
on the direction Electron is going with renderer process restarts and usage of
native modules in the renderer process please check out this
@@ -541,12 +541,6 @@ Note that this is only emitted when the window is being resized manually. Resizi
Emitted after the window has been resized.
#### Event: 'resized' _macOS_ _Windows_
Emitted once when the window has finished being resized.
This is usually emitted when the window has been resized manually. On macOS, resizing the window with `setBounds`/`setSize` and setting the `animate` parameter to `true` will also emit this event once resizing has finished.
#### Event: 'will-move' _macOS_ _Windows_
Returns:
@@ -562,12 +556,12 @@ Note that this is only emitted when the window is being resized manually. Resizi
Emitted when the window is being moved to a new position.
#### Event: 'moved' _macOS_ _Windows_
__Note__: On macOS this event is an alias of `moved`.
#### Event: 'moved' _macOS_
Emitted once when the window is moved to a new position.
__Note__: On macOS this event is an alias of `move`.
#### Event: 'enter-full-screen'
Emitted when the window enters a full-screen state.
@@ -610,7 +604,7 @@ e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.
```javascript
const{BrowserWindow}=require('electron')
constwin=newBrowserWindow()
letwin=newBrowserWindow()
win.on('app-command',(e,cmd)=>{
// Navigate the window back when the user hits their mouse back button
@@ -22,8 +22,10 @@ Sets `menu` as the application menu on macOS. On Windows and Linux, the
Also on Windows and Linux, you can use a `&` in the top-level item name to
indicate which letter should get a generated accelerator. For example, using
`&File` for the file menu would result in a generated `Alt-F` accelerator that
opens the associated menu. The indicated character in the button label gets an
underline. The `&` character is not displayed on the button label.
opens the associated menu. The indicated character in the button label then gets an
underline, and the `&` character is not displayed on the button label.
In order to escape the `&` character in an item name, add a proceeding `&`. For example, `&&File` would result in `&File` displayed on the button label.
Passing `null` will suppress the default menu. On Windows and Linux,
this has the additional effect of removing the menu bar from the window.
@@ -96,7 +98,7 @@ Appends the `menuItem` to the menu.
*`id` String
Returns `MenuItem | null` the item with the specified `id`
Returns `MenuItem` the item with the specified `id`
The Electron team is currently undergoing an initiative to modernize our API in a few concrete ways. These include: updating our modules to use idiomatic JS properties instead of separate `getPropertyX` and `setpropertyX`, converting callbacks to promises, and removing some other anti-patterns present in our APIs. The current status of the Promise initiative can be tracked in the [promisification](promisification.md) tracking file.
The Electron team is currently undergoing an initiative to modernize our API in a few concrete ways. These include: updating our modules to use idiomatic JS properties instead of separate `getPropertyX` and `setpropertyX`, converting callbacks to promises, and removing some other anti-patterns present in our APIs. The current status of the Promise intiative can be tracked in the [promisification](promisification.md) tracking file.
As we work to perform these updates, we seek to create the least disruptive amount of change at any given time, so as many changes as possible will be introduced in a backward compatible manner and deprecated after enough time has passed to give users a chance to upgrade their API calls.
*`versionId` Number - The version ID of the service worker that sent the log message
*`source` String - The type of source for this message. Can be `javascript`, `xml`, `network`, `console-api`, `storage`, `app-cache`, `rendering`, `security`, `deprecation`, `worker`, `violation`, `intervention`, `recommendation` or `other`.
*`level` Number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
*`level` Number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
*`sourceUrl` String - The URL the message came from
*`lineNumber` Number - The line number of the source that triggered this console message
*`webContents` [WebContents](web-contents.md) - WebContents requesting the permission. Please note that if the request comes from a subframe you should use `requestingUrl` to check the request origin.
*`permission` String - The type of requested permission.
*`clipboard-read` - Request access to read from the clipboard.
*`media` - Request access to media devices such as camera, microphone and speakers.
*`mediaKeySystem` - Request access to DRM protected content.
*`geolocation` - Request access to user's current location.
*`notifications` - Request notification creation and the ability to display them in the user's system tray.
*`midi` - Request MIDI access in the `webmidi` API.
*`midiSysex` - Request the use of system exclusive messages in the `webmidi` API.
*`pointerLock` - Request to directly interpret mouse movements as an input method. Click [here](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API) to know more.
*`fullscreen` - Request for the app to enter fullscreen mode.
*`openExternal` - Request to open links in external applications.
*`permission` String - Enum of 'media', 'geolocation', 'notifications', 'midiSysex',
'pointerLock', 'fullscreen', 'openExternal'.
*`callback` Function
*`permissionGranted` Boolean - Allow or deny the permission.
*`details` Object - Some properties are only available on certain permission types.
*`isDefault` Boolean - whether or not a given printer is set as the default printer on the OS.
*`options` Object - an object containing a variable number of platform-specific printer information.
The number represented by `status` means different things on different platforms: on Windows its potential values can be found [here](https://docs.microsoft.com/en-us/windows/win32/printdocs/printer-info-2), and on Linux and macOS they can be found [here](https://www.cups.org/doc/cupspm.html).
The number represented by `status` means different things on different platforms: on Windows it's potential values can be found [here](https://docs.microsoft.com/en-us/windows/win32/printdocs/printer-info-2), and on Linux and macOS they can be found [here](https://www.cups.org/doc/cupspm.html).
@@ -406,7 +408,7 @@ systemPreferences.promptTouchID('To get consent for a Security-Gated Thing').the
})
```
This API itself will not protect your user data; rather, it is a mechanism to allow you to do so. Native apps will need to set [Access Control Constants](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags?language=objc) like [`kSecAccessControlUserPresence`](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags/ksecaccesscontroluserpresence?language=objc) on their keychain entry so that reading it would auto-prompt for Touch ID biometric consent. This could be done with [`node-keytar`](https://github.com/atom/node-keytar), such that one would store an encryption key with `node-keytar` and only fetch it if `promptTouchID()` resolves.
This API itself will not protect your user data; rather, it is a mechanism to allow you to do so. Native apps will need to set [Access Control Constants](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags?language=objc) like [`kSecAccessControlUserPresence`](https://developer.apple.com/documentation/security/secaccesscontrolcreateflags/ksecaccesscontroluserpresence?language=objc) on the their keychain entry so that reading it would auto-prompt for Touch ID biometric consent. This could be done with [`node-keytar`](https://github.com/atom/node-keytar), such that one would store an encryption key with `node-keytar` and only fetch it if `promptTouchID()` resolves.
**NOTE:** This API will return a rejected Promise on macOS systems older than Sierra 10.12.2.
@@ -217,11 +217,9 @@ Sets the `image` associated with this tray icon when pressed on macOS.
Sets the hover text for this tray icon.
#### `tray.setTitle(title[, options])` _macOS_
#### `tray.setTitle(title)` _macOS_
*`title` String
*`options` Object (optional)
*`fontType` String (optional) - The font family variant to display, can be `monospaced` or `monospacedDigit`. `monospaced` is available in macOS 10.15+ and `monospacedDigit` is available in macOS 10.11+. When left blank, the title uses the default system font.
Sets the title displayed next to the tray icon in the status bar (Support ANSI colors).
*`success` Boolean - Indicates success of the print call.
*`failureReason` String - Error description called back if the print fails.
When a custom `pageSize` is passed, Chromium attempts to validate platform specific minimum values for `width_microns` and `height_microns`. Width and height must both be minimum 353 microns but may be higher on some operating systems.
When a custom `pageSize` is passed, Chromium attempts to validate platform specific minumum values for `width_microns` and `height_microns`. Width and height must both be minimum 353 microns but may be higher on some operating systems.
Prints window's web page. When `silent` is set to `true`, Electron will pick
the system's default printer if `deviceName` is empty and the default settings for printing.
@@ -1350,14 +1321,7 @@ Use `page-break-before: always;` CSS style to force to print to a new page.
@@ -14,15 +14,6 @@ This document uses the following convention to categorize breaking changes:
## Planned Breaking API Changes (12.0)
### Default Changed: `contextIsolation` defaults to `true`
In Electron 12, `contextIsolation` will be enabled by default. To restore
the previous behavior, `contextIsolation: false` must be specified in WebPreferences.
We [recommend having contextIsolation enabled](https://github.com/electron/electron/blob/master/docs/tutorial/security.md#3-enable-context-isolation-for-remote-content) for the security of your application.
For more details see: https://github.com/electron/electron/issues/23506
### Removed: `crashReporter` methods in the renderer process
The following `crashReporter` methods are no longer available in the renderer
[Electron's Build Tools](https://github.com/electron/build-tools) automate much of the setup for compiling Electron from source with different configurations and build targets. If you wish to set up the environment manually, the instructions are listed below.
## GN prerequisites
You'll need to install [`depot_tools`][depot-tools], the toolset
If you're developing Electron and don't plan to redistribute your
custom Electron build, you may skip this section.
Official Electron builds are built with [Xcode 9.4.1](http://adcdownload.apple.com/Developer_Tools/Xcode_9.4.1/Xcode_9.4.1.xip), and the macOS 10.13 SDK. Building with a newer SDK works too, but the releases currently use the 10.13 SDK.
Official Electron builds are built with [Xcode 11.1](https://download.developer.apple.com/Developer_Tools/Xcode_11.1/Xcode_11.1.xip), and the macOS 10.15 SDK. Building with a newer SDK works too, but the releases currently use the 10.15 SDK.
1. Ensure that `master` on `electron/node` has updated release tags from `nodejs/node`
2. Create a branch in https://github.com/electron/node: `electron-node-vX.X.X` where the base that you're branching from is the tag for the desired update
-`vX.X.X` Must use a version of Node compatible with our current version of Chromium
3. Re-apply our commits from the previous version of Node we were using (`vY.Y.Y`) to `v.X.X.X`
- Check release tag and select the range of commits we need to re-apply
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.