Fixes regression that cause scrolling using spacebar to break in Firefox
Merge pull request #3497 from Snuffleupagus/regression-3447

Fixes regression that cause scrolling using spacebar to break in Firefox
Check if viewer is embedded only once and cache the result