Commit graph

1929 commits

Author SHA1 Message Date
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
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
Jeremy Apthorp
b155ebeeb3 fix: don't overwrite global constructor names in remote (#20637)
* fix: don't overwrite global constructor names in remote

* fake constructor names better, and improve error serialization
2019-10-21 15:48:03 +09: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
Alecyrus
825e67140e feat: support fitToPageEnabled and scaleFactor (#20436)
* fix: support fitToPageEnabled and scaleFactor

Support fitToPageEnabled and scaleFactor in  `WebContents.printToPDF()`

* fix: change default value of scaleFactor
2019-10-18 09:40:19 +09:00
Milan Burda
b29f0b9348 refactor: use Map for windowProxies in window-setup.ts (#20600) 2019-10-17 15:07:27 +02:00
Milan Burda
5273930f76 refactor: use Map for callbacks in CallbacksRegistry (#20565) 2019-10-15 09:14:41 -07:00
Jeremy Apthorp
8dad0c7aaa
test: move crashReporter specs to the main process (#20417) 2019-10-14 14:38:54 -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
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
Shelley Vohr
c16a186de0 feat: improve TouchBarButton accessibility (#20454) 2019-10-08 11:13:57 -04:00
Milan Burda
ccff140046 feat: add --enable-api-filtering-logging commandline switch (#20335) 2019-10-04 10:49:09 -07:00
Milan Burda
bf978e09e4 fix: allow paths to asar archives to contain the .asar extension in directories (#20342) 2019-10-02 13:33:07 +09:00
Jeremy Apthorp
b7b0992768
refactor: convert some more remote stuff to typescript (#20324) 2019-09-30 15:00:22 -07:00
Milan Burda
ead8f2bbcd fix: BrowserWindow.fromWebContents() can return null (#19983) 2019-09-27 13:07:55 +02:00
Milan Burda
d090b0cd2d perf: only access remote module when <webview>.getWebContents() is called (#20272) 2019-09-20 08:54:16 -07:00
Milan Burda
11cd0db86b build: add enable_remote_module build flag (#19821) 2019-09-18 09:52:06 -07:00
loc
d2a94e6b13 fix: free screen and window capturers immediately after we're finished with them (#20156)
fix #17937, #19908
2019-09-17 09:48:31 -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
01fdb80f7c refactor: implement isRemoteModuleEnabled via getLastWebPreferences() (#19220) 2019-08-28 15:57:03 -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
Shelley Vohr
6a76540cb6 fix: return type in open/save dialogs (#19781) 2019-08-16 08:55:01 -07: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
Cheng Zhao
49fe2604b3 Revert "fix: activate the uv_loop on incoming IPC messages (#19449)" (#19727)
This reverts commit 8028c57b42.
2019-08-13 14:03:25 -07:00
Shelley Vohr
28466a39d8
feat: add property customization to save dialogs (#19672) 2019-08-13 13:40:07 -07:00
Shelley Vohr
b5798326e8
feat: add dontAddToRecent to windows showOpenDialog (#19669) 2019-08-13 08:48:22 -07:00
Samuel Attard
33a9d898a6 fix: make child windows not crash when ipc messages are received (#19553) 2019-08-05 12:50:51 -07:00
Electron Bot
e959137a4b chore: bump chromium to 32e0bab929213da1019992bf31d29 (master) (#19488) 2019-08-02 16:56:46 -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
Jeremy Apthorp
c71cdce0b7
chore: disable JS impl when //extensions support is on (#19512) 2019-07-31 14:25:41 -07:00
Shelley Vohr
a5f87cee6b
doc: add missing MenuItem roles (#19329) 2019-07-31 14:13:56 -07:00
Micha Hanselmann
47a38daee2 feat: migrate custom macOS tray view to native one (#18981)
* restore stash

revert

some things work others dont

tracking area for rescue

manual popup

restore drag n drop

cleanup

* fix: make tray not block main process (#18880)

* fix: make tray not block main process

* make AtomMenuModel refcounted

* add support for ansi codes in title

add remove TODOs

* chore: use ScopedPumpMessagesInPrivateModes in tray (#18977)

* chore: use ScopedPumpMessagesInPrivateModes in tray

* revert refcounting of AtomMenuModel

* Prefer WeakPtr for posting tasks to handle unexpected destruction

* cleanup .h

* cleanup .mm

* add imports

add missing include

* fix: crash when tray popup called twice (#18999)

* remove highlightMode and TODOs

* remove unnecessary copy
2019-07-31 10:52:50 -07:00
Shelley Vohr
aaca9011ae
fix: [wc|bw]-created events do not emit an event object (#19465)
* fix: emit real Event instead of empty object in [wc|bw]

* chore: add ability to emit empty events
2019-07-29 13:54:37 -07:00
Milan Burda
8a33118e36 fix: refactoring regression in LocationProxy (#19495) 2019-07-29 11:20:19 -07:00
Samuel Attard
db3cf52add
docs: add support for readonly,deprecated and platform doc annotations (#19478) 2019-07-26 16:12:59 -07:00
Jeremy Apthorp
477661d0e4
feat: allow setting capture mode and max file size in netLog API (#19215) 2019-07-25 16:06:39 -07:00
Samuel Attard
8028c57b42
fix: activate the uv_loop on incoming IPC messages (#19449) 2019-07-25 13:10:14 -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
Jeremy Apthorp
355b307618 test: move MenuItem spec to main process (#19235)
* test: move MenuItem spec to main process

* spec: fix errant default accel test

* Update menu-item-roles.js

* Update api-menu-item-spec.ts
2019-07-16 12:54:18 -07:00
Samuel Attard
6d5e494782 fix: serialize messages being sent over chrome message ports (#19104)
Chrome appears to serialize these messages (see #19070) so we should as
well to be consistent and to avoid bugs with Uint8/16 arrays

Fixes #19070
2019-07-15 19:05:09 +09:00
Ian Sanders
079a173a72 feat: add stack trace log to preload script error handling (#18905)
* Add console.trace to preload script error handling

* Log error directly instead of error string + trace

* Log full error object instead of error message
2019-07-14 21:54:33 -07:00
Alexandre Lacheze
e26f366405 Revert: electron/electron#14487 (#19011) 2019-07-11 17:25:26 -05:00
Milan Burda
c756b955b3 fix: revert use of IPC helpers for history due to failing test (#19189) 2019-07-11 20:25:07 +03:00
Micha Hanselmann
1f70dfbffd chore: deprecate setHighlightMode (#19202) 2019-07-11 10:11:46 -05:00
Micha Hanselmann
06d48514c6 add toolTip property for MenuItem (#19099) 2019-07-11 17:56:22 +09:00
Cheng Zhao
faa2710485 fix: do not wait on promise returned by remote APIs (#18990)
* fix: make <webview>.loadURL async

* docs: webview.loadURL returns Promise
2019-07-10 08:20:28 -05:00
Milan Burda
fdbb97e876 chore: update to latest TypeScript 3.5.2 (#19133) 2019-07-09 14:44:46 +03:00
Micha Hanselmann
d79e6bbffe refactor: improve function deprecation module (#19012)
* add removeFunction to deprecation module

* clarify deprecate api

* throw error

* change error msg
2019-07-09 10:01:35 +09: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
Milan Burda
87b1dab497 fix: check parent-child relationship in canAccessWindow (#19077) 2019-07-04 18:22:08 +02:00
Samuel Attard
5a1b661f42
fix: use bidning.ipc instead of binding.sendTo which is undefined (#19103) 2019-07-03 16:36:44 -07:00
Jeremy Apthorp
d1292833e9 chore: remove unused BrowserWindow.fromDevToolsWebContents (#19090) 2019-07-03 12:07:47 -07:00
Shelley Vohr
8782d06ed6
feat: convert webContents primitives to properties (#18998)
* feat: convert webContents primitives to properties

* address feedback from review
2019-07-03 08:57:10 -07:00
Milan Burda
69ea0b4ebf fix: ignore non-absolute session preload script paths when sandboxed (#19066) 2019-07-03 08:05:45 -07:00
Electron Bot
50b9c7051e chore: bump chromium to f1d9522c04ca8fa0a906f88ababe9 (master) (#18648)
* chore: bump chromium in DEPS to 675d7dc9f3334b15c3ec28c27db3dc19b26bd12e

* chore: update patches

* chore: bump chromium in DEPS to dce3562696f165a324273fcb6893f0e1fef42ab1

* chore: const interfaces are being removed from //content

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1631749
Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=908139

* chore: update patches

* chore: blink::MediaStreamType is now consistent and deduplicated

* chore: update patches and printing code for ref -> uniq

* chore: bridge_impl() --> GetInProcessNSWindowBridge

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1642988

* fixme: TotalMarkedObjectSize has been removed

* chore: fix linting

* chore: bump chromium in DEPS to 9503e1a2fcbf17db08094d8caae3e1407e918af3

* chore: fix slightly broken printing patch

* chore: update patches for SiteInstanceImpl changes

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1612025

* chore: update patches for SiteInstanceImpl changes

* chore: bump chromium in DEPS to 6801e6c1ddd1b7b73e594e97157ddd539ca335d7

* chore: update patches

* chore: bump chromium in DEPS to 27e198912d7c1767052ec785c22e2e88b2cb4d8b

* chore: remove system_request_context

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1647172

* chore: creation of FtpProtocolHandler needs an auth cache

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1639683

* fixme: disable marked spec

* chore: bump chromium in DEPS to 3dcd7fe453ad13a22b114b95f05590eba74c5471

* chore: bump chromium in DEPS to bdc24128b75008743d819e298557a53205706e7c

* chore: bump chromium in DEPS to 7da330b58fbe0ba94b9b94abbb8085bead220228

* update patches

* remove TotalMarkedObjectSize

https://chromium-review.googlesource.com/c/chromium/src/+/1631708

* add libvulkan.so to dist zip manifest on linux

* chore: bump chromium in DEPS to 1e85d0f45b52649efd0010cc9dab6d2804f24443

* update patches

* add angle features to gpuinfo

https://chromium-review.googlesource.com/c/chromium/src/+/1638658

* mark 'marked' property as deprecated

* disable webview resize test

* FIXME: disable vulkan on 32-bit arm

* chore: bump chromium in DEPS to cd0297c6a83fdd2b1f6bc312e7d5acca736a3c56

* Revert "FIXME: disable vulkan on 32-bit arm"

This reverts commit 5c1e0ef302a6db1e72231d4e823f91bb08e281af.

* backport from upstream: fix swiftshader build on arm

https://swiftshader-review.googlesource.com/c/SwiftShader/+/32768/

* update patches

* viz: update OutputDeviceWin to new shared memory api

https://chromium-review.googlesource.com/c/chromium/src/+/1649574

* base::Contains{Key,Value} => base::Contains

https://chromium-review.googlesource.com/c/chromium/src/+/1649478

* fixup! viz: update OutputDeviceWin to new shared memory api

* stub out StatusIconLinuxDbus-related delegate methods

https://chromium-review.googlesource.com/c/chromium/src/+/1638180

* chore: bump chromium in DEPS to 964ea3fd4bdc006d62533f5755043076220181f1

* Remove the BrowserContext methods to create URLRequestContexts for main/media partitions when a partition_domain is specified

https://chromium-review.googlesource.com/c/chromium/src/+/1655087

* fixup! stub out StatusIconLinuxDbus-related delegate methods

* add remote_cocoa to chromium_src deps

https://chromium-review.googlesource.com/c/chromium/src/+/1657068

* fixup! stub out StatusIconLinuxDbus-related delegate methods

* attempt at fix linux-debug build

* add swiftshader/libvulkan.so to arm manifest

* chore: bump chromium in DEPS to 28688f76afef27c36631aa274691e333ddecdc22

* update patches

* chore: bump chromium in DEPS to fe7450e1578a9584189f87d59d0d1a8548bf6b90

* chore: bump chromium in DEPS to f304dfd682dc86a755a6c49a16ee6876e0db45fb

* chore: bump chromium in DEPS to f0fd4d6c365aad9edd83bdfff9954c47d271b75c

* Update patches

* Remove no longer needed WOA patch

* Put back IOThread in BrowserProcess

We need this until we enable the network service.

* move atom.ico to inputs

* Update to latest LKGR to fix no template named 'bitset' in namespace 'std'

* fixup! Put back IOThread in BrowserProcess

* chore: bump chromium in DEPS to dcf9662dc9a896a175d791001350324167b1cad3

* Update patches

content_allow_embedder_to_prevent_locking_scheme_registry.patch is no longer necessary as it was upstreamed via https://chromium-review.googlesource.com/c/chromium/src/+/1637040

* Fix renamed enum

* Use newer docker container

Contains updated dependencies

* Try to track down arm test failures

* Fix arm tests

* chore: bump chromium in DEPS to 8cbceef57b37ee14b9c4c3405a3f7663922c5b5d

* Update patches

* Add needed dependencies for testing 32-bit linux

* Remove arm debugging.

* Remove additional debugging

* Fix compiler errors

* Handle new macOS helper

* Fix compile error on Linux

* chore: bump chromium in DEPS to 66a93991ddaff6a9f1b13d110959947cb03a1860

* Add new helper files to manifests

* fix BUILD.gn for macOS

* Fix compile errors

* Add patch to put back colors needed for autofill/datalist

* chore: bump chromium in DEPS to e89617079f11e33f33cdb3924f719a579c73704b

* Updated patches

* Remove no longer needed patch

* Remove no longer needed patch

* Fix compile error with patch

* Really fix the patch

* chore: bump chromium in DEPS to c70f12476a45840408f1d5ff5968e7f7ceaad9d4

* chore: bump chromium in DEPS to 06d2dd7a8933b41545a7c26349c802f570563fd5

* chore: bump chromium in DEPS to b0b9ff8f727deb519ccbec7cf1c8d9ed543d88ab

* Update patches

* Fix compiler errors

* Fix removed ChromeNetLog

* Revert "Fix removed ChromeNetLog"

This reverts commit 426dfd90b5ab0a9c1df415d71c88e8aed2bd5bbe.

* Remove ChromeNetLog.

https://chromium-review.googlesource.com/c/chromium/src/+/1663846

* chore: bump chromium in DEPS to fefcc4926d58dccd59ac95be65eab3a4ebfe2f29

* Update patches

* Update v8 patches

* Fix lint error

* Fix compile errors

* chore: bump chromium in DEPS to 4de815ef92ef2eef515506fe09bdc466526a8fd9

* Use custom protocol to test baseURLForDataURL

* Use newer SDK (10.0.18362) for Windows

* Update patches

* Update arm manifest since swiftshader reenabled.

* Don't delete dir that isn't ever there.

* Fix compile errors.

* Need src dir created

* Update for removed InspectorFrontendAPI.addExtensions

* Revert "Use newer SDK (10.0.18362) for Windows"

This reverts commit 68763a0c88cdc44b971462e49662aecc167d3d99.

* Revert "Need src dir created"

This reverts commit 7daedc29d0844316d4097648dde7f40f1a3848fb.

* Revert "Don't delete dir that isn't ever there."

This reverts commit bf424bc30ffcb23b1d9a634d4df410342536640e.

* chore: bump chromium in DEPS to 97dab6b0124ea53244caf123921b5d14893bcca7

* chore: bump chromium in DEPS to c87d16d49a85dc7122781f6c979d354c20f7f78b

* chore: bump chromium in DEPS to 004bcee2ea336687cedfda8f8a151806ac757d15

* chore: bump chromium in DEPS to 24428b26a9d15a013b2a253e1084ec3cb54b660b

* chore: bump chromium in DEPS to fd25914e875237df88035a6abf89a70bf1360b57

* Update patches

* Update node to fix build error

* Fix compile errors

* chore: bump chromium in DEPS to 3062b7cf090f1d9522c04ca8fa0a906f88ababe9

* chore: update node ref for pushed tags

* chore: update patches for new chromium

* chore: fix printing patches

* Use new (10.0.18362) Windows SDK

* roll node to fix v8 build issues in debug build

* Add support for plugin helper

* fix: add patch to fix gpu info enumeration

Can be removed once CL lands upstream.

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1685993

* spec: navigator.requestMIDIAccess now requires a secure origin

This test requires a secure origin so we fake one.

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1657952

* FIXME: temporarily disable SharedWorker tests

* use released version of node-abstractsocket

* fix abstract-socket
2019-07-02 18:22:09 -07:00
Jerry Wu
dee331519c fix: disable nodeIntegration & insecure resource warnings for localhost (#18814)
* fix: disable remote host nodeIntegration warning for localhost

In warnAboutNodeWithRemoteContent(), add a check to see if the hostname
is "localhost" and prevent the warning message if it is.

* fix: disable loading insecure resources warning for localhost

In warnAboutInsecureResources(), filter out resources from localhost
since they are most likely not a threat.

* test: add tests for ignoring security warnings when using localhost

Add tests for ignoring warning messages for the following scenarios:
  1. node integration with remote content from localhost
  2. loading insecure resources from localhost

* test: fix insecure resource test

* test: pass nodeIntegration with remote test on did-finish-load

* test: maybe fix node integration test (error w/ conv circular struct)

* test: update test description

* test: use "load" event to check when nodeIntegration test has finished

Instead of relying on the "did-finish-load" event, which may result in
a race condition, add an "onload" handler that logs "loaded" to the
console. This will execute _after_ the nodeIntegration check, so it
can be safely used as a signal to indicate that the test is done.

* test: rename base-page-security-load-message.html

* fix: ignore enabled remote module warning for localhost

* refactor: add isLocalhost()
2019-07-02 19:36:50 +09:00
Samuel Attard
6eed4a98ce fix: do not remove node globals when context isolation is enabled (#18967) 2019-06-28 14:37:00 -07:00
Samuel Attard
764be844ec
fix: override the timers module impls to activate the uv loop (#18948) 2019-06-24 10:18:29 -07:00
David Sanders
6251a6d307 fix: typo in comment (#18899) 2019-06-20 10:11:38 -05: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
Milan Burda
edb56500c7 refactor: piggy-back on ELECTRON_BROWSER_SANDBOX_LOAD to get content scripts (#18823) 2019-06-19 17:23:44 +02:00
Jerry Wu
d5811607eb fix: extra space in security warning message causing list misalignment (#18815) 2019-06-18 09:59:02 -07:00
Milan Burda
0af3548b55 feat: add security warning for remote module with remote content (#18822) 2019-06-17 14:21:30 -07:00
Milan Burda
c9bca78a7a refactor: use async invoke to get webPreferences in security-warnings.ts (#18821) 2019-06-17 10:57:09 -07:00
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
Milan Burda
370e9522b4 refactor: re-implement desktop-capturer in TypeScript (#18580) 2019-06-15 19:44:18 +09:00
Shelley Vohr
3309005325 chore: convert callbacks-registry to ts (#18682)
* chore: convert callbacks-registry to ts

* fix class import syntax

* move cb reg specs to spec-main
2019-06-15 17:18:25 +09:00
Jeremy Apthorp
7b26048d9e
test: unflake some net specs (#18782) 2019-06-14 16:26:07 -07:00
Shelley Vohr
bfcce8aa27
refactor: pass MessageBox params as a struct (#18732)
Historically, we've been passing in all MessageBox parameters individually, which makes augmenting or improving MessageBox functionality challenging because to change or add even one argument requires a huge cascade of argument changes that leaves room for errors.

For other file dialog related APIs, we use a struct (DialogSettings), and so this PR takes a similar approach and refactors MessageBox parameters into a struct (MessageBoxSettings) which we then use to simplify argument passing and which will enable us to more quickly iterate and improve upon functionality in the future.
2019-06-14 08:26:25 -07:00
Shelley Vohr
ffb53405fb
chore: convert extension apis to TypeScript (#18688)
Converts extensions-related files to TS
2019-06-14 07:52:24 -07:00
Milan Burda
da58ac7c20 refactor: use app.commandLine.getSwitchValue() for parsing user-data-dir (#18764) 2019-06-13 16:03:02 -07:00
Nitish Sakhawalkar
f98454e5dd fix: use crashpad on Windows (#18483)
* Initial changes to use crashpad for windows

* Remove crashpad patch

* Report error when failed to connect pipe

* Allow crashpad to communicate with named pipe

* Add patch to make crashpad named pipe work

* Windows also needs crashReporter on main process

* Call SetUnhandledExceptionFilter in node process

Node can also use crash reporter.

* Do not treat node process as browser process

* No more need to manually start crash service

* Use base::StringPrintf for better readbility

* Print error when pipe name not available

* Make sure pipe name is updated

Note that the crashpad may be started after renderer process gets
created.

* Fix some tests

* Update node

* Exclude crashpad files on Linux and MAS

* Fix lint warning

* Remove unused checks

* kCrashpadPipeName is only available on Windows

* Fix uploadToServer tests

* Fix extra params tests

* Fix getCrashesDirectory tests

* Run crashReporter tests on CI

* Style fixes

* Update crashreporter docs

* Rename InitBreakpad to Init

* Add comment for process_type_.empty() and UTF16ToASCII to UTF16ToUTF8.

* Update build.gn include crashpad headers

* Address comment https://github.com/electron/electron/pull/18483#discussion_r290887898

* Avoid using api::WebContents

* Put kRunAsNode in atom_constants

* Remove duplicate settings on upload params

* Fix building on macOS

* Update description for crashpad_pid_check.patch
2019-06-13 15:42:21 +09:00
Jeremy Apthorp
291ee2dafc
refactor: use the URL api to resolve urls in window setup (#18611) 2019-06-05 10:21:06 -07:00
Shelley Vohr
a0b1f4fe0b
refactor: convert browser window state fns to props (#18618) 2019-06-04 22:44:16 -07:00
Jeremy Apthorp
ed5fb4a720
refactor: simplify content script injection (#18532) 2019-06-04 16:07:34 -07:00
Samuel Attard
24b3d66767
refactor: remove electron.asar and embed JS in binary (#18577)
* refactor: remove electron.asar and embed JS in binary

* chore: update DEPS to merged node sha

* chore: remove unneeded eslint ignore
2019-06-03 17:03:59 -07:00
Milan Burda
cf628d9287 refactor: remove menu-will-close / setTimeout workaround (#18582) 2019-06-03 16:48:01 -05:00
Samuel Attard
cec61d010b
refactor: lazily hook into child_process in asar_init (#18576)
Previously we loaded both fs and child_process and then hooked into
the returned value, relying on the module cache to keep our modifications
and give them to everyone.

Loading child_process took in excess of 20ms though so instead of loading
it and then hooking in.  We intercept all Module load requests, and when
the first one for `child_process` comes in, we wrap the appropriate methods
and then never touch it again.
2019-06-03 13:19:52 -07:00
Samuel Attard
0ee2f8a64a
refactor: lazy load child_process in the crash-reporter module (#18574)
This module is on the hot load path and we don't need cp till later
2019-06-03 11:48:23 -07:00
Shelley Vohr
52c76d737a
refactor: make autoHideMenuBar a property on BrowserWindows (#18555) 2019-06-03 09:09:47 -07:00
Samuel Attard
18acda7888
perf: lazily create the anchor tag used for URL resolving (#18571) 2019-06-03 01:04:21 -07:00
Samuel Attard
449d2752f2
refactor: lazy load V8 module in browser/init (#18575) 2019-06-03 01:03:33 -07:00
Samuel Attard
bc527f6b51
refactor: bundle the browser and renderer process electron code (#18553)
* refactor: bundle the browser and renderer process electron code

* Bundles browser/init and renderer/init
  * Improves load performance of main process by ~40%
  * Improves load performance of renderer process by ~30%
* Prevents users from importing our "requiring" our internal logic such
as ipc-main-internal.  This makes those message buses safer as they are
less accessible, there is still some more work to be done though to lock
down those buses completely.
* The electron.asar file now only contains 2 files, as a future
improvement maybe we can use atom_natives to ship these two files
embedded in the binary
* This also removes our dependency on browserify which had some strange
edge cases that caused us to have to hack around require-order and
stopped us using certain ES6/7 features we should have been able to use
(async / await in some files in the sandboxed renderer init script)

TLDR: Things are faster and better :)

* fix: I really do not want to talk about it

* chore: add performance improvements from debugging

* fix: resolve the provided path so webpack thinks it is absolute

* chore: fixup per PR review

* fix: use webpacks ProvidePlugin to keep global, process and Buffer alive after deletion from global scope for use in internal code

* fix: bundle worker/init as well to make node-in-workers work

* chore: update wording as per feedback

* chore: make the timers hack work when yarn is not used
2019-06-02 13:03:03 -07:00
Jeremy Apthorp
c436997840
feat: add ipcRenderer.invoke() (#18449) 2019-05-31 10:25:19 -07:00
Shelley Vohr
1e3e5a6619
refactor: set appLevelAppearance prop on systemPreferences (#18477)
* refactor: set appLevelAppearance prop on systemPreferences

* ensure backwards compat is tested
2019-05-30 17:12:46 -07:00
Samuel Attard
93b8dc2362 fix: ensure the webContents is not destroyed before communicating (#18467) 2019-05-28 14:22:35 -07:00
Jeremy Apthorp
815b9d7707
feat: [contentTracing] allow calling stopTracing() with no arguments (#18411) 2019-05-28 14:15:42 -07:00
Milan Burda
ac002b3c3c fix: set nativeWindowOpen when sandboxed (#18273) 2019-05-27 02:44:54 +02:00
Jeremy Apthorp
646f572b77
refactor: netLog directly uses network service (#18289) 2019-05-23 15:31:38 -07:00
Jeremy Apthorp
ca283c74c9 Merge remote-tracking branch 'origin/master' into roller/chromium-ad1b791122c04bd91b825fbfbdf1ff4da82a0edb-1558011686736 2019-05-21 10:07:17 -07:00
Shelley Vohr
1a2ab11c90 fix: set window to null when no window is passed (#18240)
* fix: set window to null when no window is passed

* add new specs for dialog

* fix process blocking for showMessageBox
2019-05-21 09:08:22 -05:00
Milan Burda
e81afed66d chore: remove dead code (#18370) 2019-05-21 15:36:22 +09:00
Milan Burda
c1cccfc082 chore: remove duplicate internal deprecations module (just use deprecate) (#18352) 2019-05-21 00:40:49 +02:00
Milan Burda
89105e7e57 refactor: address TODO for WebContents type parsing (#18158) 2019-05-20 12:55:46 +02:00
Milan Burda
af0ad4454e refactor: add invoke helpers in window-setup (#18233) 2019-05-18 20:52:29 +02:00
Nitish Sakhawalkar
cf5224140b Chrome changed the devtools url
chrome-devtools:// to devtools://
28b21a67f0
2019-05-17 16:16:25 -07:00
Milan Burda
76783e2a90 fix: 'page-title-updated' event forwarding + documentation (#18270) 2019-05-16 12:33:16 +03:00
Milan Burda
019b31d084 chore: remove deprecated APIs (#18159) 2019-05-09 14:48:10 -04:00
Milan Burda
d79dc056bc refactor: eliminate duplicate code in asar.js (#18146) 2019-05-07 06:54:35 -07:00
Shelley Vohr
02710ef574 refactor: make templateImage a property on nativeImage (#18124)
* refactor: make templateImage a property on nativeImage

* Update docs/api/native-image.md

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

* fix nativeImage prototype deprecation

* update for new property name

* Update docs/api/native-image.md

Co-Authored-By: codebytere <codebytere@github.com>
2019-05-07 06:52:07 -07:00
Shelley Vohr
cfb6e847a0 refactor: allow embedder overriding of internal FS calls (#17906) (#18183) 2019-05-07 06:44:32 -07:00
Samuel Attard
a96b6e2c96 build: move to the new docs parser (#18103)
* build: move to the new docs parser

* chore: remove the bad getTitle param doc

* build: update parser/ts gen deps + fix some docs issues highlighted by GH desktop

* chore: apply suggestions from code review

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

* chore: update docs for accidentally removed things

* chore: update docs/api/command-line.md

Co-Authored-By: MarshallOfSound <samuel.r.attard@gmail.com>
2019-05-06 08:29:01 -07:00
Samuel Attard
636273b6cb
fix: do not mark navigations interupted with same-document navigations as aborted (#18109)
* fix: do not mark navigations interupted with same-document navigations as aborted

* spec: add tests for the loadURL promise
2019-05-03 16:19:50 -07:00
Shelley Vohr
6d96f30ed3
refactor: make shell.OpenExternal async (#17135) 2019-05-03 13:53:45 -07:00
Milan Burda
2dd108e9c9 fix: fs.promises does not work with asar paths (#18092) 2019-05-02 21:06:01 +09:00
Stewart Lord
d507ba68a7 fix: honor extensionId arg in chrome.runtime.connect (#16998)
The first argument to chrome.runtime.connect is extensionId, not connectInfo.
2019-05-02 11:42:04 +09:00
Milan Burda
6f5c850d60 refactor: add emitCustomEvent() helper (#17960) 2019-05-01 09:07:57 -04:00
Shelley Vohr
8d83518f9a
refactor: make name a prop on app (#17701)
Update app.name to be a property on app.
2019-04-30 13:55:33 -07: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
Shelley Vohr
7b55ee9d36 refactor: allow requiring modules with no side effects (#17496) 2019-04-30 09:46:08 +09:00
Samuel Attard
77a4946069
refactor: rewire the desktop capturer API to remove race conditions (#18029)
We now create a new instance of atom::api::DesktopCapturer for every
request instead of weirdly re-using the same instance and queuing
requests.  This means there is now a 1:1 relationship between request
and DesktopCapturer so there isn't a race condition between the observer
for one request calling back before the observer of another.  This is an
issue ever since the backing APIs moved to worker threads.

This also does a few things to ensure memory management
* Only ever listen to one event per-request, after that we wipe the emit
function to ignore all future events
* Ensures we clean up the window_capturer_, screen_capturer_ and
captured_sources_ in native land once the request is over.

This _in theory_ fixes a flake we've been seeing on CI where we try to
resolve the promise for a request that no longerr exists.
2019-04-29 13:21:28 -07:00
Milan Burda
9714a91392 refactor: use fs.promises API, which is stable since Node 12 (#17999) 2019-04-29 11:18:03 -07:00
Milan Burda
7574f91f31 refactor: natively promisify WebContents.prototype.takeHeapSnapshot (#18000) 2019-04-29 10:11:11 -07:00
Milan Burda
18b77a4de6 chore: rename atom-binding-setup.ts to electron-binding-setup.ts (#17949) 2019-04-29 10:57:32 -04:00
Cheng Zhao
a4fcc32799
feat: upgrade to Node 12 (#17838)
* fix: add boringssl backport to support node upgrade

* fix: Update node_includes.h, add DCHECK macros

* fix: Update node Debug Options parser usage

* fix: Fix asar setup

* fix: using v8Util in isolated context

* fix: make "process" available in preload scripts

* fix: use proper options parser and remove setting of _breakFirstLine

_breakFirstLine was being set on the process, but that has changed in node 12 and so is no longer needed. Node will handle it properly when --inspect-brk is provided

* chore: update node dep sha

* fix: process.binding => _linkedBinding in sandboxed isolated preload

* fix: make original-fs work with streams

* build: override node module version

* fix: use _linkedBinding in content_script/init.js

* chore: update node ref in DEPS

* build: node_module_version should be 73
2019-04-26 18:55:12 +09:00
Shelley Vohr
075b818a8e
fixes (#17363) 2019-04-25 15:44:54 -07:00
Shelley Vohr
c2c3a04628
fix: crash when failed to get devices in desktopCapturer (#17557)
* fix: crash when failed to get devices in desktopCapturer

* return after emit
2019-04-25 15:12:38 -07:00
Milan Burda
253d049ac9 chore: remove deprecated app.enableMixedSandbox() (#17894) 2019-04-23 21:07:40 -07:00
Jeremy Apthorp
841e31b7e6 feat: show underlying stack in errors in remote module (#17851) 2019-04-18 17:38:19 -07:00
Samuel Attard
78411db4b5
fix: maintain a ref count for objects sent over remote (#17464)
* spec: clean up after a failed window count assertion

Previously when this assertion failed all tests that ran after the
failed assertion also failed.  This ensure that the assertion fails for
the test that actually caused the issue but cleans up the left-over
windows so that future tests do not fail.

* fix: maintain a ref count for objects sent over remote

Previously there was a race condition where a GC could occur in the
renderer process between the main process sending a meta.id and the
renderer pulling the proxy out its weakmap to stop it being GC'ed.

This fixes that race condition by maintaining a "sent" ref count in the
object registry and a "received" ref count in the object cache on the
renderer side.  The deref request now sends the number of refs the
renderer thinks it owns, if the number does not match the value in the
object registry it is assumed that there is an IPC message containing a
new reference in flight and this race condition was hit.

The browser side ref count is then reduced and we wait for the new deref
message.  This guaruntees that an object will only be removed from the
registry if every reference we sent has been guarunteed to be unreffed.
2019-04-16 16:08:11 -04:00
Samuel Attard
b7b9efa875
fix: handle remote-debugging-port=0 correctly (#17800)
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 #17354
2019-04-16 14:22:51 -04:00
Shelley Vohr
9c3cb55ef2
refactor: make accessibilitySupportEnabled a property on app (#17362)
* 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 (#17680) 2019-04-04 11:35:06 -07:00
Jeremy Apthorp
127b87c713
refactor: mojofy MessageTo and MessageHost (#17613) 2019-04-03 14:22:23 -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
Shelley Vohr
0431997c8d
refactor: make applicationMenu a property on app (#17361) 2019-04-02 13:36:57 -07:00
Shelley Vohr
8ea33d69ac
fix: match net module headers & http.IncomingMessage headers (#17517)
* 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 (#17614) 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 (#17591) 2019-03-29 18:10:21 -07:00
Samuel Attard
953d1ea635
fix: ensure dots in content script patterns aren't used as wildcards (#17593)
* 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 (#17459) 2019-03-28 15:04:16 -04:00
Milan Burda
8cf15cc931 feat: only allow bundled preload scripts (#17308) 2019-03-28 11:38:51 +01:00
Shelley Vohr
34eb5d0815
fix: correctly return properties on the netLog module (#17525) 2019-03-25 22:40:38 -04:00
Milan Burda
336db33d18 refactor: use ipcMainUtils.invokeInWebContents / ipcRendererUtils.handle helpers for Chrome APIs (#17417) 2019-03-26 11:38:35 +09:00
Milan Burda
546466b209 feat: add <webview>.getWebContentsId() (#17407) 2019-03-26 10:57:27 +09:00
Milan Burda
cbd884060e fix: validate sender for replies in ipcMainInternalUtils.invokeInWebContents() (#17416) 2019-03-26 10:15:51 +09:00
Milan Burda
7389dfca59 fix: report module name when require fails in sandboxed renderers (#17413) 2019-03-19 12:00:41 -07:00
Milan Burda
06a4594435 chore: remove special handling for dialog methods in remote module (#17412)
* 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 (#17411) 2019-03-19 10:37:43 -07:00
Milan Burda
53f4af7722 fix: regressions introduced by adding world isolation to Chrome extension content scripts (#17422) 2019-03-19 14:45:48 +01:00
Shelley Vohr
38d75010c7
chore: rename atomBinding to electronBinding (#17419) 2019-03-18 12:37:06 -07:00
Shelley Vohr
db29978fe0
fix: throw error when inserting menu items out-of-range (#17401)
* 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 (#17420) 2019-03-18 07:58:03 -07:00
Milan Burda
3a091cdea4 refactor: implement clipboard APIs without the remote module (#17200) 2019-03-15 17:32:04 -07:00
Heilig Benedek
43ef561d48 feat: enable NodeIntegrationInSubFrames for webview (#17226)
* 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() (#17181)
* 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 (#17378) 2019-03-14 15:29:40 -07:00
Shelley Vohr
cb4ede453f
chore: add deprecation helper for fnToProperty (#17377)
* chore: add deprecation helper for fnToProperty

* add a test
2019-03-14 15:19:19 -07:00
Milan Burda
2e89348541 feat: promisify executeJavaScript (#17312) 2019-03-14 12:08:54 -07:00
Shelley Vohr
aa8b66aae1
feat: promisify session.getBlobData() (#17303) 2019-03-14 08:11:01 -07:00
Shelley Vohr
3e5a98b5f4
feat: promisify In-App Purchase (#17355)
* 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 (#17313) 2019-03-13 12:03:17 -07:00
Shelley Vohr
8991c0056e
feat: promisify dialog.showMessageBox() (#17298)
* 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> (#17317) 2019-03-11 17:25:46 -07:00
Samuel Maddock
f943db7ad5 feat: Add content script world isolation (#17032)
* 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 (#17315) 2019-03-11 16:17:24 -07:00
Milan Burda
a8698d092b chore: increase security of default_app (#17318) 2019-03-11 16:13:46 -07:00
Shelley Vohr
9ea6c01e02
feat: promisify session.clearAuthCache() (#17259)
* 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 (#17258)
* 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 (#17185) 2019-03-08 14:42:03 -08:00
Shelley Vohr
2769e75b49
feat: promisify session proxy methods (#17222) 2019-03-08 12:51:12 -08:00
Robo
5afb7dc715 refactor: load electron builtin modules with process._linkedBinding (#17247)
* 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() (#17229) 2019-03-08 10:26:17 -08:00
Shelley Vohr
bbfa63fd9d
feat: promisify session.clearStorageData() (#17249) 2019-03-08 09:02:30 -08:00
Milan Burda
d34f81972d refactor: make ELECTRON_BROWSER_SANDBOX_LOAD handler async (#17107) 2019-03-08 11:21:41 +01:00
Samuel Attard
61fc95417b
build: fix new TS linting errors (#17279)
* 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 (#16218)
* 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() (#16619) 2019-03-07 15:31:25 -08:00
Felix Rieseberg
f3fc4023cf refactor: Port renderer/web-view to TypeScript (#17250) 2019-03-07 15:26:23 -08:00
Felix Rieseberg
5581990d78 build: Update TypeScript, use @typescript-eslint (#17251)
* build: Update TypeScript to v3.3

* build: Update TypeScript, use @typescript-eslint
2019-03-07 12:56:02 -08:00
Milan Burda
2733697819 refactor: make ELECTRON_INSPECTOR_SELECT_FILE handler async (#17235) 2019-03-06 22:22:45 +01:00
Shelley Vohr
6cb7b8d3a4
feat: promisify dialog.showSaveDialog() (#17054)
* feat: promisify dialog.showSaveDialog()

* address some feedback from review

* filename => filePath

* fix last filename => filePath
2019-03-05 13:48:20 -08:00
Shelley Vohr
e05985145b
feat: promisify dialog.showOpenDialog() (#16973)
* feat: promisify dialog.showOpenDialog()

* address feedback from review

* address feedback from review
2019-03-05 05:54:48 -08:00
Milan Burda
bbd1ae315a refactor: use invoke/invokeSync helpers for <webview> implementation (#16784) 2019-03-01 13:33:03 -05:00
Felix Rieseberg
59a7fa6927 refactor: Port api/web-frame to TypeScript (#17053) 2019-03-01 08:39:04 +00:00
Shelley Vohr
544d8a423c
feat: allow MenuItems to work optionally when hidden (#16853)
* feat: allow MenuItems to work optionally when hidden

* fix: actually include forward_declaration
2019-02-28 17:00:54 +00:00
Milan Burda
64078324bf refactor: make CHROME_GET_MESSAGES handler async (#17148) 2019-02-27 21:30:35 -06:00
Nitish Sakhawalkar
bfa07ec4be feat: Add new powerMonitor synchronous API (#17144)
`powerMonitor.querySystemIdleState` and `powerMonitor.querySystemIdleTime` had async backing APIs in chromium (https://chromium-review.googlesource.com/c/chromium/src/+/1379183). However, that has changed in ch73. So, this PR deprecates the old async APIs and adds new sync APIs.
2019-02-27 15:54:01 -05:00
Samuel Attard
08066581b0 fix: set cancelId to 1 when defaultId == 0 and no 'cancel' button (#17123) 2019-02-27 08:24:13 +00:00
Milan Burda
5a99ea4c46 refactor: merge ipcMainUtils.handle / handleSync (#17062) 2019-02-26 15:48:26 -08:00
Shelley Vohr
d9c7735a04 chore: augment promisifyMultiArg deprecation (#17066) 2019-02-25 18:25:25 -08:00
Felix Rieseberg
7f007109c3 refactor: Port inspector to TypeScript (#16943)
* refactor: Port inspector to TypeScript

* refactor: Add another type to inspector

* refactor: Use correct paths

* Update lib/renderer/inspector.ts

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

* refactor: Implement feedback <3

* refactor: Don't define blob at all

* fix: Correct type
2019-02-25 18:10:25 -08:00
Thomas Beverley
1674388028 Fix webContents.print() (#17052) 2019-02-25 13:30:21 +00:00
ZYSzys
a40d826b11 chore: remove unused catch bindings (#16121) 2019-02-21 09:26:07 +00:00
Shelley Vohr
3edc497d3d
feat: show user gesture type in click event (#16954) 2019-02-20 12:20:24 +00:00
Felix Rieseberg
91f81b4b72 refactor: Port renderer/init to TypeScript (#17027)
* refactor: Port renderer/init to TypeScript

* Update lib/renderer/init.ts

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

* refactor: Type this a bit more loosely

* refactor: Type parseOption strictly
2019-02-19 17:05:14 +00:00
Felix Rieseberg
2223114f20 refactor: Port chrome-api to TypeScript (#17014) 2019-02-19 13:09:44 +00:00
Milan Burda
7e7abc28f5 feat: promisify netLog.stopLogging (#16862) 2019-02-19 10:48:27 +00:00
Samuel Attard
3b74837020 refactor: Split 'Event' docs/types into more specific Event types (#17038)
* Event = Base event type (with preventDefault)
* IpcMainEvent = Event that ipcMain emits (with sender, reply, etc.)
* IpcRendererEvent = Event that ipcRenderer emits (with sender,
senderId, etc.)
* KeyboardEvent = Event that we emit with keyboard flags (ctrlKey,
altKey, etc.)

This will dramatically improve peoples TS experience with IPC events
2019-02-19 09:24:19 +00:00
Felix Rieseberg
eaa0e28396 refactor: Port content-scripts-injector to TypeScript (#17012) 2019-02-18 12:47:07 +00:00
Felix Rieseberg
596acdcb91 refactor: Port web-frame-init to TypeScript (#16934)
* refactor: Port web-frame-init to TypeScript

* refactor: Use ipcRendererInternal
2019-02-18 00:24:18 +00:00
Felix Rieseberg
6b3ff4f1f7 refactor: Port security warnings to TypeScript (#16937)
* refactor: Port security-warnings to TypeScript

* chore: make aliasify work on .ts files as well

* refactor: Implement feedback <3

* refactor: Correctly call executeJavaScript
2019-02-16 17:06:30 -08:00
Milan Burda
975a035d34 chore: re-enable devtools renderer sandbox (#16864)
* chore: re-enable devtools renderer sandbox

* chore: enable sandbox for chrome extension background script host renderers
2019-02-15 15:10:32 +05:30
Felix Rieseberg
2498e8d1c2 refactor: Port renderer-internal to TypeScript (#16939)
* chore: make aliasify work on .ts files as well

* refactor: Port ipc-renderer-internal to TypeScript

* refactor: Correctly import internal ipcRenderer

* refactor: One more rename

* refactor: Fix one more lint issue

* refactor: Correctly reference ipcRendererInternal
2019-02-14 17:24:25 -08:00
Samuel Attard
5790869a3f
chore: refactor browser IPC into TS and app API into TS (#16921)
* chore: refactor browser IPC into typescript

* chore: refactor app.ts into Typescript

* Refactors app.dock into cpp
* Removes app.launcher which has not existed for 3 years
* Removes 2 deprecated APIs (that have been deprecated for more than one
major)
* Refactors deprecate.ts as well
2019-02-14 14:29:20 -08: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
deepak1556
547add94d0 Make //ui/base/idle API synchronous
https://chromium-review.googlesource.com/c/chromium/src/+/1379183
2019-02-14 23:59:23 +05:30
deepak1556
606c84b302 Blink: Plumb correct security origin for isolated world CSPs.
https://chromium-review.googlesource.com/c/chromium/src/+/1395190
2019-02-14 23:59:22 +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
Stewart Lord
84ef9cae6c fix: send chrome.runtime/tabs.sendMessage result to correct sender (#16945)
Additionally, use `.once` instead of `.on` for result specific listeners.
2019-02-14 06:07:55 -10:00
Felix Rieseberg
31494dfade refactor: Port getRemote to TypeScript (#16938)
* chore: make aliasify work on .ts files as well

* refactor: Port getRemote to TypeScript

* refactor: Implement feedback <3
2019-02-14 04:04:53 -10:00
Felix Rieseberg
6cd75744ef refactor: Port window-setup to TS (#16894)
* refactor: Port window-setup to TS

* refactor: Make the linter happy

* refactor: Sneaky little TS error

* refactor: Correctly import window-setup

* refactor: Implement feedback <3

* refactor: Allow decorators in TS

* refactor: Use named windowSetup in isolatedRenderer

* refactor: Help TS understand

* refactor: Welp, use createEvent again

* refactor: Use the correct target in the decorator
2019-02-14 03:52:38 -10:00
Milan Burda
2492f0bcac refactor: promisify prototype methods (#16935) 2019-02-14 03:40:24 -10:00
Felix Rieseberg
9112ad01be refactor: Port renderer-internal-utils to TypeScript (#16942)
* chore: make aliasify work on .ts files as well

* refactor: Port renderer-internal-utils to TypeScript

* refactor: Implement feedback <3
2019-02-13 23:05:49 -08:00
Stewart Lord
228805353f fix: pass result to chrome.tabs.executeScript callback (#16941)
* fix: pass result to chrome.tabs.executeScript callback

Additionally, remove `nextId` counter in favor of `originResultID` counter which is more widely used in this file.

* fix: remove need for eslint override and better match style
2019-02-13 17:00:36 -08:00
Shelley Vohr
fed5b99a9f
feat: promisify contentTracing.getTraceBufferUsage() (#16600)
* feat: promsify contentTracing.getTraceBufferUsage()

* deprecate getTraceBufferUsage

* address feedback from review

* properly deprecate
2019-02-13 13:24:57 -08:00
Nitish Sakhawalkar
3dfef4a376 chore: Add new webFrame IsolatedWorldInfo API and deprecate (#16801)
* chore: Add new webFrame IsolatedWorldInfo API and deprecate

* Flag deprecated methods in documentation

* address comments

* Address review comments

* remove unused variable

* Update based on review
2019-02-13 08:05:28 -10: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
Samuel Maddock
8f6a543398 feat: add chrome.runtime.getManifest (#16891)
* feat: add chrome.runtime.getManifest

* Add test for chrome.runtime.getManifest

* Use IPC utils for getManifest internals
2019-02-13 07:16:12 -10:00
Samuel Attard
01c442de64 refactor: convert more files to typescript (#16820) 2019-02-12 04:22:33 -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
Milan Burda
7a3d220347 refactor: implement Chrome Extension APIs without the remote module (#16686)
* refactor: implement Chrome Extension APIs without the remote module

* remove unused potentiallyRemoteRequire
2019-02-10 10:38:14 -08:00
Cheng Zhao
d16b581140 fix: remove memory leak when using webFrame and spell checker (#16770)
* fix: do not create native api::WebFrame in webFrame

When reloading a page without restarting renderer process (for example
sandbox mode), the blink::WebFrame is not destroyed, but api::WebFrame
is always recreated for the new page context. This leaves a leak of
api::WebFrame.

* fix: remove spell checker when page context is released
2019-02-08 13:38:31 -08:00
Milan Burda
3f52e18a38 chore: add menu-will-close comment explaining setTimeout (#16794) 2019-02-08 13:38:03 -08:00
Milan Burda
1632c4b837 refactor: implement chrome.i18n.getMessage() without the remote module (#16739)
* refactor: implement chrome.i18n.getMessage() without the remote module

* replace navigator.language with app.getLocale()
2019-02-08 12:07:09 -08:00
Shelley Vohr
e790dbd737
chore: add standalone function deprecation helper (#16782) 2019-02-08 09:50:11 -08:00
Samuel Attard
db11b9b13b
fix: restore accidentally removed chrome-extension require (#16819) 2019-02-07 12:38:57 -08:00
Shelley Vohr
9ebba76c03
chore: improve existing error preservation in promisify (#16815)
This PR better preserves existing behavior in `deprecate.promisify()` in the cases where the promise fails. Previously, if a callback was only called with `data` instead of `err, data` and the promise was rejected, `data` would be populated with `err`, which could be confusing to users. This makes it such that `err` is called back on promise rejection if a callback is called with `err, data` a la Node.js.
2019-02-07 10:25:20 -08:00
Samuel Attard
4f8ebafa97 chore: dont log 100000000 chars of URL (#16800) 2019-02-07 08:50:47 -08:00
Samuel Attard
26df9992cf
build: use typescript for internal Electron JS code (#16441) 2019-02-06 10:27:20 -08:00
Shelley Vohr
858781ba83
feat: allow Menu.buildFromTemplate() to accept MenuItems (#16697)
* feat: allow Menu.buildFromTemplate to accept MenuItems

* add another spec

* fix linter error

* add submenu spec
2019-02-06 10:04:40 -08:00
Milan Burda
4211a9c69f refactor: use ipcRendererUtils.invokeSync / ipcMainUtils.handleSync (#16759) 2019-02-06 09:53:28 -08:00
Milan Burda
6d674eebb1 refactor: crashReporterInit (#16729) 2019-02-05 12:56:44 -08: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
Milan Burda
7dc565fc2e refactor: implement inspector APIs without the remote module (#16607) 2019-02-01 19:56:46 +01:00
michtsu
392458b252 Add devtools API to inspect shared worker. (#16615) 2019-02-01 10:44:24 -08:00
Charles Kerr
76dcbcd6ea chore: fix 'browserView' typo (#16621) 2019-01-30 21:07:08 -08:00
Shelley Vohr
ba57e1d991
feat: promisify contentTracing recording APIs (#16584)
* feat: promisify contentTracing.startRecording()

* feat: promisify contentTracing.stopRecording()

* test: convert specs for new promisified apis

* chore: deprecate and ensure legacy tests work
2019-01-30 18:53:55 -08:00
Shelley Vohr
641b47f384
feat: promisify contentTracing.getCategories() (#16583)
* feat: promisify contentTracing.getCategories()

* deprecate contentTracing/getCategories
2019-01-30 12:39:55 -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
Milan Burda
fa5442f211 fix: execute session preload scripts in sandboxed renderers (#16538) 2019-01-29 10:16:46 +09: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
Charles Kerr
8396a2d504
feat: promisify cookies api (#16464)
* feat: promisify the Cookie API

* chore: update specs to test promisified cookies

* chore: add deprecate wrapper for cookie callback API

* docs: update docs to cookie promise changes

* chore: remove redundant namespace use

* docs: improve cookie example

* docs: restore docs for cookie callback API

* chore: restore cookie callback tests

* fix: syntax of cookie promise return types
2019-01-25 12:11:35 -06:00
Milan Burda
713df08e3e chore: remove deprecated modules internally using remote.require in sandboxed renderer context (#15957) 2019-01-24 10:53:52 -08:00
Milan Burda
fef262f829 fix: check process.isMainFrame in sandboxed_renderer/init.js (#16500) 2019-01-24 10:53:16 -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
f3e30c7ae3
Merge remote-tracking branch 'origin/chromium-upgrade/72' 2019-01-22 12:01:18 -08:00
Samuel Attard
0b85fb7ea2
Revert "feat: upgrade to Chromium 72.0.3626.52 (#16334)"
This reverts commit 1918e76913.
2019-01-22 12:01:04 -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
Jeremy Apthorp
92b9525cfd
feat: enable mixed-sandbox mode by default (#15894) 2019-01-22 10:44:28 -08:00
Jeremy Apthorp
1918e76913 feat: upgrade to Chromium 72.0.3626.52 (#16334) 2019-01-22 10:39:32 -08:00
Samuel Attard
ff9b23ebe5
fix: dont run window-setup on chrome:// protocol, introduced in b965e54efc (#16489) 2019-01-22 10:32:18 -08:00
Cheng Zhao
03d499bf34 fix: detach webview instead of destroying it
Chromium no longer cleans up everything when a guest webcontents is
destroyed, we have to force detaching it and let Chromium destroy everything.
2019-01-22 10:32:06 -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
Milan Burda
b965e54efc fix: <webview> not working with contextIsolation + sandbox (#16469) 2019-01-22 10:08:16 +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
441c9ce376
feat: promisify desktopCapturer.getSources (#16427)
* feat: promisify desktopCapturer.getSources

* fix doc

* fix docs lint error
2019-01-18 15:29:32 -08:00
Milan Burda
7d4a1223fd feat: add preload-error event to webContents (#16411) 2019-01-18 12:03:43 +01: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
Shelley Vohr
720197f9c8
fix: correctly handle IPC for promise-based methods (#16433) 2019-01-17 12:08:54 -08:00
Shelley Vohr
1f2b02c18f
feat: promisify protocol.isProtocolHandled() (#16423)
* feat: promisify protocol

* fix base::Bind and specs

* update documentation

* make callback-compatible

* async awaitify tests
2019-01-17 09:05:10 -08:00
Milan Burda
23d44e322d feat: use default-app behavior in packaged apps (#16310)
Unify the behavior between default app and packaged apps:
- create default application menu unless the app has one
- default window-all-closed handling unless the app handles the event
2019-01-15 21:35:53 +01:00
Milan Burda
52e257668d fix: windowmenu did not show the window list on macOS (#16387) 2019-01-14 17:27:52 +01:00
Robo
52fe92d02e feat: Upgrade to Chromium 71.0.3578.98 (#15966) 2019-01-11 17:00:43 -08:00
Milan Burda
eb02a422de feat: add fileMenu / viewMenu / appMenu roles (#16328) 2019-01-10 14:32:03 +01:00
Milan Burda
349a3c20ae feat: add additional remote APIs filtering (#16293) 2019-01-08 14:27:56 -08:00
Milan Burda
5c250455ad refactor: pass isWebViewTagEnabled via ELECTRON_BROWSER_SANDBOX_LOAD (#16238) 2019-01-08 10:12:34 +01:00
Shelley Vohr
b71a5a5955
fix: register accelerator if role has no registerAccelerator (#16309)
* fix: register accelerator if role has no registerAccelerator

* ensure roles[role].registerAccelerator  is defined
2019-01-07 16:01:03 -08:00
Milan Burda
fade3eb679 chore: make "nodeIntegration" and "webviewTag" default to false (#16235) 2019-01-07 22:19:27 +03:00
Milan Burda
6f117b8e0c feat: add app.commandLine.hasSwitch() / app.commandLine.getSwitchValue() (#16282)
* feat: add app.commandLine.hasSwitch() / app.commandLine.getSwitchValue()

* add more tests

* refactor: move appendSwitch / appendArgument to command_line module

* replace AppendSwitchASCII with AppendSwitchNative

* remove castArgs
2019-01-07 07:48:27 -08:00
Jeremy Apthorp
959c7a76e9
Merge pull request #16252 from electron/miniak/guest-view-manager
fix: security: improve IPC validation in guest-view-manager
2019-01-04 16:47:27 -08:00
Milan Burda
a0cdcc5f8d security: improve IPC validation in guest-view-manager 2019-01-05 00:06:47 +01:00
Jeremy Apthorp
849dd0db64 fix: correctly pass hidden-page argument to isolated renderers (#16258) 2019-01-04 08:25:47 -08:00
Milan Burda
3f1d22759a refactor: use helpers for command-line parsing in renderer/init.js (#16239) 2019-01-03 11:22:34 -05:00
Cheng Zhao
a5e63dc5fd
fix: don't expose isolatedWorld to global (#16208) 2018-12-28 10:54:32 +09: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
Alex Greenland
dc93d94bc8 fix: support async child process methods without callback in asar (#15927)
* fix: support async child process methods without callback in asar

* fix: support async child process methods without callback in asar (improved)
2018-12-18 16:27:39 +09:00
Milan Burda
7a6fe00f49 chore: simplify code for modules internally using remote.require in sandbox (#16104) 2018-12-17 22:47:41 +03:00
Cheng Zhao
8584c2f14b
fix: register webview in main world when using contextIsolation (#16067) 2018-12-14 15:38:35 +09:00
Cheng Zhao
897c6e93cb chore: simplify main world setup of contextIsolation (#16046) 2018-12-13 16:25:12 -05:00
Charles Kerr
f7528a0204
fix: fix an original-fs regression introduced in 4.0 betas (#16028)
* fix: fix an original-fs regression introduced in 4.0 betas

* chore: remove cruft from earlier draft
2018-12-12 15:32:53 -06:00
Milan Burda
c65a0d90b8 chore: misc cleanup (#16037) 2018-12-12 15:31:16 -06:00
Milan Burda
607b53c883 security: block chrome.tabs.executeScript() for non chrome-extension: URLs (#15929) 2018-12-11 10:45:46 +01:00
Benjamin Pasero
c74ae107f1 fix: do not print an error for an expected condition (#15991) (#15992) 2018-12-10 12:06:26 -08: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
177091ca6f chore: rename nativeRequire to potentiallyRemoteRequire (#15971) 2018-12-06 18:12:50 -08:00
Jeremy Apthorp
442c1b22e3
feat: webContents.loadURL returns a promise (#15855) 2018-12-06 12:16:19 -08:00
Milan Burda
764a10f7c7 refactor: simplify isRemoteModuleEnabled handling in sandboxed renderers (#15961) 2018-12-05 10:07:56 -08:00
Milan Burda
ab2a061b59 refactor: use helpers when using the remote module in sandboxed renderers (#15960) 2018-12-05 10:07:32 -08:00
Shelley Vohr
3f15f51615
feat: promisify app.getFileIcon() (#15742) 2018-12-05 08:50:12 -08:00
Milan Burda
d561c5531b feat: deprecate modules internally using remote.require in sandboxed renderer context (#15145) 2018-12-05 10:34:09 +01:00
Pedro Pontes
d5d1fa8290 fix: use appropriate site instance for cross-site nav's (#15821)
* fix: use Chromium's determined new site instance as candidate when navigating.

When navigating to a new address, consider using Chromium's determined site instance
for the new page as it should belong to an existing browsing instance when the
navigation was triggered by window.open().

fixes 8100.

* Revert "fix: use Chromium's determined new site instance as candidate when navigating."

This reverts commit eb95f935654a2c4d4457821297670836c10fdfd5.

* fix: delegate site instance creation back to content when sandboxed.

* fix: ensure site isolation is on

* test: adapt ut for cross-site navigation

* fix: register pending processes during a navigation.

* refactor: dont call loadURL for a window constructed from an existing webContents.

* test: add sandboxed affinity UT's.

* fix: check affinity before deciding if to force a new site instance.

* chore: adapt subsequent patch.

* refactor: constify logically const methods.

* fix: do not reuse site instances when navigation redirects cross-site.

* test: ensure localStorage accessible after x-site redirect.

* test: adapt localStorage acess denied UT for site isolation.

* fix: do not send render-view-deleted for speculative frames.

* chore: amend tests after rebase.

* test: add ut for webContents' render-view-deleted emission

* fix: introduce current-render-view-deleted for current RVH's deletions.

Revert render-view-deleted to being emitted with any RVH's deletion.
current-render-view-deleted is emitted only when the RVH being deleted
is the current one.

* refactor: style and comments fixed.
2018-12-05 17:03:39 +09:00
Milan Burda
aa2b2f7c8f fix: security: don't allow arbitrary methods to be invoked on webContents via IPC (#15919) 2018-12-04 16:12:21 +01:00
Cheng Zhao
ca7dec2082 fix: default prop of location should be empty str 2018-12-04 17:11:26 +09:00
Cheng Zhao
fc4e10b6c0 fix: set setter of window.location 2018-12-04 16:23:52 +09:00
Anrock
e80e3a53e9 feat: introduce LocationProxy for BrowserWindowProxy 2018-12-04 16:23:52 +09:00
Julien Isorce
1f55f1635f feat: add support for DesktopCapturerSource.appIcon
Useful to get the icon of the application owning the source.
Only available for sources of type window, i.e. not for screen.

https://github.com/electron/electron/issues/14845
2018-12-04 15:42:49 +09:00
Shelley Vohr
a1a431eb87
fix: make windowMenu role correct on MacOS (#15930) 2018-12-03 11:52:46 -08:00
Samuel Attard
3ddd917ff4
Merge pull request #15405 from electron/chromium-upgrade/70
feat: upgrade to Chromium 70.0.3538.110
2018-12-04 03:26:49 +11:00
Milan Burda
a33eeda4f7 refactor: don't expose NavigationController as an internal module (#15920) 2018-12-03 17:13:09 +01:00
Samuel Attard
b1e69e1357 chore: update asar injection for new node internal module loader 2018-12-03 20:07:41 +05:30
Milan Burda
559fd5cb31 chore: remove unused module (#15917) 2018-12-02 14:43:04 -08:00
Milan Burda
8483cb4aa7 security: only handle related IPCs when <webview> tag is enabled (#15859)
* refactor: move guest-view-manager related IPC handling out of rpc-server

* feat: only handle related IPCs when <webview> tag is enabled
2018-11-30 18:44:38 +09: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
Shelley Vohr
0a5f8611e8
chore: add promise api runtime flag (#15841)
* chore: add promise api runtime flag

* add promisification plan document

* fix process.md typo
2018-11-26 16:00:46 -05:00
Heilig Benedek
0242818f39 feat: add registerAccelerator flag to allow menu items to optionally skip accelerator registration (#15723)
* feat: add registerAccelerator flag to allow menu items to skip registration

* docs: add docs for registerAccelerator

* docs: re-add accidentally removed line
2018-11-26 10:43:55 -08:00
Samuel Attard
0b0a17ff91 fix: load the chrome.* API on chrome-extension pages in sandbox mode (#15563)
With mixed sandbox enabled we need to load the chrome.* APIs in the
sandbox init.js so that chrome extensions load correctly.

This mirrors the equivilant impl in `atom_renderer_client.cc`

Fixes #15561
2018-11-21 12:56:58 -05:00
Cheng Zhao
47bf8e1bb3
view: add ResizeArea class (#15752) 2018-11-21 22:39:59 +09:00
Pedro Pontes
57d2ae1aec revert: "fix: window.open site instance should belong to same browsing instance (#15216)" (#15757)
This reverts commit 8f35198bfb.
2018-11-20 21:28:26 +01:00
Jeremy Apthorp
90d1c0b2b6
chore: don't explicitly destroy asar archives (#15734) 2018-11-19 13:12:41 -08:00
Shelley Vohr
a45d5960d7
chore: allow for callback => promise deprecation (#15758)
* chore: allow for callback => promise deprecation

* cb type check is sufficient

* migrate warn to always trigger
2018-11-19 12:56:26 -05:00
Jeremy Apthorp
0642be296d
fix: crash in sandbox on linux when getting execPath (#15701) 2018-11-15 12:59:01 -08:00
Pedro Pontes
8f35198bfb fix: window.open site instance should belong to same browsing instance (#15216) 2018-11-12 22:01:43 +01:00
Shelley Vohr
c06f023313
feat: allow partial setting of window bounds (#15677)
Extend the existing win.setBounds functionality by allowing developers to partially update bounds without being forced to pass in all four bounds values. No existing functionality is altere
2018-11-12 15:31:14 -05:00
Samuel Attard
edf063bae3
chore: remove deprecated touch-bar API (#15650) 2018-11-09 17:00:19 +11: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
Jeremy Apthorp
10969b8c3c
fix: make feature strings more robust to whitespace (#15602)
Fixes #15594
2018-11-06 15:52:06 -08:00
Samuel Attard
fe8965efa2 fix: use sendToAll method correctly in chrome-api (#15518) 2018-11-01 07:16:49 -07:00
Cheng Zhao
a8f2646ba6 Fix missing remote object error when calling remote function created in preload script (#15444)
* fix: report wrong context error based on contextId

* fix: destroyed remote renderer warning is now async
2018-10-31 11:26:57 -04:00
Shelley Vohr
d21d83cfc8
fix: folder open not working in devtools (#15387) 2018-10-25 08:36:48 -07:00
Shelley Vohr
40874ddec6
fix: update fs methods for options param (#15323)
* fix: update fs methods for options param

* fix: update rest of fs methods with changes
2018-10-23 15:14:05 -07:00
Cheng Zhao
260778e0fb feat: add MdTextButton to View APIs (#15328)
* view: make button focusable by default

* view: add MdTextButton

* view: add common methods to LabelButton
2018-10-23 10:57:13 -04:00
Cheng Zhao
cb9be091aa refactor: remove potential double free when managing WebContents (#15280)
* refactor: remove -new-contents-created event

Chromium expects us to take ownership of WebContents in AddNewContents,
we should not create V8 wrapper in WebContentsCreated, otherwise we
would have WebContents being managed by 2 unique_ptr at the same time.

* refactor: make CreateAndTake take unique_ptr
2018-10-22 13:02:25 -05:00
Shelley Vohr
f9f34fd628
fix: ability to fetch separators by id (#15290) 2018-10-19 13:09:40 -07:00
Samuel Attard
122017e6fa
fix: trim app name and productName (#15269)
Fixes #15245
2018-10-19 23:57:55 +11:00
Andy Dill
37f2113032 feat: expose setBackgroundThrottling api (#15104) 2018-10-19 11:32:22 +11:00
Eric
10db2bce4e fix: loading of devtools extensions on startup (#13844)
* Fix loading of devtools extensions on startup

The persisted DevTools Extensions were not being loaded correctly at startup. The `addDevToolsExtension` function was not defined when it was being called. An error was being thrown and ignored, so the whole thing would fail silently. I moved the code to load the extensions to the end of the event handler, so now it works.

* fixup: remove trailing spaces to unblock CI

* fixup: add logging when the Electron Enable Logging env var is set

* Fix linter error on undefined srcDirectory

* fixup: catch exception when loading extension

* Revert "fixup: catch exception when loading extension"

This reverts commit 42c2cf95bcaab8abfc5fbecbe4365d3adfe36d5b.
2018-10-19 11:22:42 +11:00
Milan Burda
db37ab1039 feat: add remote.require() / remote.getGlobal() filtering (#15014) 2018-10-18 14:36:45 +11:00
Milan Burda
508551b81b fix: small refactoring regressions (#15206)
* fix: require('@electron/internal/browser/guest-view-manager')

* fix: add missing crashServicePid used by tests
2018-10-17 12:18:18 -07:00
Adam Meyer
d43ef97a7b add width to webview iframe (#15195) 2018-10-17 09:33:31 +09:00
Milan Burda
70c49b78ae fix: Memory > Profiles > Load in DevTools (#15151) 2018-10-14 17:30:49 +11:00
Milan Burda
d3efc52745 feat: add webPreferences.enableRemoteModule option (#13028) 2018-10-13 20:50:07 +03: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
Felix Rieseberg
d1b2d1a10e fix: Remove statSyncNoException for good (#15092)
* fix: Small JS assignment error

* fix: Call the right og method

* fix: Goodbye, statSyncNoException
2018-10-12 19:43:19 +11:00
Milan Burda
9177dbb584 refactor: use boolean for nodeIntegration / webviewTag (#15005) 2018-10-08 15:51:31 +02: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
Robo
434a6e3561 refactor: create request context from network context (#14656)
* [ci skip] refactor: create request context from network context

* [ci skip] refactor: subscribe to mojo cookiemanager for cookie changes

* [ci skip] refactor: manage the lifetime of custom URLRequestJobFactory

* refactor: use OOP mojo proxy resolver

* revert: add support for kIgnoreCertificateErrorsSPKIList

* build: provide service manifest overlays for content services

* chore: gn format

* fix: log-net-log switch not working as expected

* spec: verify proxy settings are respected from pac script with session.setProxy

* chore: use chrome constants where possible

* fix: initialize request context for global cert fetcher

* refactor: fix destruction of request context getters

* spec: use custom session for proxy tests

* fix: queue up additional stop callbacks while net log is being stopped

* fix: Add CHECK for cookie manager retrieval

* chore: add helper to retrieve logging state for net log module

* fix: ui::ResourceBundle::GetRawDataResourceForScale => GetRawDataResource

* style: comment unused parameters

* build: move //components/certificate_transparency deps from //brightray

* chore: update gritsettings_resource_ids patch

* chore: update api for chromium 68

* fix: net log instance is now a property of session
2018-10-04 13:08:56 -05:00
Milan Burda
5efb0fdff1 feat: add security warnings to sandboxed renderers (#14869)
Also refactor not to use the remote module.
2018-10-03 21:36:12 +02:00
Cheng Zhao
4c4d8c5bfa fix: support ASAR in fs.copyFile (#14942) 2018-10-03 09:36:20 -07:00
Samuel Attard
d628aad3bf
feat: remove needless mojave dark mode APIs and add instructions on how to use the macOS replacement (#14895) 2018-10-02 14:44:50 +10:00
Milan Burda
3ad3ade828 refactor: add prefer-const to .eslintrc + fix errors (#14880) 2018-10-02 11:56:31 +10:00
Milan Burda
d48f9bcf7f refactor: implement <webview> methods via dedicated IPCs without the remote module (#14377) 2018-10-01 10:07:50 +09:00
Milan Burda
ce38be74df refactor: simplify process object initialization for sandboxed renderers (#14878)
Also fix `process.windowsStore`.
2018-09-30 23:24:00 +02:00
Milan Burda
c61db523c7 refactor: replace var with const / let (#14866) 2018-09-29 09:17:00 +10:00
Samuel Attard
a524c5ec12
chore: move the view APIs to their own directory (#14722)
* chore: move the view APIs to their own directory

* move view api cpp files
2018-09-28 12:47:09 +10:00
Samuel Attard
0d2a0c7583 feat: add APIs to support mojave dark modes (#14755)
* feat: add APIs to support mojave dark mode

Closes #13387

* docs: fix system-prefs typo
2018-09-27 10:33:31 -05:00
Milan Burda
b499d57cfd refactor: use error-utils for remote exception serialization / deserialization (#14788)
* refactor: use error-utils for remote exception serialization / deserialization

* fix internal process.type in sandboxed renderer
2018-09-26 15:44:55 +10:00
Milan Burda
3df739fa89 refactor: implement crashReporter.start() without the remote module (#14434) 2018-09-26 15:43:34 +10:00
Samuel Attard
176a76217c
chore: have 'use strict' consistently across our lib files (#14721) 2018-09-23 00:28:50 +12:00
Samuel Attard
32a9df2940
refactor: clean up the default app implementation (#14719)
* Disable nodeIntegration
* Enable contextIsolation
* Re-implement the CSP security check to handle running in
contextIsolation
* Disable bad DCHECKS for the promise helper
* Remove the unused "-d" flag for the electron binary
* Added a way to hide the default help output for electron devs who
don't want to see it every time
2018-09-21 15:24:42 +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
6d01952e66
chore: replace standard with eslint-config-standard and add custom rules (#14636)
* chore: replace standard with eslint-config-standard

This adds support for --cache so linting JS only takes ~1 second and only lints things that changed

It also allows us to add custom linting rules

* chore: add eslint-plugin-mocha and enable the no-exclusive-tests rule

This will block anyone from pushing / merging a `.only` test or describe
2018-09-16 03:51:23 +10:00
Samuel Attard
558fff69e7
chore: update to standard 12 2018-09-14 14:57:01 +10:00
Charles Kerr
a3f7e298cf
refactor: remove unused, duplicated code in deprecate module (#14579)
* remove obsolete tests

 * remove unused deprecate API

 * make a warnOnce helper for the deprecate methods

 * misc. copyediting, e.g. variable names, whitespace

 * test that any deprecation warns once at most

 * use strict
2018-09-12 17:13:22 -05:00
Shelley Vohr
a8a610cb34
chore: remove only on deprecations api spec (#14564)
* chore: remove only

* add option to ignore missing properties
2018-09-11 23:00:41 -07:00
Samuel Attard
dde194d853 Remove the memory property from getAppMetrics
See 03d0bfd593 for more information
2018-09-11 20:24:03 +02:00
Samuel Attard
14df89f214 Remove the 'getProcessMemoryInfo' API
* Underlying APIs have been removed in Chromium
  * https://chromium-review.googlesource.com/c/chromium/src/+/969089
  * https://chromium-review.googlesource.com/c/chromium/src/+/953723
  * https://bugs.chromium.org/p/chromium/issues/detail?id=819289
* https://github.com/electron/electron/projects/11#card-11509601
2018-09-11 20:21:32 +02:00
Robo
14ed71fa1b fix: use render client id to track deleted render process hosts (#14520)
* fix: use render client id to track deleted render process hosts

Instead of relying on OS process id, which may not be unique
when a process is reused, we rely on the renderer client id
passed by the content layer when starting the renderer process
which is guaranteed to be unique for the lifetime of the app.

* fix: store context id as int64_t

Ensuring that it doesn't wrap easily with a large number
of context creation on some malformed web pages.
2018-09-11 11:18:10 -07:00
Shelley Vohr
2157d09956
chore: refactor deprecation apis (#14495) 2018-09-11 11:16:49 -07: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
Alexey Kuzmin
382afc03ae chore: clean up asar stuff (#14505)
* chore: reformat code

* refactor: getOrCreateArchive() for ASARs

 - store cached archive in a Map
 - return `null` instead of `false` on failures

* refactor: splitPath() for ASARs

 - store custom extension in a constant
 - remove magic numbers
 - add comments

* refactor: explicitly use assert() for a developer error

* chore: remove console.log() calls

* refactor: replace "p" arguments with "pathArgument"

"path" would be a better name, but it is already taken
but the "path" Node module.

* refactor: createError() for ASARs

 - return an `Error` instance
 - use enum for error types
 - minor improvements

* refactor: use more meaningful name for an arg than just "arg"
2018-09-10 08:29:19 -07:00
Milan Burda
dcd580b6cf chore: remove app.makeSingleInstance / releaseSingleInstance (#14518) 2018-09-10 16:33:36 +10:00
Shelley Vohr
2963e377ae
refactor: clean up asar functionality (#14046) 2018-09-07 19:23:47 -07:00
Cheng Zhao
92e094c5f6 fix: manually manage WebContents of webview when it is detached 2018-09-07 15:47:58 +09:00
Charles Kerr
c5820bfabb
fix: don't use deprecated fstatNoException API (#14463) 2018-09-06 13:06:32 -05:00
Shelley Vohr
9bf1fb323b
chore: add removeFunction to deprecate module (#14468)
* chore: add removeFunction function to deprecate api

* re-comment deprecate.member
2018-09-05 21:55:28 -07:00
Cheng Zhao
10176c71ff
fix: webview.focus() should move page focus to webview (#14427) 2018-09-03 11:41:54 +09:00
Milan Burda
c17a1b37ea feat: add event.senderId property to IPCs sent via ipcRenderer.sendTo (#14395) 2018-08-31 20:13:51 -05:00
Cheng Zhao
0ecea96048 fix: use flexbox to style webview (#14400)
* fix: use flexbox to style webview

* docs: remove notes on browserplugin based webview
2018-09-01 08:53:13 +12:00
Milan Burda
3a79eacb6f refactor: don't expose CallbacksRegistry as an internal module (#14389) 2018-08-31 11:29:00 -07: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
Samuel Attard
66d6ba8689 sec: deprecate some webPreference defaults to be secure-by-default (#14284)
* feat: deprecate default value of nodeIntegration

* Use DeprecationStatus::Stable as the default instead of shadowing

* change wording of deprecations

* chore: also deprecate kWebviewTag and kContextIsolation

* chore: do as we preach, lets be secure-by-default in the default app
2018-08-29 13:14:04 -05:00
John Kleinschmidt
865435c491
Merge pull request #14287 from electron/miniak/ipc-refactoring
refactor: move common logic to handleRemoteCommand (rpc-server.js)
2018-08-28 17:06:38 -04:00
Cheng Zhao
459a2304b4 fix: emit focus/blur events for webview (#14344)
* fix: emit focus/blur events for webview

* test: webview can emit focus event
2018-08-28 13:35:44 -05:00
Robo
edd5c4b9bb fix: use OS process handle to clear object registry (#14324)
RenderProcessHost switch can happen between ipc calls when
speculative process are invvolved, which will lead to deletion
of entries on current context. Use OS process handles to
uniquely associate a destruction handler for a render process.
2018-08-28 13:32:46 -05:00
Milan Burda
28e4fcea3b refactor: move common logic to handleRemoteCommand 2018-08-27 21:06:03 +02:00
Milan Burda
f1fe485768 fix: don't expose desktopCapturer in sandboxed renderers if the feature is disabled (#14310) 2018-08-27 13:16:52 -05:00
Milan Burda
edd1eaee5c fix: don't expose view APIs when not enabled (#14312) 2018-08-27 08:03:46 +09:00
Milan Burda
c23e7fa101 refactor: implement ipcRenderer.sendTo in native code for better performance (#14285) 2018-08-24 14:14:39 -07:00
Cheng Zhao
6736d4ef29
fix: do not bubble up resize event from webview (#14271) 2018-08-23 15:42:35 +09:00
Cheng Zhao
cd8bb1d3b4
chore: print error when removed webview attribute is used (#14230)
* chore: print error when removed webview attribute is used

* docs: document removed webview features
2018-08-23 10:45:43 +09:00
Samuel Attard
7a514d26bb fix: inheritance of webPreferences sub properties 2018-08-22 11:16:46 -05:00
Milan Burda
fc85d02786 feat: expose missing process APIs in sandboxed renderers (#13505) 2018-08-21 11:05:45 -07:00
Troy
5ea05ddee7 fix: Stricter Testing For Menu Items (#13992)
This PR includes stricter testing for empty objects so that false context menus are not created along with the tests to ensure future compatibility.
2018-08-17 13:10:14 -07:00
Cheng Zhao
dd5b8769be fix: use OOPIF for webview tag (#13869)
* fix: use OOIF for webview tag

* fix: do not call GetNativeView for webview

* fix: OOIPF webview's WebContents is managed by embedder frame

* fix: guest view can not be focused

* fix: clear zoom controller when guest is destroyed

* fix: implement the webview resize event

The webview is no longer a browser plugin with the resize event, use
ResizeObserver instead.

* test: disable failed tests due to OOPIF webview

* fix: embedder can be destroyed earlier than guest

This happens when embedder is manually destroyed.

* fix: don't double attach

* fix: recreate iframe when webview is reattached

* fix: resize event may happen very early

* test: some tests are working after OOPIF webview

* chore: remove unused browser plugin webview code

* fix: get embedder via closure

When the "destroyed" event is emitted, the entry in guestInstances would be
cleared.

* chore: rename browserPluginNode to internalElement

* test: make the visibilityState test more robust

* chore: guestinstance can not work with OOPIF webview

* fix: element could be detached before got response from browser
2018-08-16 15:57:40 -07:00
Samuel Attard
5f7a595f0a chore: add FIXME for remote deref (#14116) 2018-08-15 09:06:44 -07:00
Samuel Attard
55a1f5d351 fix: add a hidden option to disable remote dereferencing (#14102) 2018-08-15 08:08:14 -07:00
Shelley Vohr
b785f45852
fix: override fs.realpathSync.native and fs.realpath.native (#14031)
* fix: override fs.realpathSync.native and fs.realpath.native
* spec: test new native functions
2018-08-12 00:10:55 -07:00
Shelley Vohr
8dae1c8447
fix: make asarStatsToFsStats nherit from fs.stats (#14030) 2018-08-11 23:20:33 -07:00
Milan Burda
702cc84bd3 Don't pass preloadPath via ELECTRON_BROWSER_SANDBOX_LOAD for security reasons (#13031) 2018-08-10 17:19:49 -05:00
Milan Burda
271d582aac refactor: make methods const, cleanup (#13937) 2018-08-09 10:15:23 -07:00
Milan Burda
9a1ad2b93f fix: ipcRemote.sendSync regression after moving away from JSON for return values (#13941) 2018-08-09 19:45:10 +10:00
Dominic
a7052efaf4 fix: make menu.popup options optional (#13977)
* add empty object as default param for options

* update docs

* add spec for optional options

* fix: add null check for options
2018-08-08 17:38:52 -05:00
Charles Kerr
29f07889e6
feat: add location url to "Node.js Integration with Remote Content" warning (#13973)
* docs: fix typo

* feat: add location url to Node+Remote warning
2018-08-07 20:40:21 -05:00
Milan Burda
c52b3d921e fix: some APIs modified for ASAR support cannot be util.promisify'ed (#13845) 2018-08-01 13:06:48 +10:00
Milan Burda
39c5c200ba fix: util.promisify(setTimeout) (#13840) 2018-07-30 11:14:04 +10:00