* mac: add dialog.closeMessageBox API
* win: Implement dialog.closeMessageBox
* mac: Return cancelId with closeMessageBox
* gtk: Implement dialog.closeMessageBox
* win: Fix 32bit build
* win: Reduce the scope of lock
* fix: Build error after rebase
* feat: Use AbortSignal to close message box
* chore: silently handle duplicate ID
* win: Add more notes about the threads
* chore: apply reviews
* fix: base::NoDestructor should be warpped in function
* chore: fix style on windows
* feat: add MenuItem.userAccelerator property
This allows folks to read the user-assigned accelerator that macOS users can provide in system preferences. Useful for showing in-app shortcut help dialogs, you need to know if the accelerator you provided is not being used in favor of a user assigned one.
* chore: update syntax
* chore: add safety check for command index being -1
* refactor: use PathProvider for user-data-dir and others
* consolidate logic for DIR_RECENT and DIR_APP_LOGS into path provider
* fix bad include
* remove debugging code
* fix build on mac
* fix build on win
* create app logs dir on both mac and non-mac
This fixes a flake on linux CI which started recently where the "write"
promise is being rejected after the request has been aborted /
cancelled. In this case we should drop the error to the floor but
instead we pass it down the stack where it eventually emits a now
unhandled error event.
Example failure: https://app.circleci.com/pipelines/github/electron/electron/38072/workflows/c1faf19b-aa41-4f99-a564-165729222859/jobs/838813
Verified fix by running the test that caused it 10000 times before fix
and 10000 times after. ~50 failures before, 0 after.
* fix: invoke the window open handler for _blank links
* feat: add disposition to setWindowOpenHandler details
* fix: pass postData to new-window event
* postData can be heterogeneous
* fix type of postBody
* fix type of UploadFile and UploadRawData to be discriminated unions
* exclude the empty string from additionalFeatures
* add a test
* add postBody and referrer to setWindowOpenHandler args
* appease typescript
* Update api-browser-window-spec.ts
* update snapshots
* refactor: clean up webFrame implementation to use gin wrappers
The previous implementation of webFrame in the renderer process leaked
sub-frame contexts and global objects across the context boundaries thus
making it possible for apps to either maliciously or accidentally
violate the contextIsolation boundary.
This re-implementation binds all methods in native code directly to
content::RenderFrame instances instead of relying on JS to provide a
"window" with every method request. This is much more consistent with
the rest of the Electron codebase and is substantially safer.
* chore: un-re-order for ease of review
* chore: pass isolate around instead of ErrorThrower
* chore: fix rebase typo
* chore: remove unused variables
* chore: add types for electron_renderer_web_frame binding
* chore: use keyof for getWebPreference type
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
* fix: ensure child window transparency works
Windows opened via window.open and intecepted via setWindowOpenHandler
or the `new-window` event should (a) have the correct background color
and (b) that background color should be transparent if specified.
The changes in api_web_contents fix (a) and the changes in
web_contents_preferences fix (b).
Notes: Child windows with specified background colors or transpency now
work as intended
* fix: set background_color in blink prefs apply logic
* chore: update for PR comments