Commit graph

1898 commits

Author SHA1 Message Date
Milan Burda
c5ad7ed0cd
refactor: remove guestInstanceId from WebPreferences (#30280)
* refactor: remove guestInstanceId from WebPreferences

* refactor: remove WebViewManager::GetEmbedder
2021-07-28 15:32:53 -07:00
Milan Burda
fc7ea75009
refactor: move related code to makeWebPreferences in guest-view-manager.ts (#30272) 2021-07-27 16:12:49 -07:00
Milan Burda
a545cd3790
fix: type internal APIs that can return null properly (#29852) 2021-07-27 14:48:12 +09:00
Cheng Zhao
05ba6359d0
feat: add signal option to dialog.showMessageBox (#26102)
* 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
2021-07-15 07:59:27 +09:00
Shelley Vohr
af991123f1
fix: self.module.paths not working in web workers (#29955)
* fix: global.module.paths in workers

* spec: add a regression test
2021-07-05 08:48:46 +09:00
Samuel Attard
da9261497e
feat: add MenuItem.userAccelerator property (#26682)
* 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
2021-06-29 16:28:16 -07:00
Shelley Vohr
9b5dd5380f
fix: Inspector method overrides when contextIsolation enabled (#29841) 2021-06-24 20:36:22 +02:00
Jeremy Rose
0f16575eee
fix: stop window.open from hanging when prevented (#29851) 2021-06-24 08:50:48 -07:00
Milan Burda
de6696ef1d
chore: remove unused and broken ipcRendererInternal.sendTo() (#29743) 2021-06-17 23:26:18 -05:00
Jeremy Rose
ebf54d7cc0
refactor: use PathProvider for user-data-dir and others (#29649)
* 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
2021-06-15 09:32:56 +09:00
Shelley Vohr
a4decffe9a
fix: improper wrapping of fs.promises.readFile (#29528) 2021-06-07 21:19:39 +02:00
Milan Burda
8d0ed05c99
refactor: replace a few usages of V8 hidden properties (#29400) 2021-06-03 14:59:56 +09:00
Milan Burda
44491b023a
refactor: eliminate duplicate C++ / JavaScript implementation of app.isPackaged (#29464) 2021-06-02 12:17:08 -07:00
Shelley Vohr
3b75549511
fix: inspector context menu throwing an error (#29436) 2021-06-01 20:39:48 -07:00
Milan Burda
8fc86517fa
refactor: expose process.contextId directly (#29236) 2021-05-24 16:51:54 +09:00
Robo
77297f37a3
fix: adjust initial webContents focus calculation (#29204)
* fix: adjust initial webContents focus calculation

* fix: active window check on mac

* fix: about:blank focus behavior

* chore: add spec

Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
2021-05-19 02:27:35 -07:00
Milan Burda
c68c65f383
refactor: implement <webview> using contextBridge (#29037)
* refactor: implement <webview> using contextBridge

* chore: address PR feedback

* chore: address PR feedback

* fix: check for HTMLIFrameElement instance in attachGuest
2021-05-15 16:42:07 +09:00
Tabish Mahfuz
5ceec9189e
fix: Menu.setApplicationMenu can return a useless array 29088 (#29118) 2021-05-12 12:02:30 -07:00
Milan Burda
49ef1fe342
refactor: use WeakMap instead of hidden V8 properties to store WebViewImpl (#29049) 2021-05-07 17:56:22 -07:00
Milan Burda
25f5c01cec
refactor: remove setupWebViewAttributes gymnastics (#29032) 2021-05-07 09:07:47 +02:00
Milan Burda
cbba602eae
chore: cleanup dead <webview> related code (#29039) 2021-05-06 13:56:05 -07:00
Milan Burda
dab9a88413
refactor: invoke loadURL in SrcAttribute instead of sending IPC directly (#29031) 2021-05-06 13:55:32 -07:00
Milan Burda
2c65060ec8
chore: make raw requires type-safe (#29006)
* chore: make raw requires type-safe

* refactor: no need for separate webViewImplModule

* refactor: no need for separate guestViewInternalModule
2021-05-05 18:05:01 -07:00
Milan Burda
2086e1903c
refactor: 'focus-change' does not need guestInstanceId (#29001)
* refactor: 'focus-change' does not need guestInstanceId

* refactor: rename internal 'focus-change' event to '-focus-change'
2021-05-05 11:37:40 -07:00
Milan Burda
476e908269
fix: <webview> focus / blur events don't work with contextIsolation enabled (#29004) 2021-05-05 11:31:44 -07:00
Milan Burda
42e5421276
refactor: remove unnecessary setupDialogProperties (#28982) 2021-05-05 16:00:41 +09:00
Milan Burda
961b74b2ac
refactor: use "as const" for constant mappings (#28980) 2021-05-04 14:12:49 -07:00
Samuel Attard
e5e8ab4eea
refactor: remove more dead code post render process reuse (#28983)
* Overrides for window.history.*
* Node environment cleanup / creation logic
* Options and switches that are now static values
2021-05-04 11:30:29 -07:00
Milan Burda
a0589ca5d7
chore: remove unused element_instance_id_to_guest_map_ from WebViewManager (#28979) 2021-05-04 09:59:44 -04:00
Samuel Attard
791eddd541
fix: provide no-op implementation of app.setUserModelId (#28915) 2021-04-28 18:41:03 -07:00
Samuel Attard
0a1b26b1d5
refactor: remove internal navigation controller (#28839) 2021-04-27 16:11:18 -07:00
Samuel Attard
79077f6df9
chore: remove app.allowRendererProcessReuse (#26874) 2021-04-21 13:59:11 -07:00
Jeremy Rose
4ca518468d
feat: remove BrowserWindow option inheritance (#28550) 2021-04-21 10:55:17 -07:00
Shelley Vohr
11199d8824
feat: add BrowserWindow.isFocusable() (#28642) 2021-04-21 12:32:19 +02:00
Jeremy Rose
e12a3cb59c
feat: remove deprecated additionalFeatures (#28548) 2021-04-19 15:46:54 -07:00
Samuel Attard
b8c2481edb
fix: do not handle write errors after request is aborted (#28682)
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.
2021-04-19 09:50:14 -04:00
Jeremy Rose
dba4df9326
feat: add more info in setWindowOpenHandler details (#28518)
* 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
2021-04-13 15:35:27 -04:00
Samuel Attard
6df2680cb6
refactor: clean up webFrame implementation to use gin wrappers (#28497)
* 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
2021-04-12 16:35:18 -07:00
Shelley Vohr
95e26e2fd4
refactor: use URL API (#28583) 2021-04-09 14:22:18 -07:00
Milan Burda
da8c35e3b2
chore: remove deprecated worldSafeExecuteJavaScript option (#28456) 2021-04-08 12:03:57 -04:00
Jeremy Rose
77dcf1020a
fix: pass postData to new-window event (#28513) 2021-04-06 09:54:05 -07:00
Jeremy Rose
62b38812b6
fix: invoke the window open handler for _blank links (#28498)
* fix: invoke the window open handler for _blank links

* add test
2021-04-06 01:04:14 -07:00
Milan Burda
55c66e3e92
chore: add types for electron_renderer_web_frame binding (#28455)
* chore: add types for electron_renderer_web_frame binding

* chore: use keyof for getWebPreference type

Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2021-04-02 14:34:28 -07:00
Erick Zhao
f55aa78883
chore: update Community link in default menu (#28449) 2021-03-30 23:22:55 -07:00
Shelley Vohr
7c36463085
fix: window.print() in pdf plugin (#28328) 2021-03-23 10:40:37 -04:00
Jeremy Rose
502d4c19ce
feat: allow omitting submitURL when uploadToServer is false (#28105) 2021-03-18 14:15:19 -07:00
Milan Burda
485fa5bea9
feat: add process.contextId used by @electron/remote (#28007) 2021-03-17 11:23:03 -07:00
Jeremy Rose
d27ad0d182
fix: revert "refactor: mmap asar files (#24470)" (#28137)
This reverts commit 01a2e23194.
2021-03-15 11:42:54 -07:00
Samuel Attard
089ac8180f
fix: ensure child window transparency works (#28054)
* 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
2021-03-10 12:44:36 -08:00
Milan Burda
5b205731f6
chore: remove deprecated remote module (#25734)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-03-09 17:12:40 -08:00