Commit graph

206 commits

Author SHA1 Message Date
Akshay Deo
dfc134de42
feat: add exposeInIsolatedWorld(worldId, key, api) to contextBridge (#34974)
* feat: add exposeInIsolatedWorld(worldId, key, api) to contextBridge

* Updates exposeInIslatedWorld worldId documentation
2022-09-21 13:17:10 -05:00
Milan Burda
fe7f296339
refactor: remove duplicate contextIsolation from getWebPreference() (#31730) 2021-11-08 11:57:56 -05:00
Jeremy Rose
4fd7c2adcd
feat: make desktopCapturer main-process-only (#30720)
* feat: make desktopCapturer main-process-only

* remove --enable-api-filtering-logging

* remove test

* merge lib/browser/api/desktop-capturer.ts with lib/browser/desktop-capturer.ts

* remove desktop-capturer-get-sources event

* fix specs

* getSources needs to be async

Co-authored-by: Milan Burda <milan.burda@gmail.com>
2021-10-04 12:16:00 +09:00
Jeremy Rose
55c57808fb
feat: serialize NativeImage over ipc (#30729) 2021-09-07 10:37:45 -07:00
Milan Burda
8b7631228f
chore: move native-image.ts back into common (#30838) 2021-09-06 11:06:27 +02:00
Jeremy Rose
ee0e15a52e
feat: deprecate desktopCapturer.getSources in the renderer (#30721) 2021-09-02 11:31:47 -07:00
Jeremy Rose
aa9da78edb
fix: remove ipc wrapper for nativeImage.createThumbnailFromPath (#30728) 2021-08-27 14:21:36 -07:00
Milan Burda
de6696ef1d
chore: remove unused and broken ipcRendererInternal.sendTo() (#29743) 2021-06-17 23:26:18 -05: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
Milan Burda
da8c35e3b2
chore: remove deprecated worldSafeExecuteJavaScript option (#28456) 2021-04-08 12:03:57 -04: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
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
Milan Burda
bf7e445883
fix: warning when worldSafeExecuteJavaScript is disabled (#27928) 2021-03-02 09:45:27 -08:00
Jeremy Rose
706d9ede9b
refactor: only allow internal messages from the main process (#27676) 2021-02-09 17:12:26 -08:00
Milan Burda
79b3393768
chore: remove bunch of usages of any (#27512) 2021-01-29 12:41:59 -08:00
Milan Burda
70190ec2b1
chore: update to latest TypeScript, which has built-in WeakRef declarations (#27425) 2021-01-22 11:25:47 -08:00
Nikita Kot
7672aa9525
feat: exposeInMainWorld allow to expose non-object APIs (#26594) 2020-12-04 09:43:20 -08:00
Milan Burda
b37982987a
chore: remove unused sendToAll + related APIs (#26771)
* chore: remove unused sendToAll + related APIs

* refactor: no need to args.ShallowClone() anymore
2020-12-03 15:55:50 +09:00
Milan Burda
022bafc485
chore: remove deprecated crashReporter APIs (#26695) 2020-11-26 22:07:40 +03:00
Milan Burda
c8d77cae4a
refactor: replace V8 hidden values with WeakMap / WeakSet (#26659) 2020-11-24 16:11:39 -05:00
Milan Burda
6932e02eb8
refactor: use getWebPreference() for all options (#26531) 2020-11-23 22:39:08 +03:00
Milan Burda
5ee9cc202b
fix: ensure that internal messages are sent from the main process (#26429) 2020-11-12 06:20:01 +03:00
loc
0b85fdf26c
feat: add webContents.setWindowOpenHandler API (#24517)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-11-10 09:06:03 -08:00
Milan Burda
0c2e2bca92
refactor: don't send ipcRenderer.sendSync() returnValue as an array (#26178) 2020-10-28 18:48:20 +03:00
Milan Burda
2c68bad631
refactor: create IPC_MESSAGES enum for IPC message channels (#25694) 2020-10-14 00:11:06 +03:00
David Sanders
b194030a34
chore: cleanup some typos in comments (#25770) 2020-10-13 10:25:21 -07:00
Jeremy Rose
9f4a097e03
feat: remove getMediaSourceIdForWebContents() (#25414)
This reverts commit 204f001c5d.
2020-09-14 10:38:05 -07:00
Jeremy Rose
dd781c4f63
chore: deprecate remote (#25293) 2020-09-10 09:17:17 -07:00
George Xu
beaf60de0a
feat: add nativeImage.createThumbnailFromPath API (#24802)
* initial commit, mac implementation

* add documentation

* convert createThumbnailFromPath to async function

* windows impl protoype

* add tests

* added test

* fix

* fix test

* clean up

* update docs

* cleaning up code

* fix test

* retrigger CI

* retrigger CI

* refactor from app to native_image

* windows build

* lint

* lint

* add smart pointers, fix test

* change tests and update docs

* fix test, remove nolint

* add renderer-main process routing to fix tests

* lint

* thanks sam

* thanks sam
2020-08-24 09:36:13 -07:00
Samuel Attard
b500294c1d
feat: add worldSafe flag for executeJS results (#24114)
* 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

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2020-07-23 14:32:20 -07:00
Jeremy Rose
36bd940bc3
refactor: ginify NativeImage (#24486) 2020-07-13 14:44:12 -07:00
Shelley Vohr
659e79fc08
refactor: prevent consistent early exception (#24191)
* refactor: prevent consistent early exception

* Use _linkedBinding where possible

* Remove dead electronBinding
2020-06-22 20:32:45 -07:00
Jeremy Rose
379bb174e9
refactor: use WeakRef on renderer side of remote (#24037) 2020-06-12 15:50:03 -07:00
Jeremy Rose
7274467f73
refactor: tsify remote (#24034) 2020-06-11 11:36:03 -07:00
Jeremy Rose
78fe545d18
refactor: remove renderer-side refcount in remote (#24054) 2020-06-11 10:22:28 -07:00
Samuel Attard
969f46a48f
chore: remove IPC hiddens (#23720) 2020-06-02 02:33:06 -07:00
Shelley Vohr
e8ea007104
fix: ensure nativeImage serialization main->renderer (#23759) 2020-05-28 09:43:15 -07:00
Jeremy Judeaux
204f001c5d
feat: add desktopCapturer.getMediaSourceIdForWebContents() to get stream source id from web contents (#22701)
* feat: add desktopCapturer.getMediaSourceIdForWebContents() to get stream source id from web contents

* Cleanup from #22701 PR comments
2020-05-26 16:34:24 -04:00
Shelley Vohr
762f7bcca2
refactor: use typeutils for nativeImage serialization (#23693) 2020-05-22 08:56:57 -07:00
Milan Burda
df53816eea
feat: expose the desktopCapturer module in the main process (#23548) 2020-05-20 20:25:49 -04:00
Shelley Vohr
4b23a85475
refactor: correctly serialize nativeImage/buffer with typeUtils (#23666)
* refactor: correctly serialize nativeImage/buffer with typeUtils

* test: add serialization specs

* fix: construct from dataURL

* test: test for dataURL specificity
2020-05-20 13:42:42 -07:00
Shelley Vohr
ee0f67d541
fix: nativeImage remote serialization (#23543)
We weren't serializing nativeImages properly in the remote module, leading to gin conversion errors when trying to, for example, create a new context menu in the renderer with icons using nativeImage. This fixes that by adding a new special case to handle them.
2020-05-18 09:29:24 -07:00
Samuel Attard
9d7ba98209
refactor: remove the RenderFrameFunctionStore and use privates to memory manage (#23592) 2020-05-15 11:57:40 -07:00
Milan Burda
85fae67966
perf: use type-utils for desktopCapturer.getSources() result serialization (#23549) 2020-05-13 19:05:53 +02:00
Samuel Attard
7f9b7b2e95
chore: clean up context bridge scopes and add specs for internal bridge (#23334)
* chore: clean up context bridge context scopes

* spec: add specs for internalContextBridge
2020-05-11 13:41:42 -07:00
Milan Burda
392ea320cf
build: allow use of BUILDFLAG directives from within JS code (#20328) 2020-05-11 01:06:07 +02:00
Jeremy Apthorp
06bf0d08dc
fix: crashReporter incompatible with sandbox on Linux (#23265) 2020-05-07 13:31:26 -07:00
Samuel Attard
abe5cf398c
refactor: port window.open and window.opener to use ctx bridge instead of hole punching (#23235)
* refactor: port window.open and window.opener to use ctx bridge instead of hole punching

* refactor: only run the isolated init bundle when webview is enabled
2020-04-27 12:46:04 -07:00
Samuel Attard
8262f24fd8
fix: do not mutate ipc instances across contexts (#23236) 2020-04-22 16:36:15 -07:00
Samuel Attard
96bf9ce77f
refactor: port parts of window-setup to use ctx bridge instead of being run in the main world (#23194)
* refactor: port parts of window-setup to use ctx bridge instead of being run in the main world

* chore: update ctx bridge specs for new base numbers
2020-04-22 12:42:51 -07:00