Commit graph

2424 commits

Author SHA1 Message Date
Milan Burda
6609138959 feat: add webContents 'zoom-changed' event (#17747) 2019-05-14 09:40:40 +03:00
Milan Burda
3a5e6f2551 feat: allow setting working directory in app.setUserTasks() / app.setJumpList() (#18148) 2019-05-13 19:17:12 +03:00
Cheng Zhao
8de9ba6df6
chore: run protocol tests in separate WebContents (#18202) 2019-05-10 09:51:44 +09:00
Milan Burda
019b31d084 chore: remove deprecated APIs (#18159) 2019-05-09 14:48:10 -04:00
Shelley Vohr
b3fcc080d5
fix: destroy tray on current tick (#18196)
This code was originally added in #6448 to handle an edge case crash in 10.9, and we no longer support 10.9 and therefore no longer need to account for this case.

It addressed the crash, but also created a race condition whereby when a new tray is created the old tray's destroy wouldn't have been fully completed and therefore a new one would be spawned. This fixes that by destroying the tray on the current tick once more.
2019-05-08 15:40:30 -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
Cheng Zhao
237f74a01f
feat: migrate protocol module to NetworkService (Part 5) (#18170)
* fix: always have head.headers available

* fix: use StringDataPipeProducer to write string

It can handle large strings correctly.

* fix: override RegisterNonNetworkSubresourceURLLoaderFactories

* fix: add dummy uninterceptProtocol implementation

* fix: jquery error handler can pass empty string

For some errors jquery would pass empty string in the error handler,
which makes tests pass when they should fail.

* chore: fix cpplint warnings

* fix: guard RegisterNonNetworkSubresourceURLLoaderFactories call

It may be called even when NetworkService is not enabled.

* test: disable protocol.interceptHttpProtocol test
2019-05-07 11:33:05 +09: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
Samuel Attard
aebad6fd21
test: remove stray console.log for test suite (#18078) 2019-04-30 17:56:20 -07:00
Samuel Attard
67b3fbca89
fix: ensure the inspector agent is shutdown before cleaning up the node env (#18028)
* fix: ensure the inspector agent is shutdown before cleaning up the node env

* spec: add tests to ensure clean shutdown with connected inspector agent

* Update node_debugger.cc
2019-04-30 15:44:40 -07:00
Samuel Attard
98c51dd660
build: ensure consistent lock files across multiple machines (#17955)
* build: ensure consistent package-lock across multiple machines

* build: fix linting errors and use npm ci instead of npm install

* build: use a yarn.lock and yarn instead of package-lock and npm

* chore: replace package-lock.json files with yarn.lock

* chore: replace last instance of `npm install`
2019-04-30 13:59:47 -07: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
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
Jeremy Apthorp
93d9dafacc
refactor: migrate cookie api to network service (#17932) 2019-04-24 12:49:30 -07:00
Electron Bot
716cb28430 chore: bump chromium to 1e9f9a24aa12 (master) (#17880)
* chore: bump chromium in DEPS to 1e9f9a24aa12bea9cf194a82a7e249bd1242ec4f

* chore: update patches

* Make WebContents' theme color a base::Optional<SkColor>

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

* update autofill patch for incorrect header includes

* Move Shell messages to web_test and rename to BlinkTest.

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

* Make PlatformNotificationServiceImpl a KeyedService.

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

* Move MediaPlayerId to its own file.

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

* Remove net/base/completion_callback.h, which is no longer used

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

* AW NS: support file scheme cookies

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

* Remove SecurityInfo and adapt remaining consumers

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

* Remove deprecated type-specific number to string conversion functions

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

* DevTools: Adding new performance histograms for launch of top 4 tools

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

* Update include paths for //base/hash/hash.h

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

* build: Disable ensure_gn_version gclient hook for mac CI checkout

* update patches

* use maybe version of v8::String::NewFromTwoByte

* bump appveyor image version

* fix mac ci hopefully

* Convert enum to enum class for MenuAnchorPosition

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

* use maybe version of ToObject

* RenderViewHost::GetProcess is no longer const

* Unrefcount AuthChallengeInfo

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

* MenuButtonController takes Button rather than MenuButton

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

* add //ui/views_bridge_mac to deps to fix link error

* forward declare views::Button in atom::MenuDelegate

* more v8 patches

* base/{=> hash}/md5.h

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

* gfx::{PlatformFontWin => win}::*

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

* fix v8 patches

* [base] Rename TaskScheduler to ThreadPool

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

* use internal_config_base for bytecode_builtins_list_generator

avoids windows link errors

* FIXME: temporarily disable v8/breakpad integration

* FIXME: temporarily disable prevent-will-redirect test

* FIXME: disable neon on aarch64 pending crbug.com/953815

* update to account for WebCursor refactor

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

* enable stack dumping on appveyor

* Revert "FIXME: disable neon on aarch64 pending crbug.com/953815"

This reverts commit 57f082026be3d83069f2a2814684abf4dc9e7b53.

* fix: remove const qualifiers to match upstream

* fix: remove const qualifiers to match upstream in cc files as well

* don't throw an error when testing if an object is an object

* use non-deprecated Buffer constructor

* Remove net::CookieSameSite::DEFAULT_MODE enum value

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

* depend on modded dbus-native to work around buffer deprecation

https://github.com/sidorares/dbus-native/pull/262

* revert clang roll to fix arm build on linux

* fixup! depend on modded dbus-native to work around buffer deprecation

need more coffee

* update coffee-script

* robustify verify-mksnapshot w.r.t. command-line parameters

* Revert "robustify verify-mksnapshot w.r.t. command-line parameters"

This reverts commit a49af01411f684f6025528d604895c3696e0bc57.

* fix mksnapshot by matching args

* update patches

* TMP: enable rdp on appveyor

* Changed ContentBrowserClient::CreateQuotaPermissionContext() to return scoped_refptr.

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

* Make content::ResourceType an enum class.

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

* fixup! Make content::ResourceType an enum class.

* turn off rdp

* use net::CompletionRepeatingCallback instead of base::Callback<void(int)>

* remove disable_ensure_gn_version_gclient_hook.patch

* copy repeating callback instead of std::move

* fix lint

* add completion_repeating_callback.h include
2019-04-20 10:20:37 -07:00
Heilig Benedek
81bf15877f fix: port OSR code to new viz compositor codepath (#17538)
* fix: make OSR work with viz compositor

* fix: update OSR patch

* fix: update patch again

* fix: update viz_osr.patch for macOS

* fix: gn check warnings

* chore: no need to change SoftwareOutputDeviceWinProxy

* chore: add check in case we missed something

* fix: consider scale factor when compare size

* fix: make GPU OSR work

* fix: autofill popups with OSR

* chore: use UNIX line ending for osr_video_consumer

* chore: code is already in defined(OS_MACOSX)

* fix: share same OSR implementation on macOS

This should also fix the crash when there is navigation on macOS.

* test: osr window should not crash after navigation

* fix: make osr work on Mac properly

* fix: software osr on windows

* fix: software osr on Linux

* fix: compilation error introduced with rebase

* fix: split local surface id allocation into two

* Update osr_host_display_client_mac.mm

* chore: update copyright year

* fix: update patch
2019-04-17 14:10:04 -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
be6fb7cb12 fix: ensure the sandboxed preloads globals do not leak (#17712) 2019-04-16 10:57:02 -07:00
Shelley Vohr
2b9bd0f56f
fix crash when passing empty string to recording (#17698) 2019-04-05 11:19:06 -07:00
Shelley Vohr
c4020308c9
test: remove non-applicable processMemoryInfo specs (#17679) 2019-04-05 07:53:25 -07: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
Cheng Zhao
ac30185a04 fix: the callback of beginFrameSubscription should pass NativeImage instead of Buffer (#17548)
* Revert "revert: frame subscriber deprecation and re-enable tests"

This reverts commit f643ce4f66.

* fix: make sure SkBitmap's pixels are copied
2019-04-04 11:36:12 -07:00
Milan Burda
77d59e99b6 feat: emit process 'loaded' event in sandboxed renderers (#17680) 2019-04-04 11:35:06 -07:00
Samuel Attard
59e3164206
build: ensure runner is defined inside the spec callback (#17664) 2019-04-02 18:25:45 -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
Jeremy Apthorp
7c6cedb119
test: de-flake getAllWebContents test by moving it to spec-main (#17610) 2019-04-01 18:28:11 -07:00
Samuel Attard
b8dbe4bc15
spec: add tests for the autoUpdater on macOS that actually test if it works (#17442)
* spec: add tests for the autoUpdater on macOS that actually test if it works

* spec: add express as dep

* spec: add logic to auto-trust self-signed certificate and not run autoupdate specs on MAS

* build: fix the step name for importing the codesign cert

* chore: update updater spec PR as per feedback

* fix: s/atomBinding/electronBinding

* build: use spawn instead of exec
2019-03-29 17:32:52 -07:00
Milan Burda
8cf15cc931 feat: only allow bundled preload scripts (#17308) 2019-03-28 11:38:51 +01:00
Milan Burda
546466b209 feat: add <webview>.getWebContentsId() (#17407) 2019-03-26 10:57:27 +09:00
Milan Burda
95df531b33 fix: add missing buffer size check in nativeImage (#17465) 2019-03-26 10:13:39 +09:00
Cheng Zhao
49f13e38f9 fix: close context menu before popup (#17474) 2019-03-21 21:56:22 -07:00
Cheng Zhao
671533f7d2 fix: check the result when calling js function (#17443)
* fix: check the result when calling js function

* test: should not crash when callback returns nothing
2019-03-20 08:27:06 -07:00
Shelley Vohr
1d93bc76cd feat: expose colorSpace to display object (#17405)
* feat: expose colorSpace to display object

* update doc

* add a spec
2019-03-19 15:12:03 -07:00
Milan Burda
4c51fa93f5 feat: add systemPreferences.getAnimationSettings() (#17382) 2019-03-19 12:15:40 -07:00
Milan Burda
4d8e024b6d spec: fix isEmpty() checks in nativeImage tests (#17441) 2019-03-19 12:13:15 -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
53f4af7722 fix: regressions introduced by adding world isolation to Chrome extension content scripts (#17422) 2019-03-19 14:45:48 +01:00
Shelley Vohr
2fb9085e5b
feat: add tray.getTitle() (#17385)
* feat: add tray.getTitle

* fix spec
2019-03-18 12:40:34 -07:00
Shelley Vohr
38d75010c7
chore: rename atomBinding to electronBinding (#17419) 2019-03-18 12:37:06 -07:00
Samuel Attard
5025c991ee
fix: pass the correct HostPort into the node inspector (#17380)
Fixes #17348
2019-03-18 09:19:33 -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
Samuel Attard
108545e416
spec: add new test runner for main-process based tests (#17325) 2019-03-17 14:49:00 -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
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
Samuel Attard
be60f93bd0
fix: we can not use ts-node apaprently 2019-03-14 13:39:53 -07:00
Samuel Attard
46e5767527
update for PR feedback 2019-03-14 13:18:16 -07:00