feat: split openExternal into sync and async (#16176)

* feat: split openExternal into sync and async

* v8::Locker => mate::Locker

* fix: enter js env when resolving promise
This commit is contained in:
Shelley Vohr 2019-01-14 20:35:21 -08:00 committed by GitHub
parent 52e257668d
commit 0881fd6397
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 135 additions and 55 deletions

View file

@ -34,21 +34,29 @@ Returns `Boolean` - Whether the item was successfully opened.
Open the given file in the desktop's default manner.
### `shell.openExternal(url[, options, callback])`
### `shell.openExternalSync(url[, options])`
* `url` String - Max 2081 characters on windows, or the function returns false.
* `url` String - Max 2081 characters on Windows, or the function returns false.
* `options` Object (optional)
* `activate` Boolean (optional) - `true` to bring the opened application to the
foreground. The default is `true`. _macOS_
* `workingDirectory` String (optional) - The working directory. _Windows_
* `callback` Function (optional) _macOS_ - If specified will perform the open asynchronously.
* `error` Error
Returns `Boolean` - Whether an application was available to open the URL.
If callback is specified, always returns true.
Open the given external protocol URL in the desktop's default manner. (For
example, mailto: URLs in the user's default mail agent).
Open the given external protocol URL in the desktop's default manner. (For example, mailto: URLs in the user's default mail agent).
### `shell.openExternal(url[, options])`
* `url` String - Max 2081 characters on windows.
* `options` Object (optional)
* `activate` Boolean (optional) - `true` to bring the opened application to the
foreground. The default is `true`. _macOS_
* `workingDirectory` String (optional) - The working directory. _Windows_
Returns `Promise<void>`
Open the given external protocol URL in the desktop's default manner. (For example, mailto: URLs in the user's default mail agent).
### `shell.moveItemToTrash(fullPath)`