With the keyboard shortcuts user script having graduated, I see some problems I have not seen before.

When loading a fresh page (question, or tag list) some of the time keyboard shorts start to misbehave for that page. This is with Chrome 36.0.1985.125 on Mac OS X 10.9.3.


  • Navigation skips every second post; J and K only navigate over the odd posts, counting from the first.

    For a tag page, when new questions come in, loading them with U works fine, but I still can only select the odd questions; even if this is now the other half of the questions because an odd number of questions was added to the page.

    On a question page, the skipping applies to question and answers combined, you move from question to the second answer and onwards.

  • The help box (?), inbox (I) and achievement box (R) all do not show. They are loaded (unread and achievements counters are cleared) and if Auto-Help (H) is enabled the numbered list appears, they just are not visible.

    Clicking directly on the inbox or achievements box does work; the dropdowns are shown correctly.

  • Opening a question from a question list while holding the SHIFT key opens the question in a new window and in a new tab.

  • I cannot toggle Auto-Help (H); it is either on or off on page load and the state doesn't change.

The problem appears to occur when multiple tabs are loading; so if I reload a question page and a tag page in quick succession, I can get one of the two pages to show this weird state pretty quickly. As I usually have multiple tabs open and reload those tabs when I open up my laptop, I run into this issue quite frequently.

  • Integrating races is always a problem. What? – Won't Jul 29 '14 at 15:57
  • Also, shift-click on links always opens in a new window. ctrl-click opens a new tab in the same window. Never liked that. Them boys who decided that is miscegenated! – Won't Jul 29 '14 at 15:59
  • @Won't: I suspect there is a race condition somewhere; removed it from the title anyway. – Martijn Pieters Jul 29 '14 at 16:04
  • Does this also happen when you disable the user script and enable keyboard shortcuts in your site preferences? Or are you already doing that? It sounds like disabling the automatic disabling of the user script isn't quite working there. – balpha Jul 29 '14 at 18:45
  • @balpha: The user script is uninstalled, this is the site version entirely. I did discover another strange JS loading problem, see Unanswered questions section for Android tag became semi-transparent – Martijn Pieters Jul 29 '14 at 18:46
  • @balpha: ick, Tampermonkey had re-enabled the keyboard shortcuts script too. I've disabled it now, will see if I can still reproduce. – Martijn Pieters Jul 30 '14 at 9:46

In Chrome, it is possible that user scripts are only executed after the window.onload event; the same seems to be true when using TamperMonkey. In particular this seems to happen quite frequently if the page is being loaded in a tab different to the one you're looking at. This concurs with what you observed.

Our check for the presence of the keyboard shortcuts user script relies on the script already having been executed once we run the check, but because of this late execution it was possible for the check to run before the script was executed.

That means that in certain cases, either your browser would still run the user script version of the keyboard shortcuts (if you haven't checked the box in your preferences) or run both the user script and the built-in version (if you have checked it). What you were seeing was the latter case; that's what happens when two versions run at the same time (e.g. the even/odd thing happens because each version of the script moves the selection down by one when you press J).

From the next build on, the check for the user script will only be run after the onload event, fixing this.

  • So the work-around in the meantime is to disable the userscript. Thanks! – Martijn Pieters Jul 30 '14 at 11:46
  • All the other symptoms fit too; hitting I is interpreted twice, opening and closing the inbox immediately. They all work, but are just executed twice. – Martijn Pieters Jul 30 '14 at 11:50
  • Has this been deployed to Programmers.SE? I just ran into the problem again there. – Martijn Pieters Aug 3 '14 at 14:09
  • I just ran into this again on Stack Overflow and on Programmers; it happened because I restarted Chrome; e.g. the user-script detection can still fail if you start the browser and it reopens your tabs. – Martijn Pieters Aug 7 '14 at 13:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .