Граф коммитов

1233 Коммитов

Автор SHA1 Сообщение Дата
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 396b179948.
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