Commit graph

2004 commits

Author SHA1 Message Date
Samuel Attard
b7b9efa875
fix: handle remote-debugging-port=0 correctly ()
By default the Chromedriver will send remote-debugging-port=0 to let the
browser choose a free port to listen on.  The chosen port is written to
a known file in the user data dir that is passed to the app through the
CLI.

This PR does two things.

1. Correctly passes the USER_DATA_DIR to the remote debugging server so
it knows where to write the file
2. Adds support for --user-data-dir as we did not support that CLI
argument and Chromedriver relies on being able to tell the "browser"
where to write this file.

Fixes 
2019-04-16 14:22:51 -04:00
Shelley Vohr
9c3cb55ef2
refactor: make accessibilitySupportEnabled a property on app ()
* refactor: make accessibilitySupport a prop on app

* fix docs

* update spec
2019-04-04 19:49:04 -07:00
Milan Burda
77d59e99b6 feat: emit process 'loaded' event in sandboxed renderers () 2019-04-04 11:35:06 -07:00
Jeremy Apthorp
127b87c713
refactor: mojofy MessageTo and MessageHost () 2019-04-03 14:22:23 -07:00
Jeremy Apthorp
53f6cbccbf
refactor: use mojo for electron internal IPC ()
* refactor: use mojo for electron internal IPC

* add sender_id, drop MessageSync

* remove usages of AtomFrameMsg_Message

* iwyu

* first draft of renderer->browser direction

* refactor to reuse a single ipc interface

* implement TakeHeapSnapshot through mojo

* the rest of the owl^WtakeHeapSnapshot mojofication

* remove no-op overrides in AtomRendererClient

* delete renderer-side ElectronApiServiceImpl when its pipe is destroyed

* looks like we don't need to overlay the renderer manifest after all

* don't try to send 2 replies to a sync rpc

* undo changes to manifests.cc

* unify sandboxed + unsandboxed ipc events

* lint

* register ElectronBrowser mojo service on devtools WebContents

* fix takeHeapSnapshopt failure paths

* {electron_api => atom}::mojom

* add send_to_all to ElectronRenderer::Message

* keep interface alive until callback is called

* review comments

* use GetContext from RendererClientBase

* robustify a test that uses window.open

* MessageSync posts a task to put sync messages in the same queue as async ones

* add v8::MicrotasksScope and node::CallbackScope

* iwyu

* use weakptr to api::WebContents instead of Unretained

* make MessageSync an asynchronous message & use non-associated interface

* iwyu + comments

* remove unused WeakPtrFactory

* inline OnRendererMessage[Sync]

* cleanups & comments

* use helper methods instead of inline lambdas

* remove unneeded async in test

* add mojo to manifests deps

* add gn check for //electron/manifests and mojo

* don't register renderer side service until preload has been run

* update gn check targets list

* move interface registration back to RenderFrameCreated
2019-04-02 15:38:16 -07:00
Shelley Vohr
0431997c8d
refactor: make applicationMenu a property on app () 2019-04-02 13:36:57 -07:00
Shelley Vohr
8ea33d69ac
fix: match net module headers & http.IncomingMessage headers ()
* fix: match net module headers & http.IncomingMessage headers

* update net doc for cleanliness

* address feedback from review

* Update spec/api-net-spec.js

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

* add special cookie case
2019-04-02 07:41:19 -07:00
Samuel Attard
75442b794f
fix: make devtools extensions load correctly () 2019-03-30 17:36:13 -07:00
Milan Burda
d597a0e8b0 refactor: expose ipcRendererInternal to the main world for window-setup using the content script world pattern () 2019-03-29 18:10:21 -07:00
Samuel Attard
953d1ea635
fix: ensure dots in content script patterns aren't used as wildcards ()
* fix: ensure dots in content script patterns aren't used as wildcards

* chore: sanitise all regexp special chars

* chore: extract to helper

* chore: fixup helper
2019-03-28 14:03:37 -07:00
Shelley Vohr
808783a5e4
fix: crashReporter.getParameters() takes no params () 2019-03-28 15:04:16 -04:00
Milan Burda
8cf15cc931 feat: only allow bundled preload scripts () 2019-03-28 11:38:51 +01:00
Shelley Vohr
34eb5d0815
fix: correctly return properties on the netLog module () 2019-03-25 22:40:38 -04:00
Milan Burda
336db33d18 refactor: use ipcMainUtils.invokeInWebContents / ipcRendererUtils.handle helpers for Chrome APIs () 2019-03-26 11:38:35 +09:00
Milan Burda
546466b209 feat: add <webview>.getWebContentsId() () 2019-03-26 10:57:27 +09:00
Milan Burda
cbd884060e fix: validate sender for replies in ipcMainInternalUtils.invokeInWebContents() () 2019-03-26 10:15:51 +09:00
Milan Burda
7389dfca59 fix: report module name when require fails in sandboxed renderers () 2019-03-19 12:00:41 -07:00
Milan Burda
06a4594435 chore: remove special handling for dialog methods in remote module ()
* chore: remove special handling for dialog methods in remote module

* refactor: remove callFunction helper
2019-03-19 11:59:33 -07:00
Milan Burda
ddd51525f1 refactor: make ELECTRON_INSPECTOR_CONTEXT_MENU handler async () 2019-03-19 10:37:43 -07:00
Milan Burda
53f4af7722 fix: regressions introduced by adding world isolation to Chrome extension content scripts () 2019-03-19 14:45:48 +01:00
Shelley Vohr
38d75010c7
chore: rename atomBinding to electronBinding () 2019-03-18 12:37:06 -07:00
Shelley Vohr
db29978fe0
fix: throw error when inserting menu items out-of-range ()
* fix: throw error when inserting menu items out-of-range

* also check pos < 0
2019-03-18 07:58:42 -07:00
Shelley Vohr
f09f43a4a9
chore: remove unused arg parsing code in dialog () 2019-03-18 07:58:03 -07:00
Milan Burda
3a091cdea4 refactor: implement clipboard APIs without the remote module () 2019-03-15 17:32:04 -07:00
Heilig Benedek
43ef561d48 feat: enable NodeIntegrationInSubFrames for webview ()
* feat: enable nodeIntegrationInSubFrames for webview

* test: add tests

* docs: document webview's nodeintegrationinsubframes

* lint: fix indent

* fix: resolve some merge bloopers
2019-03-15 10:39:20 -07:00
Shelley Vohr
961c9a88a8 feat: promisify dialog.showCertificateTrustDialog() ()
* feat: promisify dialog.showCertificateTrustDialog()

* update promisification doc
2019-03-15 09:02:50 +09:00
Milan Burda
f15d0b1ed7 refactor: make ELECTRON_INSPECTOR_CONFIRM handler async () 2019-03-14 15:29:40 -07:00
Shelley Vohr
cb4ede453f
chore: add deprecation helper for fnToProperty ()
* chore: add deprecation helper for fnToProperty

* add a test
2019-03-14 15:19:19 -07:00
Milan Burda
2e89348541 feat: promisify executeJavaScript () 2019-03-14 12:08:54 -07:00
Shelley Vohr
aa8b66aae1
feat: promisify session.getBlobData() () 2019-03-14 08:11:01 -07:00
Shelley Vohr
3e5a98b5f4
feat: promisify In-App Purchase ()
* feat: promisify In-App Purchase

* use mate::Arguments in GetProducts
2019-03-13 13:56:01 -07:00
Milan Burda
faabd0cc8b refactor: add ipcMainUtils.invokeInWebContents / ipcRendererUtils.handle helpers () 2019-03-13 12:03:17 -07:00
Shelley Vohr
8991c0056e
feat: promisify dialog.showMessageBox() ()
* feat: promisify dialog.showMessageBox()

* address feedback from review
2019-03-12 11:06:59 -07:00
Milan Burda
48a95f9677 fix: remove non-existent gpu-crashed event on <webview> () 2019-03-11 17:25:46 -07:00
Samuel Maddock
f943db7ad5 feat: Add content script world isolation ()
* Execute content script in isolated world

* Inject script into newly created extension worlds

* Create new content_script_bundle for extension scripts

* Initialize chrome API in content script bundle

* Define Chrome extension isolated world ID range

1 << 20 was chosen as it provides a sufficiently large range of IDs for extensions, but also provides a large enough buffer for any user worlds in [1000, 1 << 20).

Ultimately this range can be changed if any user application raises it as an issue.

* Insert content script CSS into document

This now avoids a script wrapper to inject the style sheet. This closely matches the code used by chromium in `ScriptInjection::InjectCss`.

* Pass extension ID to isolated world via v8 private
2019-03-11 16:27:57 -07:00
Milan Burda
6072da239d feat: add global renderer-process-crashed event () 2019-03-11 16:17:24 -07:00
Milan Burda
a8698d092b chore: increase security of default_app () 2019-03-11 16:13:46 -07:00
Shelley Vohr
9ea6c01e02
feat: promisify session.clearAuthCache() ()
* feat: promisify session.clearAuthCache()

* remove unused callback runner helpers
2019-03-08 18:41:42 -08:00
Samuel Maddock
8ee153dae1 feat: add support for content scripts 'all_frames' option ()
* feat: add support for content scripts 'all_frames' option

* merged content script tests

'all_frames' test now runs on all variants of sandbox/contentIsolation configurations :D
2019-03-08 15:53:25 -08:00
Shelley Vohr
fc10620082
feat: promisify session cache methods () 2019-03-08 14:42:03 -08:00
Shelley Vohr
2769e75b49
feat: promisify session proxy methods () 2019-03-08 12:51:12 -08:00
Robo
5afb7dc715 refactor: load electron builtin modules with process._linkedBinding ()
* refactor: load electron builtin modules with process._linkedBinding

NODE_BUILTING_MODULE_CONTEXT_AWARE and process.binding are
removed in https://github.com/nodejs/node/pull/25829. This changes
uses the alternative available without any functionality change.

* chore: roll node
2019-03-08 10:29:52 -08:00
Shelley Vohr
e5e6aa207c
feat: promisify ses.clearHostResolverCache() () 2019-03-08 10:26:17 -08:00
Shelley Vohr
bbfa63fd9d
feat: promisify session.clearStorageData() () 2019-03-08 09:02:30 -08:00
Milan Burda
d34f81972d refactor: make ELECTRON_BROWSER_SANDBOX_LOAD handler async () 2019-03-08 11:21:41 +01:00
Samuel Attard
61fc95417b
build: fix new TS linting errors ()
* remove unused _args var
* handle type/variable shadowing
2019-03-07 17:18:10 -08:00
Samuel Maddock
42b7b25ac3 feat: support chrome extensions in sandboxed renderer ()
* Add content script injector to sandboxed renderer

* Fix 'getRenderProcessPreferences' binding to the wrong object

* Pass getRenderProcessPreferences to content-scripts-injector

* Emit document-start and document-end  events in sandboxed renderer

* Use GetContext from RendererClientBase

* Prevent script context crash caused by lazily initialization

* Remove frame filtering logic for onExit callback

Since we're keeping track of which frames we've injected the bundle into, this logic is redundant.

* Add initial content script tests

* Add contextIsolation variants to content script tests

* Add set include

* Fix already loaded extension error

* Add tests for content scripts 'run_at' options

* Catch script injection eval error when CSP forbids it

This can occur in a rendered sandbox when a CSP is enabled. We'll need to switch to using isolated worlds to fix this.

* Fix content script tests not properly cleaning up extensions

* Fix lint and type errors
2019-03-07 16:00:28 -08:00
Milan Burda
5791a2a9ec refactor: use ipcRendererUtils.invoke / ipcMainUtils.handle for desktopCapturer.getSources() () 2019-03-07 15:31:25 -08:00
Felix Rieseberg
f3fc4023cf refactor: Port renderer/web-view to TypeScript () 2019-03-07 15:26:23 -08:00
Felix Rieseberg
5581990d78 build: Update TypeScript, use @typescript-eslint ()
* build: Update TypeScript to v3.3

* build: Update TypeScript, use @typescript-eslint
2019-03-07 12:56:02 -08:00