Commit graph

126 commits

Author SHA1 Message Date
Heilig Benedek
5a08522b98 feat: add removeInsertedCSS (#16579) 2019-06-17 11:39:35 -04:00
Milan Burda
deebde66f9 feat: make async webContents / <webview> methods return a Promise (#18792) 2019-06-17 12:10:02 +03:00
Jeremy Apthorp
c436997840
feat: add ipcRenderer.invoke() (#18449) 2019-05-31 10:25:19 -07:00
Milan Burda
e81afed66d chore: remove dead code (#18370) 2019-05-21 15:36:22 +09:00
Milan Burda
6f5c850d60 refactor: add emitCustomEvent() helper (#17960) 2019-05-01 09:07:57 -04:00
Shelley Vohr
d87b3ead76 chore: remove promisification deprecation callbacks (#17907)
* chore: remove promisification deprecation callbacks

* update docs

* fix smoke test

* fix executejs issue

* cleanup leftovers

* fix webContents.executeJavaScript tests

* cleanup WebContents.prototype.takeHeapSnapshot

* fix "sets arbitrary webContents as devtools" test

* fix executeJavaScriptInFrame related tests
2019-04-30 07:08:32 -07:00
Milan Burda
7574f91f31 refactor: natively promisify WebContents.prototype.takeHeapSnapshot (#18000) 2019-04-29 10:11:11 -07:00
Jeremy Apthorp
53f6cbccbf
refactor: use mojo for electron internal IPC (#17406)
* 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
Milan Burda
336db33d18 refactor: use ipcMainUtils.invokeInWebContents / ipcRendererUtils.handle helpers for Chrome APIs (#17417) 2019-03-26 11:38:35 +09:00
Shelley Vohr
38d75010c7
chore: rename atomBinding to electronBinding (#17419) 2019-03-18 12:37:06 -07:00
Milan Burda
2e89348541 feat: promisify executeJavaScript (#17312) 2019-03-14 12:08:54 -07:00
Milan Burda
faabd0cc8b refactor: add ipcMainUtils.invokeInWebContents / ipcRendererUtils.handle helpers (#17313) 2019-03-13 12:03:17 -07:00
Milan Burda
6072da239d feat: add global renderer-process-crashed event (#17315) 2019-03-11 16:17:24 -07:00
Thomas Beverley
1674388028 Fix webContents.print() (#17052) 2019-02-25 13:30:21 +00:00
deepak1556
005b7d8099 Print Preview: Add validity check for kSettingPagesPerSheet.
https://chromium-review.googlesource.com/c/chromium/src/+/1381133
2019-02-14 23:59:25 +05:30
Shelley Vohr
de27911661
feat: promisify webContents.savePage() (#16742)
* feat: promisify webContents.savePage()

* no need to make compatible w callbacks, we're breaking it

* fix promise resolve type

* address feedback from review

* fix promise return text

* update smoke test
2019-02-14 09:03:28 -08:00
Milan Burda
1f458eb177 feat: promisify debugger.sendCommand() (#16861)
* remove duplicate entry for desktopCapturer.getSources

* feat: promisify debugger.sendCommand
2019-02-13 07:23:53 -10:00
Milan Burda
d8ba1278d1 chore: disable the remote module in devtools / chrome extension background scripts (#16866)
* cache isRemoteModuleEnabled

* chore: disable the remote module in devtools / chrome extension background scripts
2019-02-11 10:42:37 -10:00
Milan Burda
36ce3e9546 feat: promisify webContents.printToPDF() (#16795) 2019-02-11 09:20:04 -10:00
Shelley Vohr
f303caa87c
refactor: remove ServiceWorker APIs from WebContents (#16717) 2019-02-04 22:22:46 -08:00
Samuel Attard
af64140100
refactor: enforce naming of ipcMainInternal (#16689) 2019-02-04 14:49:53 -08:00
Charles Kerr
76dcbcd6ea chore: fix 'browserView' typo (#16621) 2019-01-30 21:07:08 -08:00
Milan Burda
dfcee48f81 fix: don't forward IPC filtering events to app for dev-tools and extensions (#16565) 2019-01-30 08:20:03 -08:00
Shelley Vohr
d105dcc0d3
feat: promisify webContents.hasServiceWorker() (#16535)
* feat: promisify contents.hasServiceWorker()

* spec: add initial test for hasServiceWorker()
2019-01-26 10:23:16 -08:00
Shelley Vohr
5a35c3a279
chore: fix promisify helper (#16544)
* chore: fix promise deprecation helper

* fix deprecations

* update deprecation tests
2019-01-25 14:23:24 -08:00
Milan Burda
cc90919384 refactor: pass internal flag via IPC message struct for consistency (#16490) 2019-01-23 08:24:57 -08:00
Samuel Attard
58a6fe13d6
feat: preloads and nodeIntegration in iframes (#16425)
* feat: add support for node / preloads in subframes

This feature has delibrately been built / implemented in such a way
that it has minimum impact on existing apps / code-paths.
Without enabling the new "nodeSupportInSubFrames" option basically none of this
new code will be hit.

The things that I believe need extra scrutiny are:

* Introduction of `event.reply` for IPC events and usage of `event.reply` instead of `event.sender.send()`
* Usage of `node::FreeEnvironment(env)` when the new option is enabled in order to avoid memory leaks.  I have tested this quite a bit and haven't managed to cause a crash but it is still feature flagged behind the "nodeSupportInSubFrames" flag to avoid potential impact.

Closes #10569
Closes #10401
Closes #11868
Closes #12505
Closes #14035

* feat: add support preloads in subframes for sandboxed renderers

* spec: add tests for new nodeSupportInSubFrames option

* spec: fix specs for .reply and ._replyInternal for internal messages

* chore: revert change to use flag instead of environment set size

* chore: clean up subframe impl

* chore: apply suggestions from code review

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

* chore: clean up reply usage

* chore: fix TS docs generation

* chore: cleanup after rebase

* chore: rename wrap to add in event fns
2019-01-22 11:24:46 -08:00
Milan Burda
6cba2c50a2 feat: make ipc-message and ipc-message-sync events public (#16468) 2019-01-22 08:47:58 -08:00
Milan Burda
7d71ad6f91 fix: takeHeapSnapshot() using public IPC channel for internal implementation (#16480) 2019-01-22 17:32:24 +09:00
Shelley Vohr
3ca87d205f
feat: make zoomLevel/zoomFactor sync (#16410)
* feat: make zoomLevel/zoomFactor sync

* update ts defs dep
2019-01-20 23:40:27 -08:00
Shelley Vohr
f105c84349
test: ensure legacy callback functions work (#16436)
* test: test legacy callback functions

* add TODO removal comments

* fix callback spec
2019-01-17 14:17:16 -08:00
Milan Burda
349a3c20ae feat: add additional remote APIs filtering (#16293) 2019-01-08 14:27:56 -08:00
Milan Burda
547097b036 security: allow to block desktopCapturer.getSources() calls (#15964)
* security: allow to block desktopCapturer.getSources() calls

* return empty instead of error

* fix: release resources of DesktopCapturer on exit
2018-12-20 11:44:30 +09:00
Shelley Vohr
4b18a38e9f
chore: simplify promisify helper (#15952)
chore: simplify promisify helper
2018-12-10 08:13:09 -08:00
Cheng Zhao
db2fda1b6f
chore: make rpc-server reply to sender frame instead of the main frame (#15973)
* chore: make rpc-server reply to frame

* fix: check IsRenderFrameLive
2018-12-10 09:37:42 +09:00
Milan Burda
a33eeda4f7 refactor: don't expose NavigationController as an internal module (#15920) 2018-12-03 17:13:09 +01:00
Shelley Vohr
41c2685204
feat: promisify win.capturePage() (#15743)
* feat: promisify win.capturePage

* mark optional arg correctly

* Add to breaking changes doc

* properly deprecate win.capturePage

* remove change from api-contract

* document both callback and promise versions

* address docs feedback

* update promisification progress doc
2018-11-27 23:50:53 -05:00
Anrock
9ff7807be8 fix: move window.open handlers from BrowserWindow to WebContents 2018-11-27 10:59:01 +09:00
Robo
82322968a3 refactor: printing implementation (#15143)
* refactor: basic printing

* move build files to chromium_src/BUILD.gn
* remove dependency on chrome prerender sources

* spec: move printing specs behind feature flag

* build: register pdf compositor service
2018-11-09 14:42:34 +11:00
Milan Burda
db37ab1039 feat: add remote.require() / remote.getGlobal() filtering (#15014) 2018-10-18 14:36:45 +11:00
Heilig Benedek
a82bcc7e3c refactor: move printing out of chromium_src (#15023)
* remove printing related things from chromium_src

* chore: add printing build flag and patch

* fix: include PrintingService on other platforms too

* fix: printing_handler is only needed on Windows

* fix: format BUILD.gn properly

* fix: rename printing build flag to avoid conflict with chromium

* fix: place previously missed printing calls behind build flag

* fix: accidentally renamed flag in patch file

* fix: don't include all printing strings

* fix: allow ShowItemInFolder and OpenItem to block, fixing a DCHECK crash

* fix: make things compile, some changes got lost while rebasing

* fix: remove rogue line from BUILD.gn

* chore: update patch description

* style: lint fix

* chore: use chromium printing buildflag, move node related stuff out of patch

* revert: remove ScopedAllowBlockingForTesting call

* fix: fix my rebase blooper

* fix: re-add header lost during rebase, update patch

* fix: add <map> include, tweak the patch a bit

* revert: remove rogue diff from patch

* fix: clean up after rebase
2018-10-13 12:57:04 +11:00
Milan Burda
b50f86ef43 refactor: use separate ipc-renderer-internal / ipc-main-internal APIs for Electron internals (#13940) 2018-10-07 00:48:00 +13:00
Milan Burda
3ad3ade828 refactor: add prefer-const to .eslintrc + fix errors (#14880) 2018-10-02 11:56:31 +10:00
Samuel Attard
54ef906832
[RFC] perf: use an internal module resolver to improve require performance (#14633)
* perf: use an internal module resolver instead of relative requires

* perf: memoize the results of getting exported Electron properties

* perf: make internal module changes consistent across sandboxed / bundled files
2018-09-20 13:43:26 +10:00
Milan Burda
e22142ef9c feat: add process.takeHeapSnapshot() / webContents.takeHeapSnapshot() (#14456) 2018-09-18 11:00:31 -07:00
Samuel Attard
558fff69e7
chore: update to standard 12 2018-09-14 14:57:01 +10:00
Milan Burda
0821edc843 refactor: cleanup web-frame-init.js (#14516)
* refactor: add error-utils.js

* fix exception handling for asyncWebFrameMethods

* remove dead code

* handle exceptions

* rename rehydratedError to deserializedError

* Revert "handle exceptions"

This reverts commit 396b179948b137f9e525e9ebba4f7c6e9bf19429.
2018-09-11 19:56:00 +10:00
Milan Burda
38419e3a6a chore: address TODO for WebContents.prototype.setSize / reportRemovedAttribute removal (#14517)
* chore: remove WebContents.prototype.setSize

* chore: remove reportRemovedAttribute

* chore: remove unused fixtures
2018-09-11 17:58:57 +10:00
Milan Burda
58577bd431 feat: add options to webContents.loadFile (#14515) 2018-09-11 17:56:49 +10:00
Samuel Attard
1b7418fb7b
Revert "sec: deprecate some webPreference defaults to be secure-by-default (#14284)" (#14380)
This reverts commit 66d6ba8689.
2018-08-30 09:57:49 +12:00