Replace OS X and Mac OS with macOS
This commit is contained in:
parent
52350b5e35
commit
67dd19ed0f
157 changed files with 650 additions and 650 deletions
|
@ -13,14 +13,14 @@ Examples:
|
|||
## Platform notice
|
||||
|
||||
On Linux and Windows, the `Command` key does not have any effect so
|
||||
use `CommandOrControl` which represents `Command` on OS X and `Control` on
|
||||
use `CommandOrControl` which represents `Command` on macOS and `Control` on
|
||||
Linux and Windows to define some accelerators.
|
||||
|
||||
Use `Alt` instead of `Option`. The `Option` key only exists on OS X, whereas
|
||||
Use `Alt` instead of `Option`. The `Option` key only exists on macOS, whereas
|
||||
the `Alt` key is available on all platforms.
|
||||
|
||||
The `Super` key is mapped to the `Windows` key on Windows and Linux and
|
||||
`Cmd` on OS X.
|
||||
`Cmd` on macOS.
|
||||
|
||||
## Available modifiers
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ The `app` object emits the following events:
|
|||
### Event: 'will-finish-launching'
|
||||
|
||||
Emitted when the application has finished basic startup. On Windows and Linux,
|
||||
the `will-finish-launching` event is the same as the `ready` event; on OS X,
|
||||
the `will-finish-launching` event is the same as the `ready` event; on macOS,
|
||||
this event represents the `applicationWillFinishLaunching` notification of
|
||||
`NSApplication`. You would usually set up listeners for the `open-file` and
|
||||
`open-url` events here, and start the crash reporter and auto updater.
|
||||
|
@ -73,7 +73,7 @@ Returns:
|
|||
|
||||
Emitted when the application is quitting.
|
||||
|
||||
### Event: 'open-file' _OS X_
|
||||
### Event: 'open-file' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
|
@ -92,7 +92,7 @@ You should call `event.preventDefault()` if you want to handle this event.
|
|||
On Windows, you have to parse `process.argv` (in the main process) to get the
|
||||
filepath.
|
||||
|
||||
### Event: 'open-url' _OS X_
|
||||
### Event: 'open-url' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
|
@ -104,7 +104,7 @@ must be registered to be opened by your application.
|
|||
|
||||
You should call `event.preventDefault()` if you want to handle this event.
|
||||
|
||||
### Event: 'activate' _OS X_
|
||||
### Event: 'activate' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
|
@ -114,7 +114,7 @@ Returns:
|
|||
Emitted when the application is activated, which usually happens when the user
|
||||
clicks on the application's dock icon.
|
||||
|
||||
### Event: 'continue-activity' _OS X_
|
||||
### Event: 'continue-activity' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
|
@ -314,14 +314,14 @@ app.exit(0)
|
|||
|
||||
### `app.focus()`
|
||||
|
||||
On Linux, focuses on the first visible window. On OS X, makes the application
|
||||
On Linux, focuses on the first visible window. On macOS, makes the application
|
||||
the active app. On Windows, focuses on the application's first window.
|
||||
|
||||
### `app.hide()` _OS X_
|
||||
### `app.hide()` _macOS_
|
||||
|
||||
Hides all application windows without minimizing them.
|
||||
|
||||
### `app.show()` _OS X_
|
||||
### `app.show()` _macOS_
|
||||
|
||||
Shows application windows after they were hidden. Does not automatically focus
|
||||
them.
|
||||
|
@ -343,7 +343,7 @@ You can request the following paths by the name:
|
|||
* `appData` Per-user application data directory, which by default points to:
|
||||
* `%APPDATA%` on Windows
|
||||
* `$XDG_CONFIG_HOME` or `~/.config` on Linux
|
||||
* `~/Library/Application Support` on OS X
|
||||
* `~/Library/Application Support` on macOS
|
||||
* `userData` The directory for storing your app's configuration files, which by
|
||||
default it is the `appData` directory appended with your app's name.
|
||||
* `temp` Temporary directory.
|
||||
|
@ -403,20 +403,20 @@ Returns the current application locale.
|
|||
|
||||
**Note:** On Windows you have to call it after the `ready` events gets emitted.
|
||||
|
||||
### `app.addRecentDocument(path)` _OS X_ _Windows_
|
||||
### `app.addRecentDocument(path)` _macOS_ _Windows_
|
||||
|
||||
* `path` String
|
||||
|
||||
Adds `path` to the recent documents list.
|
||||
|
||||
This list is managed by the OS. On Windows you can visit the list from the task
|
||||
bar, and on OS X you can visit it from dock menu.
|
||||
bar, and on macOS you can visit it from dock menu.
|
||||
|
||||
### `app.clearRecentDocuments()` _OS X_ _Windows_
|
||||
### `app.clearRecentDocuments()` _macOS_ _Windows_
|
||||
|
||||
Clears the recent documents list.
|
||||
|
||||
### `app.setAsDefaultProtocolClient(protocol)` _OS X_ _Windows_
|
||||
### `app.setAsDefaultProtocolClient(protocol)` _macOS_ _Windows_
|
||||
|
||||
* `protocol` String - The name of your protocol, without `://`. If you want your
|
||||
app to handle `electron://` links, call this method with `electron` as the
|
||||
|
@ -428,31 +428,31 @@ 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.
|
||||
|
||||
**Note:** On OS X, you can only register protocols that have been added to
|
||||
**Note:** On macOS, you can only register protocols that have been added to
|
||||
your app's `info.plist`, which can not be modified at runtime. You can however
|
||||
change the file with a simple text editor or script during build time.
|
||||
Please refer to [Apple's documentation][CFBundleURLTypes] for details.
|
||||
|
||||
The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally.
|
||||
|
||||
### `app.removeAsDefaultProtocolClient(protocol)` _OS X_ _Windows_
|
||||
### `app.removeAsDefaultProtocolClient(protocol)` _macOS_ _Windows_
|
||||
|
||||
* `protocol` String - The name of your protocol, without `://`.
|
||||
|
||||
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.
|
||||
|
||||
### `app.isDefaultProtocolClient(protocol)` _OS X_ _Windows_
|
||||
### `app.isDefaultProtocolClient(protocol)` _macOS_ _Windows_
|
||||
|
||||
* `protocol` String - The name of your protocol, without `://`.
|
||||
|
||||
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.
|
||||
|
||||
**Note:** On OS X, you can use this method to check if the app has been
|
||||
**Note:** On macOS, you can use this method to check if the app has been
|
||||
registered as the default protocol handler for a protocol. You can also verify
|
||||
this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
|
||||
OS X machine. Please refer to
|
||||
macOS machine. Please refer to
|
||||
[Apple's documentation][LSCopyDefaultHandlerForURLScheme] for details.
|
||||
|
||||
The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally.
|
||||
|
@ -503,7 +503,7 @@ application and your app should continue loading. And returns `true` if your
|
|||
process has sent its parameters to another instance, and you should immediately
|
||||
quit.
|
||||
|
||||
On OS X the system enforces single instance automatically when users try to open
|
||||
On macOS the system enforces single instance automatically when users try to open
|
||||
a second instance of your app in Finder, and the `open-file` and `open-url`
|
||||
events will be emitted for that. However when users start your app in command
|
||||
line the system's single instance mechanism will be bypassed and you have to
|
||||
|
@ -538,7 +538,7 @@ app.on('ready', () => {
|
|||
Releases all locks that were created by `makeSingleInstance`. This will allow
|
||||
multiple instances of the application to once again run side by side.
|
||||
|
||||
### `app.setUserActivity(type, userInfo[, webpageURL])` _OS X_
|
||||
### `app.setUserActivity(type, userInfo[, webpageURL])` _macOS_
|
||||
|
||||
* `type` String - Uniquely identifies the activity. Maps to
|
||||
[`NSUserActivity.activityType`][activity-type].
|
||||
|
@ -549,7 +549,7 @@ multiple instances of the application to once again run side by side.
|
|||
Creates an `NSUserActivity` and sets it as the current activity. The activity
|
||||
is eligible for [Handoff][handoff] to another device afterward.
|
||||
|
||||
### `app.getCurrentActivityType()` _OS X_
|
||||
### `app.getCurrentActivityType()` _macOS_
|
||||
|
||||
Returns the type of the currently running activity.
|
||||
|
||||
|
@ -591,7 +591,7 @@ correctly.
|
|||
|
||||
**Note:** This will not affect `process.argv`.
|
||||
|
||||
### `app.dock.bounce([type])` _OS X_
|
||||
### `app.dock.bounce([type])` _macOS_
|
||||
|
||||
* `type` String (optional) - Can be `critical` or `informational`. The default is
|
||||
`informational`
|
||||
|
@ -605,43 +605,43 @@ or the request is canceled.
|
|||
|
||||
Returns an ID representing the request.
|
||||
|
||||
### `app.dock.cancelBounce(id)` _OS X_
|
||||
### `app.dock.cancelBounce(id)` _macOS_
|
||||
|
||||
* `id` Integer
|
||||
|
||||
Cancel the bounce of `id`.
|
||||
|
||||
### `app.dock.downloadFinished(filePath)` _OS X_
|
||||
### `app.dock.downloadFinished(filePath)` _macOS_
|
||||
|
||||
* `filePath` String
|
||||
|
||||
Bounces the Downloads stack if the filePath is inside the Downloads folder.
|
||||
|
||||
### `app.dock.setBadge(text)` _OS X_
|
||||
### `app.dock.setBadge(text)` _macOS_
|
||||
|
||||
* `text` String
|
||||
|
||||
Sets the string to be displayed in the dock’s badging area.
|
||||
|
||||
### `app.dock.getBadge()` _OS X_
|
||||
### `app.dock.getBadge()` _macOS_
|
||||
|
||||
Returns the badge string of the dock.
|
||||
|
||||
### `app.dock.hide()` _OS X_
|
||||
### `app.dock.hide()` _macOS_
|
||||
|
||||
Hides the dock icon.
|
||||
|
||||
### `app.dock.show()` _OS X_
|
||||
### `app.dock.show()` _macOS_
|
||||
|
||||
Shows the dock icon.
|
||||
|
||||
### `app.dock.setMenu(menu)` _OS X_
|
||||
### `app.dock.setMenu(menu)` _macOS_
|
||||
|
||||
* `menu` [Menu](menu.md)
|
||||
|
||||
Sets the application's [dock menu][dock-menu].
|
||||
|
||||
### `app.dock.setIcon(image)` _OS X_
|
||||
### `app.dock.setIcon(image)` _macOS_
|
||||
|
||||
* `image` [NativeImage](native-image.md)
|
||||
|
||||
|
|
|
@ -20,13 +20,13 @@ application by using one of these projects:
|
|||
Though `autoUpdater` provides a uniform API for different platforms, there are
|
||||
still some subtle differences on each platform.
|
||||
|
||||
### OS X
|
||||
### macOS
|
||||
|
||||
On OS X, the `autoUpdater` module is built upon [Squirrel.Mac][squirrel-mac],
|
||||
On macOS, the `autoUpdater` module is built upon [Squirrel.Mac][squirrel-mac],
|
||||
meaning you don't need any special setup to make it work. For server-side
|
||||
requirements, you can read [Server Support][server-support].
|
||||
|
||||
**Note:** Your application must be signed for automatic updates on Mac OS X.
|
||||
**Note:** Your application must be signed for automatic updates on macOS.
|
||||
This is a requirement of `Squirrel.Mac`.
|
||||
|
||||
### Windows
|
||||
|
@ -42,7 +42,7 @@ The installer generated with Squirrel will create a shortcut icon with an
|
|||
same ID for your app with `app.setAppUserModelId` API, otherwise Windows will
|
||||
not be able to pin your app properly in task bar.
|
||||
|
||||
The server-side setup is also different from OS X. You can read the documents of
|
||||
The server-side setup is also different from macOS. You can read the documents of
|
||||
[Squirrel.Windows][squirrel-windows] to get more details.
|
||||
|
||||
### Linux
|
||||
|
@ -96,7 +96,7 @@ The `autoUpdater` object has the following methods:
|
|||
### `autoUpdater.setFeedURL(url[, requestHeaders])`
|
||||
|
||||
* `url` String
|
||||
* `requestHeaders` Object _OS X_ - HTTP request headers.
|
||||
* `requestHeaders` Object _macOS_ - HTTP request headers.
|
||||
|
||||
Sets the `url` and initialize the auto updater.
|
||||
|
||||
|
|
|
@ -101,9 +101,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
|||
other windows. Default is `false`.
|
||||
* `fullscreen` Boolean - Whether the window should show in fullscreen. When
|
||||
explicitly set to `false` the fullscreen button will be hidden or disabled
|
||||
on OS X. Default is `false`.
|
||||
on macOS. Default is `false`.
|
||||
* `fullscreenable` Boolean - Whether the window can be put into fullscreen
|
||||
mode. On OS X, also whether the maximize/zoom button should toggle full
|
||||
mode. On macOS, also whether the maximize/zoom button should toggle full
|
||||
screen mode or maximize window. Default is `true`.
|
||||
* `skipTaskbar` Boolean - Whether to show the window in taskbar. Default is
|
||||
`false`.
|
||||
|
@ -129,7 +129,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
|||
like `#66CD00` or `#FFF` or `#80FFFFFF` (alpha is supported). Default is
|
||||
`#FFF` (white).
|
||||
* `hasShadow` Boolean - Whether window should have a shadow. This is only
|
||||
implemented on OS X. Default is `true`.
|
||||
implemented on macOS. Default is `true`.
|
||||
* `darkTheme` Boolean - Forces using dark theme for the window, only works on
|
||||
some GTK+3 desktop environments. Default is `false`.
|
||||
* `transparent` Boolean - Makes the window [transparent](frameless-window.md).
|
||||
|
@ -151,7 +151,7 @@ supported values are:
|
|||
|
||||
* On Linux, possible types are `desktop`, `dock`, `toolbar`, `splash`,
|
||||
`notification`.
|
||||
* On OS X, possible types are `desktop`, `textured`.
|
||||
* On macOS, possible types are `desktop`, `textured`.
|
||||
* The `textured` type adds metal gradient appearance
|
||||
(`NSTexturedBackgroundWindowMask`).
|
||||
* The `desktop` type places the window at the desktop background window level
|
||||
|
@ -159,7 +159,7 @@ supported values are:
|
|||
focus, keyboard or mouse events, but you can use `globalShortcut` to receive
|
||||
input sparingly.
|
||||
|
||||
The `titleBarStyle` option is only supported on OS X 10.10 Yosemite and newer.
|
||||
The `titleBarStyle` option is only supported on macOS 10.10 Yosemite and newer.
|
||||
Possible values are:
|
||||
|
||||
* `default` or not specified, results in the standard gray opaque Mac title
|
||||
|
@ -216,7 +216,7 @@ The `webPreferences` option is an object that can have following properties:
|
|||
* `directWrite` Boolean - Enables DirectWrite font rendering system on
|
||||
Windows. Default is `true`.
|
||||
* `scrollBounce` Boolean - Enables scroll bounce (rubber banding) effect on
|
||||
OS X. Default is `false`.
|
||||
macOS. Default is `false`.
|
||||
* `blinkFeatures` String - A list of feature strings separated by `,`, like
|
||||
`CSSVariables,KeyboardEventKey` to enable. The full list of supported feature
|
||||
strings can be found in the [RuntimeEnabledFeatures.in][blink-feature-string]
|
||||
|
@ -338,9 +338,9 @@ Emitted when the window is getting resized.
|
|||
|
||||
Emitted when the window is getting moved to a new position.
|
||||
|
||||
__Note__: On OS X this event is just an alias of `moved`.
|
||||
__Note__: On macOS this event is just an alias of `moved`.
|
||||
|
||||
### Event: 'moved' _OS X_
|
||||
### Event: 'moved' _macOS_
|
||||
|
||||
Emitted once when the window is moved to a new position.
|
||||
|
||||
|
@ -384,15 +384,15 @@ someWindow.on('app-command', (e, cmd) => {
|
|||
});
|
||||
```
|
||||
|
||||
### Event: 'scroll-touch-begin' _OS X_
|
||||
### Event: 'scroll-touch-begin' _macOS_
|
||||
|
||||
Emitted when scroll wheel event phase has begun.
|
||||
|
||||
### Event: 'scroll-touch-end' _OS X_
|
||||
### Event: 'scroll-touch-end' _macOS_
|
||||
|
||||
Emitted when scroll wheel event phase has ended.
|
||||
|
||||
### Event: 'swipe' _OS X_
|
||||
### Event: 'swipe' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
|
@ -567,7 +567,7 @@ Sets whether the window should be in fullscreen mode.
|
|||
|
||||
Returns a boolean, whether the window is in fullscreen mode.
|
||||
|
||||
### `win.setAspectRatio(aspectRatio[, extraSize])` _OS X_
|
||||
### `win.setAspectRatio(aspectRatio[, extraSize])` _macOS_
|
||||
|
||||
* `aspectRatio` The aspect ratio we want to maintain for some portion of the
|
||||
content view.
|
||||
|
@ -597,7 +597,7 @@ height areas you have within the overall content view.
|
|||
* `y` Integer
|
||||
* `width` Integer
|
||||
* `height` Integer
|
||||
* `animate` Boolean (optional) _OS X_
|
||||
* `animate` Boolean (optional) _macOS_
|
||||
|
||||
Resizes and moves the window to `width`, `height`, `x`, `y`.
|
||||
|
||||
|
@ -609,7 +609,7 @@ Returns an object that contains window's width, height, x and y values.
|
|||
|
||||
* `width` Integer
|
||||
* `height` Integer
|
||||
* `animate` Boolean (optional) _OS X_
|
||||
* `animate` Boolean (optional) _macOS_
|
||||
|
||||
Resizes the window to `width` and `height`.
|
||||
|
||||
|
@ -621,7 +621,7 @@ Returns an array that contains window's width and height.
|
|||
|
||||
* `width` Integer
|
||||
* `height` Integer
|
||||
* `animate` Boolean (optional) _OS X_
|
||||
* `animate` Boolean (optional) _macOS_
|
||||
|
||||
Resizes the window's client area (e.g. the web page) to `width` and `height`.
|
||||
|
||||
|
@ -661,37 +661,37 @@ Sets whether the window can be manually resized by user.
|
|||
|
||||
Returns whether the window can be manually resized by user.
|
||||
|
||||
### `win.setMovable(movable)` _OS X_ _Windows_
|
||||
### `win.setMovable(movable)` _macOS_ _Windows_
|
||||
|
||||
* `movable` Boolean
|
||||
|
||||
Sets whether the window can be moved by user. On Linux does nothing.
|
||||
|
||||
### `win.isMovable()` _OS X_ _Windows_
|
||||
### `win.isMovable()` _macOS_ _Windows_
|
||||
|
||||
Returns whether the window can be moved by user. On Linux always returns
|
||||
`true`.
|
||||
|
||||
### `win.setMinimizable(minimizable)` _OS X_ _Windows_
|
||||
### `win.setMinimizable(minimizable)` _macOS_ _Windows_
|
||||
|
||||
* `minimizable` Boolean
|
||||
|
||||
Sets whether the window can be manually minimized by user. On Linux does
|
||||
nothing.
|
||||
|
||||
### `win.isMinimizable()` _OS X_ _Windows_
|
||||
### `win.isMinimizable()` _macOS_ _Windows_
|
||||
|
||||
Returns whether the window can be manually minimized by user. On Linux always
|
||||
returns `true`.
|
||||
|
||||
### `win.setMaximizable(maximizable)` _OS X_ _Windows_
|
||||
### `win.setMaximizable(maximizable)` _macOS_ _Windows_
|
||||
|
||||
* `maximizable` Boolean
|
||||
|
||||
Sets whether the window can be manually maximized by user. On Linux does
|
||||
nothing.
|
||||
|
||||
### `win.isMaximizable()` _OS X_ _Windows_
|
||||
### `win.isMaximizable()` _macOS_ _Windows_
|
||||
|
||||
Returns whether the window can be manually maximized by user. On Linux always
|
||||
returns `true`.
|
||||
|
@ -708,13 +708,13 @@ maximizes the window.
|
|||
Returns whether the maximize/zoom window button toggles fullscreen mode or
|
||||
maximizes the window.
|
||||
|
||||
### `win.setClosable(closable)` _OS X_ _Windows_
|
||||
### `win.setClosable(closable)` _macOS_ _Windows_
|
||||
|
||||
* `closable` Boolean
|
||||
|
||||
Sets whether the window can be manually closed by user. On Linux does nothing.
|
||||
|
||||
### `win.isClosable()` _OS X_ _Windows_
|
||||
### `win.isClosable()` _macOS_ _Windows_
|
||||
|
||||
Returns whether the window can be manually closed by user. On Linux always
|
||||
returns `true`.
|
||||
|
@ -739,7 +739,7 @@ Moves window to the center of the screen.
|
|||
|
||||
* `x` Integer
|
||||
* `y` Integer
|
||||
* `animate` Boolean (optional) _OS X_
|
||||
* `animate` Boolean (optional) _macOS_
|
||||
|
||||
Moves window to `x` and `y`.
|
||||
|
||||
|
@ -760,9 +760,9 @@ Returns the title of the native window.
|
|||
**Note:** The title of web page can be different from the title of the native
|
||||
window.
|
||||
|
||||
### `win.setSheetOffset(offsetY[, offsetX])` _OS X_
|
||||
### `win.setSheetOffset(offsetY[, offsetX])` _macOS_
|
||||
|
||||
Changes the attachment point for sheets on Mac OS X. By default, sheets are
|
||||
Changes the attachment point for sheets on macOS. By default, sheets are
|
||||
attached just below the window frame, but you may want to display them beneath
|
||||
a HTML-rendered toolbar. For example:
|
||||
|
||||
|
@ -797,7 +797,7 @@ Returns whether the window is in kiosk mode.
|
|||
|
||||
Returns the platform-specific handle of the window as `Buffer`.
|
||||
|
||||
The native type of the handle is `HWND` on Windows, `NSView*` on OS X, and
|
||||
The native type of the handle is `HWND` on Windows, `NSView*` on macOS, and
|
||||
`Window` (`unsigned long`) on Linux.
|
||||
|
||||
### `win.hookWindowMessage(message, callback)` _Windows_
|
||||
|
@ -824,25 +824,25 @@ Unhook the window message.
|
|||
|
||||
Unhooks all of the window messages.
|
||||
|
||||
### `win.setRepresentedFilename(filename)` _OS X_
|
||||
### `win.setRepresentedFilename(filename)` _macOS_
|
||||
|
||||
* `filename` String
|
||||
|
||||
Sets the pathname of the file the window represents, and the icon of the file
|
||||
will show in window's title bar.
|
||||
|
||||
### `win.getRepresentedFilename()` _OS X_
|
||||
### `win.getRepresentedFilename()` _macOS_
|
||||
|
||||
Returns the pathname of the file the window represents.
|
||||
|
||||
### `win.setDocumentEdited(edited)` _OS X_
|
||||
### `win.setDocumentEdited(edited)` _macOS_
|
||||
|
||||
* `edited` Boolean
|
||||
|
||||
Specifies whether the window’s document has been edited, and the icon in title
|
||||
bar will become gray when set to `true`.
|
||||
|
||||
### `win.isDocumentEdited()` _OS X_
|
||||
### `win.isDocumentEdited()` _macOS_
|
||||
|
||||
Whether the window's document has been edited.
|
||||
|
||||
|
@ -903,14 +903,14 @@ screen readers
|
|||
Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
|
||||
convey some sort of application status or to passively notify the user.
|
||||
|
||||
### `win.setHasShadow(hasShadow)` _OS X_
|
||||
### `win.setHasShadow(hasShadow)` _macOS_
|
||||
|
||||
* `hasShadow` (Boolean)
|
||||
|
||||
Sets whether the window should have a shadow. On Windows and Linux does
|
||||
nothing.
|
||||
|
||||
### `win.hasShadow()` _OS X_
|
||||
### `win.hasShadow()` _macOS_
|
||||
|
||||
Returns whether the window has a shadow. On Windows and Linux always returns
|
||||
`true`.
|
||||
|
@ -951,7 +951,7 @@ The `flags` is an array that can include following `String`s:
|
|||
button state is drawn. This value is intended for instances where the button
|
||||
is used in a notification.
|
||||
|
||||
### `win.showDefinitionForSelection()` _OS X_
|
||||
### `win.showDefinitionForSelection()` _macOS_
|
||||
|
||||
Same as `webContents.showDefinitionForSelection()`.
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ The `crash-reporter` module has the following methods:
|
|||
You are required to call this method before using other `crashReporter`
|
||||
APIs.
|
||||
|
||||
**Note:** On OS X, Electron uses a new `crashpad` client, which is different
|
||||
**Note:** On macOS, Electron uses a new `crashpad` client, which is different
|
||||
from `breakpad` on Windows and Linux. To enable the crash collection feature,
|
||||
you are required to call the `crashReporter.start` API to initialize `crashpad`
|
||||
in the main process and in each renderer process from which you wish to collect
|
||||
|
|
|
@ -103,7 +103,7 @@ will be passed via `callback(filename)`
|
|||
* `cancelId` Integer - The value will be returned when user cancels the dialog
|
||||
instead of clicking the buttons of the dialog. By default it is the index
|
||||
of the buttons that have "cancel" or "no" as label, or 0 if there is no such
|
||||
buttons. On OS X and Windows the index of "Cancel" button will always be
|
||||
buttons. On macOS and Windows the index of "Cancel" button will always be
|
||||
used as `cancelId`, not matter whether it is already specified.
|
||||
* `noLink` Boolean - On Windows Electron will try to figure out which one of
|
||||
the `buttons` are common buttons (like "Cancel" or "Yes"), and show the
|
||||
|
@ -129,7 +129,7 @@ and no GUI dialog will appear.
|
|||
|
||||
## Sheets
|
||||
|
||||
On Mac OS X, dialogs are presented as sheets attached to a window if you provide
|
||||
On macOS, dialogs are presented as sheets attached to a window if you provide
|
||||
a `BrowserWindow` reference in the `browserWindow` parameter, or modals if no
|
||||
window is provided.
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ const {BrowserWindow} = require('electron')
|
|||
let win = new BrowserWindow({width: 800, height: 600, frame: false})
|
||||
```
|
||||
|
||||
### Alternatives on OS X
|
||||
### Alternatives on macOS
|
||||
|
||||
On Mac OS X 10.10 Yosemite and newer, there's an alternative way to specify
|
||||
On macOS 10.10 Yosemite and newer, there's an alternative way to specify
|
||||
a chromeless window. Instead of setting `frame` to `false` which disables
|
||||
both the titlebar and window controls, you may want to have the title bar
|
||||
hidden and your content extend to the full window size, yet still preserve
|
||||
|
|
|
@ -52,7 +52,7 @@ The `role` property can have following values:
|
|||
* `minimize` - Minimize current window
|
||||
* `close` - Close current window
|
||||
|
||||
On OS X `role` can also have following additional values:
|
||||
On macOS `role` can also have following additional values:
|
||||
|
||||
* `about` - Map to the `orderFrontStandardAboutPanel` action
|
||||
* `hide` - Map to the `hide` action
|
||||
|
@ -64,7 +64,7 @@ On OS X `role` can also have following additional values:
|
|||
* `help` - The submenu is a "Help" menu
|
||||
* `services` - The submenu is a "Services" menu
|
||||
|
||||
When specifying `role` on OS X, `label` and `accelerator` are the only options
|
||||
When specifying `role` on macOS, `label` and `accelerator` are the only options
|
||||
that will affect the MenuItem. All other options will be ignored.
|
||||
|
||||
## Instance Properties
|
||||
|
|
|
@ -226,7 +226,7 @@ The `menu` class has the following methods:
|
|||
|
||||
* `menu` Menu
|
||||
|
||||
Sets `menu` as the application menu on OS X. On Windows and Linux, the `menu`
|
||||
Sets `menu` as the application menu on macOS. On Windows and Linux, the `menu`
|
||||
will be set as each window's top menu.
|
||||
|
||||
**Note:** This API has to be called after the `ready` event of `app` module.
|
||||
|
@ -235,7 +235,7 @@ will be set as each window's top menu.
|
|||
|
||||
Returns the application menu (an instance of `Menu`), if set, or `null`, if not set.
|
||||
|
||||
### `Menu.sendActionToFirstResponder(action)` _OS X_
|
||||
### `Menu.sendActionToFirstResponder(action)` _macOS_
|
||||
|
||||
* `action` String
|
||||
|
||||
|
@ -243,8 +243,8 @@ Sends the `action` to the first responder of application. This is used for
|
|||
emulating default Cocoa menu behaviors, usually you would just use the
|
||||
`role` property of `MenuItem`.
|
||||
|
||||
See the [OS X Cocoa Event Handling Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html#//apple_ref/doc/uid/10000060i-CH3-SW7)
|
||||
for more information on OS X's native actions.
|
||||
See the [macOS Cocoa Event Handling Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html#//apple_ref/doc/uid/10000060i-CH3-SW7)
|
||||
for more information on macOS's native actions.
|
||||
|
||||
### `Menu.buildFromTemplate(template)`
|
||||
|
||||
|
@ -265,7 +265,7 @@ The `menu` object has the following instance methods:
|
|||
* `browserWindow` BrowserWindow (optional) - Default is `null`.
|
||||
* `x` Number (optional) - Default is -1.
|
||||
* `y` Number (**required** if `x` is used) - Default is -1.
|
||||
* `positioningItem` Number (optional) _OS X_ - The index of the menu item to
|
||||
* `positioningItem` Number (optional) _macOS_ - The index of the menu item to
|
||||
be positioned under the mouse cursor at the specified coordinates. Default is
|
||||
-1.
|
||||
|
||||
|
@ -294,14 +294,14 @@ Inserts the `menuItem` to the `pos` position of the menu.
|
|||
|
||||
Get an array containing the menu's items.
|
||||
|
||||
## Notes on OS X Application Menu
|
||||
## Notes on macOS Application Menu
|
||||
|
||||
OS X has a completely different style of application menu from Windows and
|
||||
macOS has a completely different style of application menu from Windows and
|
||||
Linux, here are some notes on making your app's menu more native-like.
|
||||
|
||||
### Standard Menus
|
||||
|
||||
On OS X there are many system defined standard menus, like the `Services` and
|
||||
On macOS there are many system defined standard menus, like the `Services` and
|
||||
`Windows` menus. To make your menu a standard menu, you should set your menu's
|
||||
`role` to one of following and Electron will recognize them and make them
|
||||
become standard menus:
|
||||
|
@ -312,13 +312,13 @@ become standard menus:
|
|||
|
||||
### Standard Menu Item Actions
|
||||
|
||||
OS X has provided standard actions for some menu items, like `About xxx`,
|
||||
macOS has provided standard actions for some menu items, like `About xxx`,
|
||||
`Hide xxx`, and `Hide Others`. To set the action of a menu item to a standard
|
||||
action, you should set the `role` attribute of the menu item.
|
||||
|
||||
### Main Menu's Name
|
||||
|
||||
On OS X the label of application menu's first item is always your app's name,
|
||||
On macOS the label of application menu's first item is always your app's name,
|
||||
no matter what label you set. To change it you have to change your app's name
|
||||
by modifying your app bundle's `Info.plist` file. See [About Information
|
||||
Property List Files][AboutInformationPropertyListFiles] for more information.
|
||||
|
|
|
@ -81,7 +81,7 @@ mixed with other content to create the desired final appearance.
|
|||
The most common case is to use template images for a menu bar icon so it can
|
||||
adapt to both light and dark menu bars.
|
||||
|
||||
**Note:** Template image is only supported on OS X.
|
||||
**Note:** Template image is only supported on macOS.
|
||||
|
||||
To mark an image as a template image, its filename should end with the word
|
||||
`Template`. For example:
|
||||
|
@ -141,10 +141,10 @@ Returns a [Buffer][buffer] that contains the image's `JPEG` encoded data.
|
|||
|
||||
Returns the data URL of the image.
|
||||
|
||||
### `image.getNativeHandle()` _OS X_
|
||||
### `image.getNativeHandle()` _macOS_
|
||||
|
||||
Returns a [Buffer][buffer] that stores C pointer to underlying native handle of
|
||||
the image. On OS X, a pointer to `NSImage` instance would be returned.
|
||||
the image. On macOS, a pointer to `NSImage` instance would be returned.
|
||||
|
||||
Notice that the returned pointer is a weak pointer to the underlying native
|
||||
image instead of a copy, so you _must_ ensure that the associated
|
||||
|
|
|
@ -74,7 +74,7 @@ Causes the main thread of the current process crash.
|
|||
|
||||
Causes the main thread of the current process hang.
|
||||
|
||||
### `process.setFdLimit(maxDescriptors)` _OS X_ _Linux_
|
||||
### `process.setFdLimit(maxDescriptors)` _macOS_ _Linux_
|
||||
|
||||
* `maxDescriptors` Integer
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ Open the given file in the desktop's default manner.
|
|||
### `shell.openExternal(url[, options])`
|
||||
|
||||
* `url` String
|
||||
* `options` Object (optional) _OS X_
|
||||
* `options` Object (optional) _macOS_
|
||||
* `activate` Boolean - `true` to bring the opened application to the
|
||||
foreground. The default is `true`.
|
||||
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
|
||||
## Methods
|
||||
|
||||
### `systemPreferences.isDarkMode()` _OS X_
|
||||
### `systemPreferences.isDarkMode()` _macOS_
|
||||
|
||||
This method returns `true` if the system is in Dark Mode, and `false` otherwise.
|
||||
|
||||
### `systemPreferences.subscribeNotification(event, callback)` _OS X_
|
||||
### `systemPreferences.subscribeNotification(event, callback)` _macOS_
|
||||
|
||||
* `event` String
|
||||
* `callback` Function
|
||||
|
||||
Subscribes to native notifications of OS X, `callback` will be called with
|
||||
Subscribes to native notifications of macOS, `callback` will be called with
|
||||
`callback(event, userInfo)` when the corresponding `event` happens. The
|
||||
`userInfo` is an Object that contains the user information dictionary sent
|
||||
along with the notification.
|
||||
|
@ -29,13 +29,13 @@ example values of `event` are:
|
|||
* `AppleColorPreferencesChangedNotification`
|
||||
* `AppleShowScrollBarsSettingChanged`
|
||||
|
||||
### `systemPreferences.unsubscribeNotification(id)` _OS X_
|
||||
### `systemPreferences.unsubscribeNotification(id)` _macOS_
|
||||
|
||||
* `id` Integer
|
||||
|
||||
Removes the subscriber with `id`.
|
||||
|
||||
### `systemPreferences.getUserDefault(key, type)` _OS X_
|
||||
### `systemPreferences.getUserDefault(key, type)` _macOS_
|
||||
|
||||
* `key` String
|
||||
* `type` String - Can be `string`, `boolean`, `integer`, `float`, `double`,
|
||||
|
@ -43,7 +43,7 @@ Removes the subscriber with `id`.
|
|||
|
||||
Get the value of `key` in system preferences.
|
||||
|
||||
This API reads from `NSUserDefaults` on OS X, some popular `key` and `type`s
|
||||
This API reads from `NSUserDefaults` on macOS, some popular `key` and `type`s
|
||||
are:
|
||||
|
||||
* `AppleInterfaceStyle: string`
|
||||
|
|
|
@ -71,9 +71,9 @@ labeled as such.
|
|||
|
||||
Emitted when the tray icon is clicked.
|
||||
|
||||
**Note:** The `bounds` payload is only implemented on OS X and Windows.
|
||||
**Note:** The `bounds` payload is only implemented on macOS and Windows.
|
||||
|
||||
### Event: 'right-click' _OS X_ _Windows_
|
||||
### Event: 'right-click' _macOS_ _Windows_
|
||||
|
||||
* `event` Event
|
||||
* `altKey` Boolean
|
||||
|
@ -88,7 +88,7 @@ Emitted when the tray icon is clicked.
|
|||
|
||||
Emitted when the tray icon is right clicked.
|
||||
|
||||
### Event: 'double-click' _OS X_ _Windows_
|
||||
### Event: 'double-click' _macOS_ _Windows_
|
||||
|
||||
* `event` Event
|
||||
* `altKey` Boolean
|
||||
|
@ -116,26 +116,26 @@ Emitted when the tray balloon is clicked.
|
|||
Emitted when the tray balloon is closed because of timeout or user manually
|
||||
closes it.
|
||||
|
||||
### Event: 'drop' _OS X_
|
||||
### Event: 'drop' _macOS_
|
||||
|
||||
Emitted when any dragged items are dropped on the tray icon.
|
||||
|
||||
### Event: 'drop-files' _OS X_
|
||||
### Event: 'drop-files' _macOS_
|
||||
|
||||
* `event`
|
||||
* `files` Array - the file path of dropped files.
|
||||
|
||||
Emitted when dragged files are dropped in the tray icon.
|
||||
|
||||
### Event: 'drag-enter' _OS X_
|
||||
### Event: 'drag-enter' _macOS_
|
||||
|
||||
Emitted when a drag operation enters the tray icon.
|
||||
|
||||
### Event: 'drag-leave' _OS X_
|
||||
### Event: 'drag-leave' _macOS_
|
||||
|
||||
Emitted when a drag operation exits the tray icon.
|
||||
|
||||
### Event: 'drag-end' _OS X_
|
||||
### Event: 'drag-end' _macOS_
|
||||
|
||||
Emitted when a drag operation ends on the tray or ends at another location.
|
||||
|
||||
|
@ -156,11 +156,11 @@ Destroys the tray icon immediately.
|
|||
|
||||
Sets the `image` associated with this tray icon.
|
||||
|
||||
### `Tray.setPressedImage(image)` _OS X_
|
||||
### `Tray.setPressedImage(image)` _macOS_
|
||||
|
||||
* `image` [NativeImage](native-image.md)
|
||||
|
||||
Sets the `image` associated with this tray icon when pressed on OS X.
|
||||
Sets the `image` associated with this tray icon when pressed on macOS.
|
||||
|
||||
### `Tray.setToolTip(toolTip)`
|
||||
|
||||
|
@ -168,13 +168,13 @@ Sets the `image` associated with this tray icon when pressed on OS X.
|
|||
|
||||
Sets the hover text for this tray icon.
|
||||
|
||||
### `Tray.setTitle(title)` _OS X_
|
||||
### `Tray.setTitle(title)` _macOS_
|
||||
|
||||
* `title` String
|
||||
|
||||
Sets the title displayed aside of the tray icon in the status bar.
|
||||
|
||||
### `Tray.setHighlightMode(highlight)` _OS X_
|
||||
### `Tray.setHighlightMode(highlight)` _macOS_
|
||||
|
||||
* `highlight` Boolean
|
||||
|
||||
|
@ -190,7 +190,7 @@ when the tray icon is clicked. Defaults to true.
|
|||
|
||||
Displays a tray balloon.
|
||||
|
||||
### `Tray.popUpContextMenu([menu, position])` _OS X_ _Windows_
|
||||
### `Tray.popUpContextMenu([menu, position])` _macOS_ _Windows_
|
||||
|
||||
* `menu` Menu (optional)
|
||||
* `position` Object (optional) - The pop up position.
|
||||
|
|
|
@ -957,7 +957,7 @@ win.webContents.on('did-finish-load', () => {
|
|||
});
|
||||
```
|
||||
|
||||
### `webContents.showDefinitionForSelection()` _OS X_
|
||||
### `webContents.showDefinitionForSelection()` _macOS_
|
||||
|
||||
Shows pop-up dictionary that searches the selected word on the page.
|
||||
|
||||
|
|
|
@ -490,7 +490,7 @@ Sends an input `event` to the page.
|
|||
See [webContents.sendInputEvent](web-contents.md##webcontentssendinputeventevent)
|
||||
for detailed description of `event` object.
|
||||
|
||||
### `<webview>.showDefinitionForSelection()` _OS X_
|
||||
### `<webview>.showDefinitionForSelection()` _macOS_
|
||||
|
||||
Shows pop-up dictionary that searches the selected word on the page.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue