Commit graph

78 commits

Author SHA1 Message Date
Tomasz
a0effaf9b8
fix: promise resolved to early when browser initiated in-page navigation (#39260) 2023-08-09 16:06:39 +02:00
Milan Burda
724f90a2a7
refactor: throw errors directly in async functions (#39233) 2023-07-31 10:39:37 +02:00
Milan Burda
455f57322f
refactor: use TypeError instead of generic Error when appropriate (#39209)
refactor: use TypeError instead of generic Error when appropriate
2023-07-25 12:08:46 -04:00
Shelley Vohr
10852b3fd5
fix: preferCSSPageSize error type (#38761)
fix: preferCSSPageSize error type
2023-06-14 10:49:00 -04:00
Shelley Vohr
c0d9764de9
fix: webContents.print parameter validation error (#38614) 2023-06-09 21:41:01 +02:00
Shelley Vohr
c5972ba43c
fix: bad error passing webContents.print(null) (#38612)
fix: bad error passing webContents.print(null)
2023-06-07 19:18:26 +02:00
Milan Burda
82af000a37
chore: cleanup eslint suppressions (#38417)
* chore: cleanup eslint suppressions

* address feedback

* revert script/lib/azput.js

* revert spec/fixtures/apps/remote-control/main.js

* address feedback

* revert typings/internal-ambient.d.ts
2023-05-25 10:09:17 +09:00
David Sanders
a26343f3e0
fix: falsy transparent shouldn't affect webContents background (#36914) 2023-05-02 14:44:34 -07:00
Milan Burda
edf887bdc5
refactor: use _loadURL(url, options ?? {}); (#37337) 2023-02-27 10:05:58 +01:00
Shelley Vohr
889859df5b
feat: include all standard paper sizes for webContents.print() (#37159) 2023-02-14 11:44:34 +01:00
Jeremy Rose
71944f2c3b
refactor: simplify events (#37099) 2023-02-13 13:39:18 -08:00
Jeremy Rose
8dc98aeeae
chore: remove load-url event (#37174) 2023-02-09 14:40:37 +09:00
Eugene Nesvetaev
ce56d614a3
chore: fix typo in promise rejection (#36763) 2023-01-12 12:32:56 +01:00
Jeremy Rose
625b4619d6
fix: resolve loadURL properly for in-page navigations (#36129) 2022-10-26 13:57:39 -07:00
Yusoo
dde513b0d3
fix: printToPDF default margins (#36060)
printToPDF default margins

The document printToPDF has a 1cm margin and this default value has been added in the code.
2022-10-19 10:16:28 +02:00
Shelley Vohr
ee7cf5a6d4
fix: webContents.printToPDF option plumbing (#35975)
fix: contents.printToPDF option plumbing
2022-10-11 16:06:34 -07:00
Samuel Maddock
c09c94fc98
feat: add WebContents.opener and webContents.fromFrame() (#35140)
* feat: add WebContents.opener

* feat: add webContents.fromFrame(frame)

* fix: unknown type name

* test: fix and add more fromFrame cases

* docs: clarified terminology
2022-09-26 12:37:08 -04:00
Milan Burda
f62aab76b3
fix: potential exception when calling webFrameMainBinding.fromIdOrNull() (#35785)
* fix: potential exception when calling webFrameMainBinding.fromIdOrNull()

* replace try/catch in getWebFrameForEvent

Co-authored-by: Milan Burda <miburda@microsoft.com>
2022-09-24 12:19:07 -07:00
Milan Burda
e85450b21a
fix: IPC emit order in -ipc-ports handler (#35320)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2022-08-16 11:21:56 +09:00
Milan Burda
8424779906
refactor: don't expose deprecate as an internal module (#35311) 2022-08-15 17:09:33 +09:00
Milan Burda
8646bf8d30
chore: remove deprecated 'new-window' event (#34526) 2022-08-09 17:57:05 -04:00
Jeremy Rose
6d859dcd7f
feat: add WebContents.ipc (#34959) 2022-08-03 16:55:12 -07:00
Jeremy Rose
3c63f075bd
chore: remove unused WebContents._sendToFrameInternal (#35010) 2022-07-21 10:25:54 -07:00
Milan Burda
0f528c1e43
chore: let result: ReturnType<typeof this._callWindowOpenHandler>; (#34628) 2022-06-21 10:39:41 +09:00
Josh Soref
ea4278754c
chore: fix spelling errors in multiple files (#34574)
* chore: fix spelling in .circleci

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in BUILD.gn

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in appveyor.yml

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in build

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in docs

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in lib

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in script

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in shell

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in spec

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in spec-main

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-06-16 16:46:11 +09:00
Shelley Vohr
bed38e0985
fix: crash when setWindowOpenHandler callback throws (#34523)
* fix: crash when setWindowOpenHandler throws

* refactor: throw as process uncaughtException event
2022-06-14 12:22:23 -04:00
Shelley Vohr
93b39b92b5
refactor: printToPDF should be headless (#33654) 2022-05-31 08:21:25 +02:00
Robo
16f8d713ab
fix: apply senderFrame details to ipcMain port event (#33756) 2022-04-13 21:01:00 -07:00
David Sanders
df8fd1b269
build: fix build by removing usage of removed preloadUrl (#33319) 2022-03-17 00:13:48 -07:00
Jeremy Rose
27527fe5ca
feat: warn that preloads will be sandboxed by default in v20 (#32868) 2022-03-08 15:39:53 -08:00
t57ser
41b2945ced
feat: add ability to configure if window should close when opener closes (#31314)
* feat: Added ability to configure if window should close when opener closes

* fix: check if embedder is destroyed

* fix: correctly take over closeWithOpener property

* chore: Added documentation

* Update docs/api/window-open.md

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>

* chore: refactor

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

* chore: changed property name from `closeWithOpener` to `outlivesOpener`

* dummy change to kick lint

* undo above

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2022-02-23 16:59:50 +09:00
Jeremy Rose
a015332342
fix: drop nativeWindowOpen deprecation warning (#32370) 2022-01-06 12:01:55 -08:00
Jeremy Rose
d44a187d0b
feat: remove nativeWindowOpen option (#29405)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-01-06 09:28:03 -08:00
Milan Burda
2f9fd06534
chore: deprecate nativeWindowOpen in Electron 17 (#32116) 2022-01-06 05:08:59 -08:00
Keeley Hammond
ffbaa1d83f
fix: check for single bluetooth listener (#32240) 2021-12-17 16:55:43 -08:00
Samuel Attard
a11f5cbb27
fix: ensure bluetooth devices are not returned by default (#32178) 2021-12-15 11:46:48 -08:00
Cheng Zhao
35ac7fb8e6
fix: window.open not overriding parent's webPreferences (#32057)
* fix: window.open not overriding parent's webPreferences

* test: remove "nativeWindowOpen: false" from renderer tests
2021-12-06 12:54:14 +09:00
Milan Burda
18cc33055d
chore: move libs only used in browser out of common (#31780) 2021-11-10 08:54:51 -08:00
Darshan Sen
8f51d3e1bf
feat: add webContents.getPrintersAsync() (#31023)
This deprecates the synchronous and blocking `webContents.getPrinters()`
function and introduces `webContents.getPrintersAsync()`, which is
asynchronous and non-blocking.

Signed-off-by: Darshan Sen <darshan.sen@postman.com>
2021-10-25 14:16:58 -04:00
Milan Burda
5592652504
feat: warn when ipcRenderer.sendSync() called with no listeners for channel (#31344) 2021-10-14 14:24:04 -04:00
Keeley Hammond
bb6dc99d9d
chore: clarify new-window fix comment (#31069) 2021-09-22 15:30:55 -07:00
Keeley Hammond
4fcc0884f8
fix: propagate window.open settings to child window (#31031) 2021-09-21 09:06:20 -07:00
Samuel Maddock
352ac21413
feat: add webContents.fromDevToolsTargetId() (#29399)
* feat: add webContents.fromDevToolsTargetId()

* refactor: avoid using FromOrCreate
2021-08-27 14:01:24 -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
Milan Burda
961b74b2ac
refactor: use "as const" for constant mappings (#28980) 2021-05-04 14:12:49 -07:00
Samuel Attard
0a1b26b1d5
refactor: remove internal navigation controller (#28839) 2021-04-27 16:11:18 -07: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
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
Shelley Vohr
7c36463085
fix: window.print() in pdf plugin (#28328) 2021-03-23 10:40:37 -04: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