Switch check from !isMac to isWindows for specificity.

Only Windows uses Mod+y, this avoids adding the shortcut to other operating systems (such as Linux or iOS).

This adds better support for spoofed user-agents when testing mobile sites on desktop devices.

You could also add `|| /Pocket/.test(navigator.platform)` but it really is optional
This commit is contained in:
Aaron 2019-07-10 09:25:25 +03:00 committed by GitHub
parent 8aa39d1393
commit 8c9676402b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,13 +15,13 @@ export default class History extends Extension {
}
keys() {
const isMac = typeof navigator !== 'undefined' ? /Mac/.test(navigator.platform) : false
const isWindows = typeof navigator !== 'undefined' ? /Win/.test(navigator.platform) : false
const keymap = {
'Mod-z': undo,
'Shift-Mod-z': redo,
}
if (!isMac) {
if (isWindows) {
keymap['Mod-y'] = redo
}