Commit graph

508 commits

Author SHA1 Message Date
Shelley Vohr
4a90056462
remove webContents.openDevTools() deprecation 2018-05-23 09:30:15 -07:00
Shelley Vohr
003a5a0160
remove tray.setHighlightMode() deprecation 2018-05-23 09:20:39 -07:00
Shelley Vohr
72c63a10ee
remove screen.getMenuBarHeight() deprecation 2018-05-23 09:11:48 -07:00
Cheng Zhao
bb2715e7a5 feat: add TopLevelWindow.setContentView API 2018-05-15 14:12:47 +09:00
Cheng Zhao
5a320222e2 feat: add WebContentsView API 2018-05-15 14:03:21 +09:00
Cheng Zhao
e058d11657 feat: add View API 2018-05-15 14:03:21 +09:00
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
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
Shelley Vohr
f67c625e6a
don't filter out invisible menu separators (#12825) 2018-05-04 07:59:40 -07:00
Shelley Vohr
7c4964fae6
revert to more graceful template structure check (#12699) 2018-04-24 11:21:26 -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
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
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
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
nous-
f54c94d6c9 Fixes electron/electron#12147 (#12193) 2018-03-15 13:29:32 +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
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
shelley vohr
719e5a93b4 deprecation for webContents.openDevTools (#11986)
* deprecate old openDevTools param

* add deprecation check and existence check

* fix method issues
2018-02-20 22:30:02 -06:00
Charles Kerr
f59d078eea Use more idiomatic JS in WebContents' init() 2018-02-20 19:20:11 -06:00
Charles Kerr
9c56b81b71 Throw an error if menu.popup() has no window 2018-02-20 18:38:05 -06:00
Charles Kerr
5a25b88b50 Fix browserWindow detection in menu.popup() 2018-02-20 18:35:39 -06:00
Charles Kerr
708f39a1a5 update a few menu.popup() calls to use the new API 2018-02-20 14:02:24 -06:00
Shelley Vohr
5065e159f1
positionItem => positioningItem 2018-02-20 11:28:34 -05:00
Cheng Zhao
dc62e51ba4 Fix the cyclic reference in menu delegate (#11967)
* Fix the cyclic reference in menu delegate

* Fix menu tests due to delegate change
2018-02-20 10:11:35 -06:00
Shelley Vohr
fb7fb4972d
options all the things 2018-02-20 11:10:53 -05:00
Shelley Vohr
211b542ae4
remove setZoomLevelLimits 2018-02-20 08:57:48 -05:00
Shelley Vohr
56f06187d5
forgot to remove old method 2018-02-19 21:03:10 -05:00
Shelley Vohr
6e11a3e53d
add restructured window.popup 2018-02-19 20:59:27 -05:00
Shelley Vohr
cd9e7142e4
add conditional for menu.popup(window, callback) 2018-02-19 13:06:37 -05:00
Samuel Attard
a20b379f26 fix windows tests 2018-02-16 16:02:10 +11:00
Samuel Attard
6318cd781d Update to use Squirrel.Mac that supports CDN releases 2018-02-15 14:00:46 +11:00
acheronfail
d1d50a4c92 Implement App-Scoped Security scoped bookmarks (#11711)
* implementation of security scoped bookmarks

* option is now only available on mas builds
2018-02-12 13:25:06 -05:00
Samuel Attard
66b57858b8 Fix child touch bar items not updating (#11812)
* Fix child touch bar items not updating

Deep children of a TouchBar didn't cause the top level touch bar to update, now they do

Fixes #11761.

* Remove unused newValue property in TB setter
2018-02-12 12:53:04 -05:00
shelley vohr
5240352326 Remove extra menu separators (#11827)
* add function to remove leading/trailing separators

* change const  name for clarity

* add spec to check filtered separators

* clean method and add edge case spec per review
2018-02-05 11:55:12 -06:00
Cheng Zhao
8ae3d9dd0b Simplify the public PowerObserver interface 2018-02-05 15:28:58 +09:00
Thiago de Arruda
56b53e71aa Implement powerMonitor 'shutdown' event for Linux.
The event is emitted when the OS is rebooting/shutting down, and allows
an electron app to call `e.preventDefault()` in order to delay shutdown
and exit cleanly.
2018-02-05 15:21:31 +09:00
Samuel Attard
32a1395bcf
Merge pull request #11565 from electron/add-load-file-helper
Add window.loadFile and webContents.loadFile helper methods
2018-01-23 09:08:23 +11:00