mozilla/pdf.js — pull request #3499 by Snuffleupagus (2013-07-20 22:22:42+00:00)
Title: Emulate spacebar to fix scrolling in the web viewer in Firefox

This is a continuation of PR #3497, and it implements a workaround to make sure that scrolling using the `spacebar` key works in a predictable way in all browsers. This patch tries to, as closely as possible, emulate the behaviour in Firefox, since that is where scrolling using `spacebar` currently doesn't work.

To make sure that this patch doesn't unnecessarily interfere with already working cases, it will only apply to the web viewer *and* builds created by `node make generic`.
This means that for the Firefox addon and the Mozcentral version (and also the Chrome addon), this workaround won't be used since it's not needed in those cases.

Fixes #3498.

PS. I initially tried solving this by creating a `keydown` event to simulate `Page Down`/`Page Up` being pressed, since those keys already works. Unfortunately this didn't make any difference, hence the reason for the current workaround.