Commit graph

916 commits

Author SHA1 Message Date
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
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
Milan Burda
db38c8b620 Fix process.execPath returning parent process path instead of the helper in sandboxed renderer (#13839) 2018-07-30 11:13:42 +10:00
Samuel Attard
4b3011f3e8 feat: add getUploadProgress API to the net API (#13783) 2018-07-27 07:15:48 -07:00
Cheng Zhao
3094f62f0b
fix: use webContentsId with contextId together (#13749)
After after using `processId-contextCounter` as contextId, it may happen
that contexts in different WebContents sharing the same renderer process
get the same contextId. Using webContentsId as part of key in
ObjectsRegistry can fix this.
2018-07-24 16:21:38 +09:00
Cheng Zhao
305e3aad40
refactor: remove private webContents.getId() API (#13674) 2018-07-23 18:08:36 +09:00
Cheng Zhao
9d6f1a372e
fix: create WebContents for webview on request (#13713) 2018-07-21 11:11:28 +09:00
Samuel Attard
ad9e64d086
fix: remove race condition for executeJavaScript (#13691)
Replaces 'did-finish-load' with 'did-stop-loading' which semantically
maps to the events inside Chromium.  Before I think we were relying
on a natural 99% winnable race condition.

Fixes #13504
2018-07-17 13:32:28 +10:00
Cheng Zhao
4cdb1b8fc3 fix double-freeing remote references
After the page does navigations, garbage collection can still happen in
the old context. This commit changes to store references to remote objects
by _pages_, instead of by _WebContents_.
2018-07-12 10:44:26 +09:00
Hari Juturu
eb223f8bc3 Enable webview in sandbox renderer (#13435)
* Enable webview in sandbox renderer
Security: Inherit embedder prefs onto webview

* cache lastwebprefs
2018-07-03 02:06:26 +10:00
Samuel Attard
92588be2bd refactor: add promise helper and change whenReady to be native impl (#13115)
* Add promise helper and change whenReady to be native impl

* remove commented code

* add GetInner helper to dedupe promise code

* add Promise.reject helper to be consistent with JS

* fix linting

* update promise impl per feedback

* remove param name from unused isolate

* Use non-depreceated resolvers for promises

* Add thread dchecks for promise helper, intiialize promise pointer to nullptr
2018-06-27 16:06:08 -05:00
Shelley Vohr
f9e2ec43d0
fix: deprecate properties in app.getAppMetrics() (#13446)
* fix: deprecate properties in app.getAppMetrics()

* address feedback from review

* fix deprecated property location

* simplify test
2018-06-26 23:47:01 -07:00
Milan Burda
08ccc2d624 refactor: rpc-server.js cleanup (#13420)
* refactor: don't declare variables C-style in JavaScript

* refactor: use new constructor(...args) in rpc-server.js
2018-06-27 11:00:05 +10:00
deepak1556
7b47d69efe Remove did-get-response-details and did-get-redirect-request events
https://chromium-review.googlesource.com/c/chromium/src/+/805008
https://chromium-review.googlesource.com/c/chromium/src/+/786320
2018-06-19 11:49:41 +10:00
Zhuo Lu
ab24a1e36d feat: netLog API for dynamic logging control (#13068)
* Introduce `net.{start|stop}Logging()`

- Slight regression right now as Electron won't automatically start logging net-logs at launch, will soon be fixed
- To implement callback for async controls

* Add `net.isLogging` & optional callback param for `net.stopLogging()`

* Fix small regression on --log-net-log

--log-net-log should work again

* Error on empty file path

* Only start with valid file path

* Remove unused var

* Allow setting log file path before URLRequestContextGetter starts logging

* Add net log tests

* Remove redundant checks

* Use brightray::NetLog

* Clean up code

* Should automatically stop listening

* 🎨 Attempt to fix styles

* Only run non-null callback

* Dump file to tmpdir

* Simplify net log spec

Spawned Electron process on Linux CI can fail to launch

* Separate netLog module

* Remove net logging test from net spec

* Add tests for netLog

* Fix header guard

* Clean up code

* Add netLog.currentlyLoggingPath

* Callback with filepath

* Add test for case when only .stopLogging() is called

* Add docs

* Reintroduce error on invalid arg

* Update copyright

* Update error message

* Juggle file path string types
2018-06-19 11:45:58 +10:00
Cheng Zhao
70e17b5f8f feat: add LabelButton API 2018-06-18 16:51:36 +09:00
Cheng Zhao
c8e8cb86ce feat: add Button API 2018-06-18 16:51:36 +09:00
Cheng Zhao
ba3700141f feat: add TextField API 2018-06-18 16:51:36 +09:00
Alexey Kuzmin
dee9aef975 Add "enable_desktop_capturer" build flag (#13133)
* Make it possible to disable a module for a renderer

* Put DesktopCapturer API under a build flag

The name is "enable_desktop_capturer".
Enabled by default.
2018-06-13 11:15:34 -05:00
Thiago de Arruda
6ff111a141 perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953)
* Don't use JSON to send the result of `ipcRenderer.sendSync`.

- Change the return type of AtomViewHostMsg_Message_Sync from `base::string16`
  to `base::ListValue`
- Adjust lib/browser/api/web-contents.js and /lib/renderer/api/ipc-renderer.js
  to wrap/unwrap return values to/from array, instead of
  serializing/deserializing JSON.

This change can greatly improve `ipcRenderer.sendSync` calls where the return
value contains Buffer instances, because those are converted to Array before
being serialized to JSON(which has no efficient way of representing byte
arrays).

A simple benchmark where remote.require('fs') was used to read a 16mb file got
at least 5x faster, not to mention it used a lot less memory.  This difference
tends increases with larger buffers.

* Don't base64 encode Buffers

* Don't allocate V8ValueConverter on the heap

* Replace hidden global.sandbox with NodeBindings::IsInitialized()

* Refactoring: check NodeBindings::IsInitialized() in V8ValueConverter

* Refactor problematic test to make it more reliable

* Add tests for NaN and Infinity
2018-06-13 17:38:31 +10:00
Charles Kerr
b89fe86fa1
Merge pull request #13050 from electron/3.0.0-deprecations
chore: removal of 3.0.0 deprecations
2018-05-30 09:25:36 +02:00
Milan Burda
4cfe5ecaa4 add proper support for typed arrays in remote (#13055) 2018-05-24 21:05:46 +09:00
Cheng Zhao
322bde526c Add LayoutManager/BoxLayout APIs 2018-05-24 15:36:29 +09:00
Shelley Vohr
5f5322c64e
rename blinkFeatures to enableBlinkFeatures 2018-05-23 14:01:34 -07:00
Shelley Vohr
bc10be3de6
rename exposed session method to setCertificateVerifyProc 2018-05-23 13:51:28 -07:00
Shelley Vohr
fb4a8e9cb9
remove ses.setCertificateVerifyProc() deprecation 2018-05-23 09:47:14 -07:00
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
Thiago de Arruda
6f076f7433 Refactor sandbox preload initialization. (#12877)
Use a single synchronous IPC call to retrieve data required by early
sandbox scripts. This has two purposes:

- Optimize preload script initialization by:
  - Using one synchronous IPC call to retrieve preload script,
  webContentsId (more on that later), process.{platform,execPath,env}
  - Lazy loading as many modules as possible.
- Fix #12316 for sandbox. @MarshallOfSound addressed the issue in
  #12342, but it was still present in sandbox mode. By loading
  webContentsId very early and skipping remote module at early
  startup, we fix it for sandbox.
2018-05-21 22:56:05 +10:00
Milan Burda
7c19ae302e replace isEventEmitter with instanceof EventEmitter (rpc-server) (#12998) 2018-05-21 10:00:56 +09:00
Milan Burda
5a5eb43359 detect EventEmitter in removeRemoteListenersAndLogWarning (#12975) 2018-05-18 11:09:25 +09:00
John Kleinschmidt
2b26206ea2
Merge pull request #12844 from didrocks/fix-communitheme-session
fix: support multiple inherited ubuntu session for indicators
2018-05-16 11:44:04 -04:00
Didier Roche
6feec2e2a5 Fix linting error
Thx @MarshallOfSound
2018-05-16 14:34:13 +02: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
Didier Roche
5df0fd9dc8 fix: more scalable code by factorizing appindicator support
- introduce a currentPlatformSupportsAppIndicator() function determining
  if app indicators are supported here.
- handle undefined process.env.XDG_CURRENT_DESKTOP
- added some comments to ensure that the intents are clear
Thanks MarshallOfSound
2018-05-14 11:00:41 +02: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
Didier Roche
811ae1a936 Support multiple inherited ubuntu session for indicators
Multiple sessions inherits the "ubuntu" base settings properties in ubuntu.
One of the most popular one is communitheme: the next ubuntu default theme
has its dedicated session, with thus duplicated indicators for dropbox.
Rather than a string comparison for ubuntu, only match a substring then.
XDG_CURRENT_DESKTOP can be of form: "communitheme:ubuntu:GNOME",
"ubuntu:GNOME", …
Fixes: #12843.
2018-05-07 11:49:37 +02: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
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
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
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
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
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
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
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
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
kaylie
3c64062f69 Replace custom function with Object.values() 2018-02-05 20:03:28 -08: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
Shelley Vohr
db6d84de74
don't inherit isBrowserView for spawned child windows 2018-02-01 00:09:37 -05: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
Cheng Zhao
bd271cffb9 Throw when inAppPurchase is used on unsupported platforms 2018-01-10 18:53:55 +09:00
Cheng Zhao
ac6f895f64 Turn InAppPurchase into an EventEmitter 2018-01-10 16:37:05 +09:00
Adrien Fery
b2542a27c3 Update code style 2018-01-10 13:14:18 +09:00
Adrien Fery
eb2520488f Adapt code style 2018-01-10 13:14:18 +09:00
Adrien Fery
f3ae566164 Add in-app purchase for MacOS 2018-01-10 13:14:18 +09:00
Zeke Sikelianos
eb89e12c5b
Merge pull request #11532 from sethlu/camelcase-menuitem-role
Make MenuItem roles camelCase-compatible
2018-01-04 09:53:58 -08:00
Samuel Attard
1553b54779
Add window.loadFile and webContents.loadFile helper methods 2018-01-04 11:38:56 +13:00
Cheng Zhao
46330ac2a9 Remove the closed event of Menu
The callback of Menu.popup does more things, and there is actually no
request for the closed event.
2018-01-01 17:22:07 +09:00
Cheng Zhao
73d78d345a Make callback work for old-style Menu.popup call
While the old-style Menu.popup has been deprecated, it is still being
used widely in apps and even in Electron itself.
2018-01-01 17:17:01 +09:00
Cheng Zhao
7b01a8b860 Add callback parameter to Menu.popup 2018-01-01 16:26:19 +09:00
Zhuo Lu
b8ec84c761 Fix syntax 2018-01-01 02:23:32 +08:00
Zhuo Lu
d45914c3f7 MenuItem roles camelCase-compatible 2017-12-28 13:28:20 +08:00
Kyle Corry
5aac091f40
Add Support for Pop!_OS GNOME Session
Similar to this PR: https://github.com/electron/electron/pull/10355 , Pop!_OS suffers from the same problem. Using Ubuntu AppIndicator will not show the icon currently unless the XDG_CURRENT_DESKTOP variable is modified. This commit will add support for pop so that this workaround is not needed. 

Ref: https://github.com/pop-os/pop/issues/84
2017-12-21 14:16:15 -05:00
Cheng Zhao
088042841d win: Correctly close popup menu 2017-12-21 15:26:32 +09:00
Cheng Zhao
e4770c7604 Coding style fixes 2017-12-20 18:48:09 +09:00
Heilig Benedek
c586806609 fix flash menu being unresponsive to commands 2017-12-20 15:40:07 +09:00
Felix Rieseberg
8166a64f98 🔧 Last round of feedback 2017-12-12 11:25:01 -08:00
Felix Rieseberg
c4ec8b4545 🔧 Feedback 2017-12-12 11:25:01 -08:00
Felix Rieseberg
5b7f7c8a1a 🔧 Menu returns its properties now 2017-12-12 11:25:01 -08:00
Felix Rieseberg
ffc54967e9 🔧 Fix value shift 2017-12-12 11:25:01 -08:00
Felix Rieseberg
99031834ff 🔧 Cleanup 2017-12-12 11:25:01 -08:00
Felix Rieseberg
3719ee0b53 🔧 Allow for menu.popup({}) 2017-12-12 11:25:01 -08:00
Felix Rieseberg
9e660b1d32 🔧 Always find a window (or error) 2017-12-12 11:25:01 -08:00
Felix Rieseberg
4f901c6d24 🔧 Oh wow, that looks wrong 2017-12-12 11:25:01 -08:00
Alexey Kuzmin
1c8eb03574
Revert "fix: Fix menu.popup() bugs" 2017-12-12 13:59:34 +03:00
Felix Rieseberg
927c63b477 🔧 Last round of feedback 2017-12-11 15:19:33 -08:00
Felix Rieseberg
89b90be6a2 🔧 Feedback 2017-12-11 14:43:35 -08:00
Felix Rieseberg
22e9d665d2 🔧 Menu returns its properties now 2017-12-11 14:03:01 -08:00
Felix Rieseberg
93b46116f4 🔧 Fix value shift 2017-12-11 13:30:35 -08:00
Felix Rieseberg
abd56eda6f 🔧 Cleanup 2017-12-08 14:40:51 -08:00
Felix Rieseberg
955564abd7 🔧 Allow for menu.popup({}) 2017-12-08 14:37:16 -08:00
Felix Rieseberg
bd6767fac6 🔧 Always find a window (or error) 2017-12-08 14:36:52 -08:00
Felix Rieseberg
38bb9baac5 🔧 Oh wow, that looks wrong 2017-12-08 14:36:29 -08:00
Felix Rieseberg
9646f0c99a 🔧 Sprinkle some ES6 across the file 2017-12-01 17:18:57 -08:00
Felix Rieseberg
c5abe96b39 🔧 Hide subprocess window 2017-12-01 17:18:37 -08:00
Cheng Zhao
b161a4f515
Merge pull request #11166 from sethlu/openrecent
feat: Recent documents menu item
2017-11-28 10:55:14 +09:00
Zhuo Lu
dcdc3621ac Rename roles 2017-11-27 17:26:22 +09:00
Zhuo Lu
5d44dbaf54 Redesign recent documents role API
- For more flexibility in designing the recent documents menu, now there can be one menu item (known issue: you may specify more but AppKit doens't display more than one) in the submenu list, rather than separating the labels with a tab.
- Also added is the role `clearrecent` that can be given to a menu item that can clear the recent documents.
2017-11-27 17:26:22 +09:00
Zhuo Lu
828d233f2a Rollback duplicated feature 2017-11-27 17:26:22 +09:00
Zhuo Lu
0b9cea334f Specify "Clear Menu" through label option
Like a bit of a hack right now, conforming to the existing menu item definition
2017-11-27 17:26:22 +09:00
Zhuo Lu
4da2eb9366 Introduce openrecent role
- Does not yet accept any options except label--"Clear Menu" can't be modified through exposed node API
- If `openrecent` is present across multiple menu items, the last seen will be visible in the main menu due to that it is designed to behave like a singleton
2017-11-27 17:26:22 +09:00
Zhuo Lu
f0bff74995 Add "Open Recent" submenu to default 2017-11-27 17:26:22 +09:00
Cheng Zhao
1c0ea0286e
Merge pull request #11235 from electron/standard-10
infra: Upgrade to StandardJS 10
2017-11-27 15:42:52 +09:00
Birunthan Mohanathas
4e859b4718 Remove "async" option from menu.popup()
All menus are async now. See "Cleanup MenuRunner API"
https://codereview.chromium.org/2790773002
2017-11-24 10:58:17 +09:00
Felix Rieseberg
f7d6e3fa7b 🔧 Disable standard/no-callback-literal where necessary 2017-11-23 13:53:03 -08:00
Felix Rieseberg
f81bfb7b86 🔧 Fix style issues 2017-11-23 13:42:48 -08:00
Charles Kerr
9c217fc6c7
Merge pull request #11224 from electron/browser-view-window
feature: Add `BrowserWindow.fromBrowserView()`
2017-11-23 14:41:36 +01:00
Felix Rieseberg
037f76c47b 🐛 Ooops, fix that 2017-11-22 17:07:57 -08:00
Felix Rieseberg
4d18cbe728 🔧 BrowserView.fromWebContents() 2017-11-22 16:59:00 -08:00
Felix Rieseberg
7630ac6e90 🔧 Return null if not found 2017-11-22 15:48:11 -08:00
Felix Rieseberg
8c5aad8b17 🔧 Add BrowserWindow.fromBrowserView() 2017-11-22 14:36:54 -08:00
Felix Rieseberg
05bae0b4c4 🔧 Util is no longer used here 2017-11-20 09:52:13 -08:00