Skip to content

Commit

Permalink
check navigator variable for existence
Browse files Browse the repository at this point in the history
throws error while try to prerender the page, using preact-cli for example
  • Loading branch information
egorshar authored and jaywcjlove committed Dec 7, 2017
1 parent ed8b6b8 commit 7311320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (!Array.prototype.lastIndexOf) {
}

var _api, // 对外API
isff = navigator.userAgent.toLowerCase().indexOf('firefox') > 0,
isff = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase().indexOf('firefox') > 0 : false,
_keyMap = { // 特殊键
backspace: 8, tab: 9, clear: 12,
enter: 13, 'return': 13,
Expand Down

0 comments on commit 7311320

Please sign in to comment.