electron/lib/renderer
Samuel Attard 0090616f7b
feat: add a new contextBridge module (#20307)
* feat: add a new contextBridge module

* chore: fix docs linting

* feat: add support for function arguments being proxied

* chore: ensure that contextBridge can only be used when contextIsolation is enabled

* docs: getReverseBinding can be null

* docs: fix broken links in md file

* feat: add support for promises in function parameters

* fix: linting failure for explicit constructor

* Update atom_api_context_bridge.cc

* chore: update docs and API design as per feedback

* refactor: remove reverse bindings and handle GC'able functions across the bridge

* chore: only expose debugGC in testing builds

* fix: do not proxy promises as objects

* spec: add complete spec coverage for contextBridge

* spec: add tests for null/undefined and the anti-overwrite logic

* chore: fix linting

* spec: add complex nested back-and-forth function calling

* fix: expose contextBridge in sandboxed renderers

* refactor: improve security of default_app using the new contextBridge module

* s/bindAPIInMainWorld/exposeInMainWorld

* chore: sorry for this commit, its a big one, I fixed like everything and refactored a lot

* chore: remove PassedValueCache as it is unused now

Values transferred from context A to context B are now cachde in the RenderFramePersistenceStore

* chore: move to anonymous namespace

* refactor: remove PassValueToOtherContextWithCache

* chore: remove commented unused code blocks

* chore: remove .only

* chore: remote commented code

* refactor: extract RenderFramePersistenceStore

* spec: ensure it works with numbered keys

* fix: handle number keys correctly

* fix: sort out the linter

* spec: update default_app asar spec for removed file

* refactor: change signatures to return v8 objects directly rather than the mate dictionary handle

* refactor: use the v8 serializer to support cloneable buffers and other object types

* chore: fix linting

* fix: handle hash collisions with a linked list in the map

* fix: enforce a recursion limit on the context bridge

* chore: fix linting

* chore: remove TODO

* chore: adapt for PR feedback

* chore: remove .only

* chore: clean up docs and clean up the proxy map when objects are released

* chore: ensure we cache object values that are cloned through the V8 serializer
2019-10-18 12:57:09 -07:00
..
api feat: add a new contextBridge module (#20307) 2019-10-18 12:57:09 -07:00
extensions refactor: replace ipcRendererUtils.invoke() with ipcRendererInternal.invoke() (#19574) 2019-08-23 15:45:50 -07:00
remote refactor: use Map for callbacks in CallbacksRegistry (#20565) 2019-10-15 09:14:41 -07:00
web-view perf: only access remote module when <webview>.getWebContents() is called (#20272) 2019-09-20 08:54:16 -07:00
chrome-api.ts refactor: replace ipcRendererUtils.invoke() with ipcRendererInternal.invoke() (#19574) 2019-08-23 15:45:50 -07:00
content-scripts-injector.ts refactor: piggy-back on ELECTRON_BROWSER_SANDBOX_LOAD to get content scripts (#18823) 2019-06-19 17:23:44 +02:00
init.ts refactor: take advantage of structured clone algorithm in the remote module (#20427) 2019-10-10 09:59:08 -04:00
inspector.ts refactor: replace ipcRendererUtils.invoke() with ipcRendererInternal.invoke() (#19574) 2019-08-23 15:45:50 -07:00
ipc-renderer-internal-utils.ts refactor: take advantage of structured clone algorithm in the remote module (#20427) 2019-10-10 09:59:08 -04:00
ipc-renderer-internal.ts refactor: replace ipcRendererUtils.invoke() with ipcRendererInternal.invoke() (#19574) 2019-08-23 15:45:50 -07:00
security-warnings.ts refactor: replace ipcRendererUtils.invoke() with ipcRendererInternal.invoke() (#19574) 2019-08-23 15:45:50 -07:00
web-frame-init.ts feat: promisify executeJavaScript (#17312) 2019-03-14 12:08:54 -07:00
webpack-provider.ts refactor: bundle the browser and renderer process electron code (#18553) 2019-06-02 13:03:03 -07:00
window-setup.ts refactor: use Map for windowProxies in window-setup.ts (#20600) 2019-10-17 15:07:27 +02:00