parent
3afc3d29cb
commit
d7077334d1
|
@ -15,6 +15,15 @@ var Konami = {};
|
|||
if (matchedKey) {
|
||||
index += 1;
|
||||
|
||||
// fix for Firefox with "Search for text when you start typing" enabled
|
||||
// https://support.mozilla.org/en-US/kb/search-contents-current-page-text-or-links
|
||||
// prevent the default (opening Quick Search) for B and A,
|
||||
// which are luckily at the end of the Konami Code sequence
|
||||
// (otherwise it could prevent typing A and B in text fields unwantedly)
|
||||
if (event.keyCode === 66 || event.keyCode === 65) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
if (index === sequence.length) {
|
||||
|
||||
// reset when sequence completed
|
||||
|
|
Loading…
Reference in New Issue