From: Adrian Iain Lam Date: Fri, 15 May 2015 19:16:10 +0000 (-0700) Subject: (no commit message) X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=d8231bf4824b6efb33dc9187b77ee3dafbd35052;p=xkcd-keyboard-nav.git --- diff --git a/xkcd_keyboard_nav.user.js b/xkcd_keyboard_nav.user.js index 1c73193..732d54e 100644 --- a/xkcd_keyboard_nav.user.js +++ b/xkcd_keyboard_nav.user.js @@ -27,7 +27,7 @@ // @name xkcd keyboard nav // @namespace https://github.com/adrianiainlam // @description Navigate xkcd with your keyboard -// @version 1.0.0 +// @version 1.0.1 // @downloadURL https://gist.github.com/adrianiainlam/542dd0794a874ca31321/raw/xkcd_keyboard_nav.user.js // @updateURL https://gist.github.com/adrianiainlam/542dd0794a874ca31321/raw/xkcd_keyboard_nav.user.js // @include /^https?://xkcd\.com(/[0-9]+)?/?$/ @@ -49,6 +49,9 @@ function showTitleText() { } document.body.addEventListener("keypress", function(e) { + if (event.defaultPrevented) { + return; // Should do nothing if the key event was already consumed. + } var navList = document.getElementsByClassName("comicNav")[0].children; if(!e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey) { switch(e.key) {