Commit graph

191 commits

Author SHA1 Message Date
Shelley Vohr
d20273f95b
chore: improve nativeImage path converter error (#21243) 2019-11-22 19:16:43 -08:00
Samuel Attard
34452ee69e
feat: expose executeJavaScriptInIsolatedWorld on webContents (#21190)
* feat: expose executeJavaScriptInIsolatedWorld on webContents

* Apply suggestions from code review

Co-Authored-By: loc <andy@slack-corp.com>
2019-11-22 15:33:55 -08:00
Milan Burda
3f2cb91a35 refactor: declare KeyWeakMap<K, V> returned by createIDWeakMap() / createDoubleIDWeakMap() (#21171) 2019-11-21 13:32:31 +01:00
Cheng Zhao
50f2d2b5ab
fix: menu should not be garbage-collected when popuping (#21169)
* fix: retain menu when popuping

* test: menu should not be garbage-collected when popuping
2019-11-20 20:17:39 +09:00
Jeremy Apthorp
26ecf63ab4
test: remove a bunch of usage of the remote module (#21119) 2019-11-14 14:09:03 -08:00
Jeremy Apthorp
4f1536479e
fix: implement 'login' event for net.ClientRequest (#21096) 2019-11-14 10:01:18 -08:00
Cheng Zhao
b02a20e4dc
fix: webRequest should be able to modify CORS headers (#21099)
* fix: always use extraHeaders mode

* fix: clear pending callbacks

* fix: do not use "extraHeaders" for net module

* test: webRequest should be able to modify CROS headers

* chore: CROS => CORS

Co-Authored-By: Milan Burda <milan.burda@gmail.com>

* chore: CROS => CORS

Co-Authored-By: Milan Burda <milan.burda@gmail.com>
2019-11-14 14:51:24 +09:00
Shelley Vohr
af1e8a347e chore: remove unused promisify code (#21114) 2019-11-14 14:50:50 +09:00
Milan Burda
97e2569f02 feat: add 'screen' to systemPreferences.getMediaAccessStatus() (#20764)
* feat: add 'screen' to systemPreferences.getMediaAccessStatus()

* Update docs/api/system-preferences.md
2019-11-13 16:47:51 -05:00
Samuel Attard
c0657a4ca7
build: fix nightly version bumping (#21079)
* build: fix nightly version bumping

* spec: add a test for bumping nightlies beyond the 8-x-y branch switch

* Update version-bump-spec.ts
2019-11-12 08:36:03 -08:00
Jeremy Apthorp
034f4d5734
fix: implement 'login' event for WebContents (#20954) 2019-11-11 09:47:01 -08:00
Andrew MacDonald
9b01bb00d2 feat: add app.getApplicationNameForProtocol API (#20399)
* Add GetApplicationNameForProtocol.

* Fix Windows implementation.

* Fix up test.

* Add documentation.

* Implement for real on Linux using xdg-mime.

Also ensure we allow blocking calls here to avoid errant DCHECKing.

* Improve docs for Linux.

* Clean up tests.

* Add a note about not relying on the precise format.

* Update docs/api/app.md

Co-Authored-By: Shelley Vohr <codebytere@github.com>

* Remove needless `done()`s from tests.

* Use vector list initialization.

* Add a simple test for isDefaultProtocolClient.

* Remove unneeded include and skip a test on Linux CI.

* We no longer differentiate between CI and non-CI test runs.
2019-11-06 17:50:33 -08:00
Samuel Attard
24939e8fa4
build: speedy tests on circle by splitting the test files into multiple jobs (#21015)
* build: let circleci divide our test suites in two

* well our tests rely on side affects, thats cool I guess
2019-11-06 16:15:55 -08:00
loc
15dffb3dde fix: allow iframe-initiated HTML fullscreen to exit while in macOS fullscreen (#20962)
* fix: explicitly resize the contents when exiting html fullscreen while in OS fullscreen

* test: ensure HTML fullscreen toggles while in OS fullscreen
2019-11-05 13:34:45 -08:00
Samuel Attard
fcee7212ce
chore: upgrade ts generator for better type safety (#20975)
* chore: upgrade ts generator for better type safety

* spec: fix tests
2019-11-05 13:34:04 -08:00
Jeremy Apthorp
6e5ac301ce test: don't require 'q' until the test that needs it (#20958)
this stops a failure to require from blocking all tests from running
2019-11-05 11:36:25 -05:00
Milan Burda
f808f50fa6 chore: remove no longer needed macOS SDK forward declarations (#19918)
* chore: remove no longer needed macOS SDK forward declarations
* fix: linter errors in spec-main/node-spec.ts
2019-11-03 21:46:12 +03:00
Shelley Vohr
38711233c5
feat: allow some NODE_OPTIONS in packaged apps (#20857)
* feat: allow some NODE_OPTIONS in packaged apps

* fix: correctly detect packaged app
2019-11-01 18:06:15 -07:00
Jeremy Apthorp
ecd9e1f26e
chore: lint spec-main (#20835) 2019-11-01 13:37:02 -07:00
Jeremy Apthorp
6781d5e3c8
test: there is only --ci (#20794) 2019-10-30 16:38:21 -07:00
Milan Burda
3d56e13b38 fix: devtools extensions not loading (#20791) 2019-10-30 14:46:52 +09:00
Jeremy Apthorp
baaf058380 test: remove last usages of spec/window-helpers (#20792)
* test: remove last usages of spec/window-helpers

* move fixture
2019-10-29 13:16:42 +09:00
Milan Burda
bd5a5b3ae6 fix: properly generate requestID in webContents.printToPDF() (#20769) 2019-10-29 11:36:29 +09:00
Electron Bot
b6246dcf12 chore: bump chromium to f5b345dd470f14eef6e44732ccf23 (master) (#20649) 2019-10-28 15:12:35 -07:00
Cheng Zhao
0fe6767d6b
chore: remove native_mate (Part 11) (#20719)
* refactor: convert Menu and globalShortcut to gin

* refactor: convert api::Cookies to gin

* refactor: convert View and WebContentsView to gin

* refactor: convert WebContents related classes to gin

* refactor: convert powerMonitor to gin

* refactor: prepare for header change

* refactor: remove last uses of mate::EventEmitter

* refactor: remove mate::EventEmitter

* refactor: move trackable_object to gin_helper

* fix: custom converter should not use Handle

* fix: no more need to check if icon is empty

It was a bug that the Handle<NativeImage> can be non-empty when the
image file does not exist. The bug was caused by the converter code
writing out the image even when the convertion fails.

The bug was work-arounded by adding an additional check, but since the
original bug had been fixed, the additional check is no longer needed.

* fix: should always set frameId even when callback is null

* fix: do not mix gin/mate handles for NativeImage
2019-10-25 22:03:28 +09:00
John Kleinschmidt
467409458e build: add support for automated minor releases (#20620)
* build: add support for automated minor releases

* Add test for minor bump
2019-10-23 11:07:09 -07:00
Milan Burda
ba8f80267c fix: send ELECTRON_BROWSER_CONTEXT_RELEASE asynchronously (#20632)
* fix: send ELECTRON_BROWSER_CONTEXT_RELEASE asynchronously

* test: remote references should be able to be cleared for all cases
2019-10-23 13:44:21 +09:00
Shelley Vohr
aa26e8b946
fix: macOS getColor inconsistencies (#20611) 2019-10-21 14:31:03 -07:00
Cheng Zhao
eb0e55c514
chore: remove native_mate (Part 9) (#20645)
* refactor: remove a few uses of native_mate/gfx_converter.h

* refactor: deprecate mate::EventEmitter

* refactor: add gin_helper::EventEmitter

* refactor: convert a few classes to use gin_helper::EventEmitter

* refactor: get rid of native_mate_converters/gfx_converter.h

* fix: follow native_mate on reporting errors

* fix: gin is weak at guessing parameter types

* fix: incorrect full class name

* fix: gin::Handle does not accept null
2019-10-21 16:05:40 +09:00
Jeremy Apthorp
9f23bb581e
test: fix BrowserWindow spec to await its result (#20612) 2019-10-18 16:23:33 -07:00
Electron Bot
3ac3fbdbfb chore: bump chromium to e049d599a8332b9b2785b0178be74 (master) (#20314) 2019-10-18 12:57:34 -07: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
Jeremy Apthorp
221ce70699 test: remove remote usage from chromium spec (#20568)
* test: move & expand webview -> window.open() opener tests

* remove remaining usage of 'protocol' from chromium-spec.js

* remove final usages of remote from chromium-spec

* remove import of window-helpers
2019-10-16 11:12:31 -04:00
Jeremy Apthorp
8dad0c7aaa
test: move crashReporter specs to the main process (#20417) 2019-10-14 14:38:54 -07:00
Milan Burda
eb100cdf9e test: skip desktopCapturer / remote module tests when the features are disabled (#20566) 2019-10-14 13:49:21 -07:00
Jeremy Apthorp
d67f25ce43
test: expand window.opener test and move to main process (#20549) 2019-10-14 09:00:34 -07:00
Jeremy Apthorp
1f44f47de1 test: move debugger spec to main process (#20514) 2019-10-14 14:32:11 +09:00
Jeremy Apthorp
2aa7ab821c
test: remove some remote usage from chromium specs (#20121)
* test: remove remote usage from chromium specs

* disable tts test

* port navigator.mediaDevices tests

* fake camera and microphone

* Update spec-main/chromium-spec.ts

Co-Authored-By: John Kleinschmidt <jkleinsc@github.com>
2019-10-11 13:55:50 -07:00
Cheng Zhao
1b2c6a33b3 fix: do not manually parse content-type (#20538) 2019-10-11 14:54:50 -04:00
Jeremy Apthorp
67642312f4
test: remove remote usage from webFrame test (#20512) 2019-10-11 10:20:08 -07:00
Jeremy Apthorp
032353b14f
test: remove remote usage from asar spec (#20513) 2019-10-11 09:56:51 -07:00
Jeremy Apthorp
1dc1ef6091 test: ensure cleanup of net requests in tests (#20510)
ref #19389
2019-10-10 14:14:41 +02:00
Jeremy Apthorp
8de925c4c2
test: move module tests to main process (#20419) 2019-10-09 16:33:15 -07:00
Jeremy Apthorp
2fad53e66b refactor: use v8 serialization for ipc (#20214)
* refactor: use v8 serialization for ipc

* cloning process.env doesn't work

* serialize host objects by enumerating key/values

* new serialization can handle NaN, Infinity, and undefined correctly

* can't allocate v8 objects during GC

* backport microtasks fix

* fix compile

* fix node_stream_loader reentrancy

* update subframe spec to expect undefined instead of null

* write undefined instead of crashing when serializing host objects

* fix webview spec

* fix download spec

* buffers are transformed into uint8arrays

* can't serialize promises

* fix chrome.i18n.getMessage

* fix devtools tests

* fix zoom test

* fix debug build

* fix lint

* update ipcRenderer tests

* fix printToPDF test

* update patch

* remove accidentally re-added remote-side spec

* wip

* don't attempt to serialize host objects

* jump through different hoops to set options.webContents sometimes

* whoops

* fix lint

* clean up error-handling logic

* fix memory leak

* fix lint

* convert host objects using old base::Value serialization

* fix lint more

* fall back to base::Value-based serialization

* remove commented-out code

* add docs to breaking-changes.md

* Update breaking-changes.md

* update ipcRenderer and WebContents docs

* lint

* use named values for format tag

* save a memcpy for ~30% speedup

* get rid of calls to ShallowClone

* extra debugging for paranoia

* d'oh, use the correct named tags

* apparently msstl doesn't like this DCHECK

* funny story about that DCHECK

* disable remote-related functions when enable_remote_module = false

* nits

* use EnableIf to disable remote methods in mojom

* fix include

* review comments
2019-10-09 13:59:08 -04:00
Cheng Zhao
5e11be6898
fix: cookies.get should be able to filter domain (#20471)
* fix: use GetAllCookies when url is empty

* test: get cookie without url
2019-10-09 15:57:40 +09:00
John Kleinschmidt
3f72f07a7f test: remove unneeded console.log (#20424)
(cherry picked from commit 4945a9fce9)
2019-10-06 22:00:38 +02:00
John Kleinschmidt
ad34d7fc32 Revert "test: remove unneeded console.log"
This reverts commit 4945a9fce9.
2019-10-04 11:17:58 -04:00
John Kleinschmidt
4945a9fce9 test: remove unneeded console.log 2019-10-04 11:05:49 -04:00
Cheng Zhao
509587eb81
test: close window before destroying browserView (#20411) 2019-10-04 09:30:44 +09:00
Milan Burda
2f03d393c3 feat: allow inspection of specific shared workers (#20389) 2019-10-02 14:38:27 +02:00