Correct app-command name of APPCOMMAND_MEDIA_PLAY_PAUSE (#12408)

* correct app-command name

* add compatibility with old app-command name

* add temporary compatibility with old app-command name

* add a comment saying that media-play_pause is deprecated

* fix lint
This commit is contained in:
htk3 2018-05-21 10:52:04 +09:00 committed by Cheng Zhao
parent b842a4b133
commit 7c2303c758
2 changed files with 19 additions and 1 deletions

View file

@ -23,6 +23,19 @@ let windowA = new BrowserWindow(optionsA)
// Replace with
let optionsB = {webPreferences: {enableBlinkFeatures: ''}}
let windowB = new BrowserWindow(optionsB)
// Deprecated
window.on('app-command', (e, cmd) => {
if (cmd === 'media-play_pause') {
// do something
}
})
// Replace with
window.on('app-command', (e, cmd) => {
if (cmd === 'media-play-pause') {
// do something
}
})
```
## `clipboard`