Return boolean instead of empty string when error occurs. Update docs

This commit is contained in:
Samuel Attard 2016-08-18 18:02:13 +10:00
parent 88bf089504
commit ca971e978e
No known key found for this signature in database
GPG key ID: 273DC1869D8F13EF
2 changed files with 24 additions and 18 deletions

View file

@ -454,7 +454,7 @@ Clears the recent documents list.
app to handle `electron://` links, call this method with `electron` as the
parameter.
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
* `args` Array (options) _Windows_ - Defaults to an empty array
* `args` Array (optional) _Windows_ - Defaults to an empty array
This method sets the current executable as the default handler for a protocol
(aka URI scheme). It allows you to integrate your app deeper into the operating
@ -462,7 +462,7 @@ system. Once registered, all links with `your-protocol://` will be opened with
the current executable. The whole link, including protocol, will be passed to
your application as a parameter.
On windows you can provide optional parameters path, the path to your executable,
On Windows you can provide optional parameters path, the path to your executable,
and args, an array of arguments to be passed to your executable when it launches.
Returns `true` when the call succeeded, otherwise returns `false`.
@ -474,18 +474,22 @@ Please refer to [Apple's documentation][CFBundleURLTypes] for details.
The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally.
### `app.removeAsDefaultProtocolClient(protocol)` _macOS_ _Windows_
### `app.removeAsDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_
* `protocol` String - The name of your protocol, without `://`.
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
* `args` Array (optional) _Windows_ - Defaults to an empty array
This method checks if the current executable as the default handler for a
protocol (aka URI scheme). If so, it will remove the app as the default handler.
Returns `true` when the call succeeded, otherwise returns `false`.
### `app.isDefaultProtocolClient(protocol)` _macOS_ _Windows_
### `app.isDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_
* `protocol` String - The name of your protocol, without `://`.
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
* `args` Array (optional) _Windows_ - Defaults to an empty array
This method checks if the current executable is the default handler for a protocol
(aka URI scheme). If so, it will return true. Otherwise, it will return false.