Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @match http://www.lowbird.com/*
- // ==/UserScript==
- /*global window */
- (function () {
- "use strict";
- var
- w = window,
- d = window.document,
- prevBar = d.getElementById('prevBar'),
- nextBar = d.getElementById('nextBar'),
- prevUrl = prevBar ? prevBar.getAttribute('href') : null,
- nextUrl = nextBar ? nextBar.getAttribute('href') : null,
- keyDownHandler = function (e) {
- if (e.target.nodeName !== 'BODY') {
- return true;
- }
- if (e.keyCode === 37 && prevUrl) {
- d.location.href = prevUrl;
- } else if (e.keyCode === 39 && nextUrl) {
- d.location.href = nextUrl;
- }
- return true;
- };
- w.onkeydown = keyDownHandler;
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement