Commit graph

64 commits

Author SHA1 Message Date
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
7274467f73
refactor: tsify remote (#24034) 2020-06-11 11:36:03 -07:00
Samuel Attard
d3fa5ed1e8
docs: move protocol-ns to protocol.md (#23883)
* docs: move protocol-ns to protocol.md

* chore: fix up tests and implement missing pieces required for tests
2020-06-02 09:46:18 -07:00
Samuel Attard
236c1334e3
chore: tsify sandboxed init (#23719) 2020-05-30 02:56:54 -07:00
Samuel Attard
9bc5e98238
chore: tsify more of lib (#23721)
* chore: tsify more of lib

* Update lib/browser/api/session.ts

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
2020-05-22 12:46:22 -07:00
Milan Burda
df53816eea
feat: expose the desktopCapturer module in the main process (#23548) 2020-05-20 20:25:49 -04:00
Jeremy Apthorp
7e841ceb5c
refactor: tsify net module (#23618) 2020-05-18 10:22:48 -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
096c799e24
docs: rename duplicated interface (#23362) 2020-04-30 10:20:34 -07:00
Jeremy Apthorp
8d0a612265
refactor: remove code for non-native extensions shim (#23340) 2020-04-30 09:38:09 -07:00
Sean Lee
3e5486323a
docs: event.newGuest for new-window in WebContents and webContents in BrowsweWindow's constructor (#21698)
* docs: `newGuest` in `WebContents` and `webContents` in `BrowsweWindow`

According to the example codes in the documentation of `new-window`
event in `WebContents`, `webContents` in `BrowsweWindow` constructor
options and `newGuest` in `event` argument of `new-window` handler are
both existing but documented. This patch is for adding the related
documentations. Also, it provides typescript-definitations for these
two properties.

* Remove the documnent of `webContents` in BrowserWindow constructor option.
2020-04-30 09:25:13 -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
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
loc
aca2e4f968
refactor: improve feature string parsing (#23130)
* test: add pre-change snapshot of new-window event

* move to .ts file for easier diff

* refactor: improve feature string parsing logic

* test: update snapshots

* update type names per review

* update comma-separated parse test

* use for loop instead of reduce per review

* tighten up types

* avoid variable guest contents id returnValue in test snapshot
2020-04-21 16:23:00 -04:00
Cheng Zhao
76ae3b7ecb
chore: remove unused classes of views API (#22861)
* chore: remove unused views API classes

* chore: remove LayoutManager code

* chore: no more need to make View inherit from TrackabeObject

* chore: make enable_view_api default to true

* chore: enable_view_api => enable_views_api
2020-03-28 15:44:57 +09:00
Heilig Benedek
74372d65ae
feat: enhance native window.open to match the custom implementation's behavior (#19703)
Co-authored-by: Andy Locascio <andy@slack-corp.com>
2020-03-26 11:05:45 -07:00
Cheng Zhao
341f643b81
feat: add ImageView (#22738) 2020-03-22 19:11:43 +09:00
Jeremy Apthorp
b4d07f76d3
feat: MessagePorts in the main process (#22404) 2020-03-11 18:07:54 -07:00
Erick Zhao
1848e3f658
feat: Add OtherItemsProxy TouchBar item (#22270)
* feat: Add OtherItemsProxy touchbar item

* review!
2020-02-24 17:55:06 +09:00
John Kleinschmidt
e0c0875d6f
docs: update session.clearAuthCache (#22292)
* docs: update session.clearAuthCache

* Update specs to match doc change.
2020-02-21 13:40:45 -05:00
Samuel Attard
e7b0a9ca8f
feat: add API for receiving logs from service workers (#20624)
* feat: add API for receiving logs from service workers

* feat: add new serviceWorkerContext APIs

* chore: add missing #include's

* refactor: rename serviceWorkerContext to serviceWorkers

* chore: clean up based on review

* chore: remove native_mate

* chore: add tests for the service worker module

* Update spec-main/api-service-workers-spec.ts

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

* chore: fix linting

* chore: handle renames

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-20 15:19:06 -08:00
Jeremy Apthorp
eca1dd7f8b
docs: document supported extensions apis (#22021)
* docs: document supported extensions apis

* Update extensions.md

* Update README.md

* Apply suggestions from code review

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-02-06 16:36:02 -05:00
Jeremy Apthorp
a061c87e56
feat: enable native extensions support (#21814) 2020-02-03 14:01:10 -08:00
Mark Lee
28fb2b7ed5
docs: move breaking changes out of API folder (#21870)
This should allow planned breaking changes to be shown in the website
prior to a stable release with the changes included.
2020-01-28 22:19:18 +00:00
Jeremy Apthorp
acb5b75057
chore: [extensions] support old APIs when enable_electron_extensions = true (#21812) 2020-01-21 09:42:55 -08:00
Milan Burda
31c93fec67 fix: load window-setup in sandboxed renderer (#21416) 2020-01-06 22:23:03 +01:00
Milan Burda
1d596f616d fix: NativeImage serialization of <webview>.capturePage() result (#20825) 2019-11-12 21:56:17 +01:00
Samuel Attard
267821831c
fix: capture the promise global to avoid userland mutation (#20925) 2019-11-04 11:16:51 -08:00
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
Milan Burda
b92163d226 refactor: take advantage of structured clone algorithm in the remote module (#20427) 2019-10-10 09:59:08 -04:00
Milan Burda
ccff140046 feat: add --enable-api-filtering-logging commandline switch (#20335) 2019-10-04 10:49:09 -07:00
Milan Burda
2f03d393c3 feat: allow inspection of specific shared workers (#20389) 2019-10-02 14:38:27 +02:00
Jeremy Apthorp
b7b0992768
refactor: convert some more remote stuff to typescript (#20324) 2019-09-30 15:00:22 -07:00
Milan Burda
11cd0db86b build: add enable_remote_module build flag (#19821) 2019-09-18 09:52:06 -07:00
Samuel Attard
660e566201
fix: don't expose nativeTheme in the renderer process (#20139)
Exposing these in the renderer didn't make sense as they weren't backed
by the same instance / value store.  This API should be browser only
especially now that we have nativeTheme.themeSource.  Exposing in
//common was a mistake from the beginning.
2019-09-16 14:23:13 -07:00
Milan Burda
81e9dab52f refactor: replace ipcRendererUtils.invoke() with ipcRendererInternal.invoke() (#19574) 2019-08-23 15:45:50 -07:00
Milan Burda
7825d043f2 refactor: unify module-list format and exports/electron (#19697) 2019-08-23 11:18:58 +02:00
Samuel Attard
efa1818cb4
feat: add new nativeTheme API (#19656)
* feat: add new nativeTheme API

* chore: deprecate and clean up old systemPreferences theme APIs in favor of new nativeTheme module

* chore: clean up and deprecate things per feedback

* chore: add tests for deprecate and clean up invert impl

* build: when is a boolean not a boolean???
2019-08-14 13:42:55 -07:00
Samuel Attard
cfd230d7f1
docs: remove implicit 'any' and 'Object' types from the docs (#19585)
* docs: remove implicit 'any' and 'Object' types from the docs

* docs: more docs improvements, remove all remaining empty interfaces

* chore: update tests for better types
2019-08-05 10:45:58 -07:00
Milan Burda
3011a0f14f refactor: convert ipc-renderer.ts to TypeScript (#19556)
* refactor: convert ipc-renderer.ts to TypeScript

* Update typings/internal-ambient.d.ts

Co-Authored-By: Samuel Attard <sattard@slack-corp.com>
2019-08-02 14:35:04 -05:00
Samuel Attard
12bbbef688
docs: fix type information for contents.sendInputEvent (#19479)
The `event` type and keyword is reserved by the typescript generator, in the future we should throw an error from the generator if someone uses a reserved interface like that.

This also splits and documents the InputEvent type way better so that TS
users get strong type safety.

Fixes electron/typescript-definitions#36
2019-07-26 16:11:50 -07:00
Milan Burda
103b38650f feat: add memory to app.getAppMetrics() (#18831) 2019-07-23 13:41:58 -07:00
Milan Burda
c79613b037 chore: convert more files to TypeScript (#18820) 2019-07-17 10:23:52 -07:00
Milan Burda
419ce494e9 refactor: use IPC helpers in window-setup (#17948) 2019-07-09 02:43:49 +03:00
Milan Burda
69369cf365 refactor: don't expose isPromise as an internal module (#19139) 2019-07-08 15:17:50 +09:00
Cheng Zhao
1d8e16bc6e docs: UploadData does not have contentType (#19026) 2019-06-28 11:19:01 -07:00
Cheng Zhao
0a9438dbba
docs: documentation of NetworkService-based protocol module (#18952)
* docs: NetworkService-based protocol module

* docs: separate ProtocolRequest

* docs: separate ProtocolResponse

* docs: fix lint warning

* docs: fix electron.d.ts

* fix: print deprecation warnings for protocol module

* docs: fix links

* Apply suggestions from code review

Co-Authored-By: Felix Rieseberg <felix@felixrieseberg.com>

* Apply suggestions from code review

Co-Authored-By: Samuel Attard <samuel.r.attard@gmail.com>

* Do not publish NetworkService changes draft

* Apply suggestions from code review

Co-Authored-By: Samuel Attard <samuel.r.attard@gmail.com>

* docs: filePath must be absolute
2019-06-28 16:25:30 +09:00
Jeremy Apthorp
ec8697bcdc
test: move protocol specs to main process (#18923) 2019-06-27 14:20:29 -07:00
Milan Burda
4575a4aae3 Revert "feat: only allow bundled preload scripts (#17308)" (#18091)
This reverts commit 8cf15cc931.
2019-06-20 08:39:12 +09:00