Commit graph

1131 commits

Author SHA1 Message Date
Shelley Vohr
daf75dd375
add app.isPackaged (#12656)
* add isPackaged method

* add false test case for app.isPackaged()

* document add.isPackaged()

* check isPackaged() without fs call

* convert to non-method property

* document app.isPackaged as a property

* update tests for app.isPackaged

* remove unused fs require

* clarify docs for isPackaged()
2018-05-07 23:15:31 -07:00
biuuu
86d023b02f fix: listeners out of limit warning (#12841)
When the Chrome Extension has too many content scripts (above default
10 counts), there will be a warning: possible EventEmitter memory leak
detected. 11 listeners added.
2018-05-08 14:10:11 +09:00
Samuel Attard
5b5c161601
feat: new makeSingleInstance API (#12782)
* Refactor app.makeSingleInstance
* new API `app.isPrimaryInstance()`
* new API `app.isSingleInstance()`
* new event `app.on('second-instance')`
* deprecated old syntax `app.makeSingleInstance(cb)`
* deprecated old syntax of `app.makeSingleInstance() --> bool` in favor
of `app.isPrimaryInstance()`
* Fix spec, we don't need process.nextTick hacks any more
* Make deprecation TODO for the return value of makeSingleInstance
* Refactor makeSingleInstance to requestSingleInstanceLock and add appropriate deprecation comments
* I swear this isn't tricking the linter
* Make const
* Add deprecation warnings for release, and add to planned-breaking-changes

BREAKING CHANGE
2018-05-08 01:29:18 +10:00
Shelley Vohr
9c8952aef0
Add menu item order control (#12362)
Add four new optional properties to menus in Electron. The four properties are:
'before'
'after'
'beforeGroupContaining'
'afterGroupContaining'

'before/after' - provides a means for a single context menu item to declare its placement relative to another context menu item. These also imply that menu item in question should be placed in the same “group” as the item.

'beforeGroupContaining/afterGroupContaining - provides a means for a single menu item to declare the placement of its containing group, relative to the containing group of the specified item.
2018-05-05 09:37:29 -07:00
Milan Burda
48fe013549 Expose events (EventEmitter) to sandboxed renderer (#12828) 2018-05-04 09:51:32 -07:00
Shelley Vohr
f67c625e6a
don't filter out invisible menu separators (#12825) 2018-05-04 07:59:40 -07:00
Milan Burda
9b56ca3961 Fix optimizeSimpleObject for arrays of objects (#12815) 2018-05-03 22:34:30 -05:00
bughit
55a7f6f0ce add did-frame-navigate event to WebContents (#12723)
* add did-frame-navigate event to WebContents, pass http response code to it and did-navigate

* docs for frame routing id related api changes on WebFrame and WebContents
2018-05-01 13:34:41 +09:00
bughit
4fcd178c36 expose WebFrame#routingId (#12614)
* expose WebFrame#routingId and pass it to WebContents frame specific events along with frameProcessId; add WebContets.did-start-navigation event
* fix compilation error on ia32 Windows
2018-04-26 19:17:55 +09:00
Shelley Vohr
7c4964fae6
revert to more graceful template structure check (#12699) 2018-04-24 11:21:26 -04:00
Tatsuya Hiroishi
9c65abd746 handle remote exception (#12694)
* add cause property to exception in callFunction

* update exceptionToMeta function

* add sender argument
* and cause property to return value

* update exception convert in metaToValue function

* add from and cause properties to the exception error

* unit test for remote exception
2018-04-24 08:40:19 -04:00
Nitish Sakhawalkar
2579071b98 Deprecate did-get-response-details and did-get-redirect-request (#12615)
* Deprecate webContents events did-get-response-details and did-get-redirect-request.

* Update guest view files

* Update webview tag docs and update specs

* Update deprecate.event function

* Update comment

* Update more

* Update documentation for other deprecated event
2018-04-23 14:46:12 -05:00
Alexey Kuzmin
fcc82ebd35 Add "app.whenReady()" (#12652)
* Make "chai-as-promised" avaialble in tests

* Add "app.whenReady()"

Closes #9561.
2018-04-20 17:09:23 +10:00
Cheng Zhao
7473b612c5 Make Menu API accept TopLevelWindow 2018-04-19 13:08:37 +09:00
Cheng Zhao
1340b17424 Do not return TopLevelWindow in BrowserWindow.getAllWindows 2018-04-19 13:08:37 +09:00
Cheng Zhao
e38f511737 Make BrowserWindow inheirt TopLevelWindow in JS 2018-04-19 13:08:37 +09:00
Cheng Zhao
71ebd99dfa Expose TopLevelWindow to JavaScript 2018-04-19 13:08:36 +09:00
Samuel Attard
7cc3b877dc Fix event leak on reuse of touchbar item (#12527)
* fix event leak on reuse of touchbar item

* Clean up child touch bar item event listeners and escape item listeners
2018-04-15 10:24:47 -05:00
Jeremy Apthorp
97fb15ac49 Enable WebFrame method forwarding in sandboxed renderers (#12538)
* Enable WebFrame method forwarding in sandboxed renderers

Fixes #9073

* Non-change to kick CI
2018-04-12 11:57:40 +10:00
Andrew MacDonald
6bfb122cd1 Add a display_id parameter to the desktopCapturer API. (#12417)
* Add a screen_api_id parameter to the desktopCapturer API.

When using the DirectX capturer on Windows, there was previously no way
to associate desktopCapturer/getUserMedia and electron.screen API
screens. This new parameter provides the association.

* Fix non-Windows build.

* Fix Mac.

* Fix Mac harder.

* JS lint

* clang-format C++ code.

* IWYU

* display_id, Linux comment, better test

* lint

* Fix tests on Linux.

* Add display_id documentation.
2018-04-09 14:43:35 +09:00
Robo
89f2eb1023 asar: remove patch to support graceful-fs (#12562) 2018-04-07 10:13:32 -05:00
Nitish Sakhawalkar
970f79e32f Check for devtools in BrowserWindow.getFocusedWindow() (#12526) 2018-04-06 09:21:32 -04:00
Jeremy Apthorp
f0d08f4da1 Propagate referrer to new windows (#12397)
* Propagate referrer to new windows

Fixes #9205

* Rearrange -new-window event arguments for backwards-compatibility

* Plumb referrer policy through guest-window-manager

* Document the Referrer structure and its uses

* Add tests for referrer in new windows

* Docs nits
2018-04-05 18:13:24 -05:00
Charles Kerr
1a649a6ac3
Handle in-app-purchase less fatally on non-Darwin (#12511)
Fixes #12311

Right now it throws a new error when the file is even require()d, but this isn't ideal as there are cases where everything is mass-required, such as Spectron. Instead, we should throw an error on non-Darwin environments only when the IAP methods are invoked.
2018-04-02 18:55:44 -05:00
Shelley Vohr
a677c22e1f
re-enable null check against menu item accelerators (#12449) 2018-03-27 20:32:55 -04:00
Nitish Sakhawalkar
9d1527b1df Fix context menu for sandbox devtools (#11933) 2018-03-22 16:15:57 +09:00
Samuel Attard
0ac883c6d4
Remove the race condition between new process creation and context release (#12342)
* Remove the race condition between new process creation and old process releasing remote context

Previously there was a race condition where the getId() method would return the new context ID even
though the release was for the old context.  This changes it to send the "initial" context ID with
the release message to ensure there is no race.

* fetch context ID from remote in sandbox mode
2018-03-20 15:54:47 +11:00
Shelley Vohr
31d688ad3d
Check menu.popup options are an object (#12325)
* check menu.popup options are an object

* Add a spec for menu.popup options check

* remove stray .only
2018-03-17 06:31:10 +09:00
Felix Rieseberg
243ab45111 🔧 Fix security warning (#12309) 2018-03-16 06:21:38 +09:00
Samuel Attard
4b476f13bb Revert "Fixes electron/electron#12147" (#12293)
* Revert "Set appropriate defaults for webview options (#12271)"

This reverts commit c2673aa970.

* Revert "Fixes electron/electron#12147 (#12193)"

This reverts commit f54c94d6c9.
2018-03-15 16:18:36 +09:00
Charles Kerr
c2673aa970 Set appropriate defaults for webview options (#12271)
* Persist defaults to webPreferences object to JS land can read the inferred values instead of just user defined values

* Test inherited default propogation

* Refactor to remove coupling from fetching values and defaults

* Test description type

* Fix up tests
2018-03-15 13:56:46 +09:00
nous-
f54c94d6c9 Fixes electron/electron#12147 (#12193) 2018-03-15 13:29:32 +09:00
Shelley Vohr
9aeb61181a Fix require on network share path (#12282)
* first pass at server/network require fix

* refactor for clarity
2018-03-15 11:45:13 +09:00
Hari Juturu
704af29543 Exposing process.env status (#12166) 2018-03-14 12:01:40 +09:00
Felix Rieseberg
582ef30b4a 👷 Tests, how do they work 2018-03-13 17:35:55 -07:00
Felix Rieseberg
72579f9bab 🔧 Sort crashes 2018-03-13 13:57:12 -07:00
Samuel Attard
8e07e7483f
Merge pull request #12228 from electron/fix-window-open-not-showing
Parent's visibility trumps inherited 'show' option
2018-03-13 17:41:00 +09:00
Charles Kerr
e400585a0e Apply further ES6 bikeshedding 2018-03-13 17:09:47 +09:00
Charles Kerr
2d90e763ad Use idiomatic ES6 when merging options 2018-03-13 16:23:39 +09:00
Charles Kerr
379bd79de4 Remove unnecessary work when merging options 2018-03-13 16:18:50 +09:00
Felix Rieseberg
71795ecc62 fix: Incorrect warnings in webviews (#12234)
* 🔧 Get correct webContents

* 🔧 Err, webPreferences
2018-03-13 10:55:32 +09:00
Charles Kerr
685948bcaa Parent's visibility trumps inherited 'show' option 2018-03-13 00:28:34 +09:00
Samuel Attard
795447f61a Implement dialog (alert/confirm) blocking as a user switch after the first dialog
* This is to enable more browser-like behavior so that users who run third-party code
  will not be DOS'ed with alerts and confirms.  This is already handled like this
  in most major browsers so this will greatly help these developers
2018-03-06 11:19:15 +09:00
Shelley Vohr
199cf31b9e
deprecate screen.getMenuBarHeight 2018-03-05 19:45:51 -05:00
Cheng Zhao
35cbe9d140 Fix dockMenu not being referenced in JavaScript (#12062)
* Fix dockMenu not being referenced in JavaScript

* spec: Test garbage collecting dock menu
2018-02-26 22:15:06 -08:00
shelley vohr
18362eb948 improve Menu and MenuItem testing (#12015)
* split menu/menuitem and add some tests

* fix ipc send issue

* feedback: make tests less brittle

* clean up MenuItem accelerator and label tests
2018-02-23 07:53:59 -06:00
John Kleinschmidt
2a97e48465
Merge pull request #11968 from electron/refactor-menu-popup
Refactor menu.popup
2018-02-21 14:29:52 -05:00
shelley vohr
0ef8f1bdad Add deprecation warnings fot html/rtf methods (#11995) 2018-02-21 06:53:48 -06:00
shelley vohr
772a69e24a deprecate autoSubmit in favor of uploadToServer (#11992) 2018-02-20 22:31:48 -06:00
shelley vohr
193febd18c deprecate boolean highlightMode param (#11993)
* deprecate boolean highlightMode param

* add process.noDeprecations check

* fix native method override

* add todo
2018-02-20 22:30:32 -06:00