Skip to content

Instantly share code, notes, and snippets.

Last active January 25, 2021 00:18
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Keyboard navigation for Trove newspapers
// ==UserScript==
// @name Trove newspapers keyboard navigation
// @namespace
// @version 0.1
// @description Use left and right arrows to move between pages, up and down arrows to move between issues.
// @author Tim Sherratt (@wragge)
// @match*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let prev_page = document.querySelector('a[title="Prev page"]').href;
let next_page = document.querySelector('a[title="Next page"]').href;
let prev_issue = document.querySelector('a[title="Prev issue"]').href;
let next_issue = document.querySelector('a[title="Next issue"]').href;
document.onkeydown = checkKey;
function checkKey(e) {
e = e || window.event;
if (e.keyCode == '38') {
// up arrow, '_self');
else if (e.keyCode == '40') {
// down arrow, '_self');
else if (e.keyCode == '37') {
// left arrow, '_self');
else if (e.keyCode == '39') {
// right arrow, '_self');
Copy link

wragge commented Jan 24, 2021

Keyboard navigation for Trove newspapers!

This is a very simple script that does something very useful. It allows you to use the arrows on your keyboard to move between pages in Trove's digitised newspapers.

  • ⬆️ Up arrow – go to the first page of the previous issue
  • ⬇️ Down arrow – go the the first page of the next issue
  • ⬅️ Left arrow – go to the previous page
  • ➡️ Right arrow – go to the next page

This makes browsing through a newspaper much easier. Enjoy!

To install

Install the Tampermonkey browser extension. Then click on the 'Raw' button above. You'll be asked to confirm that you want to install this script. Just click on 'Install' – don't worry it's perfectly safe.

The next time you load a newspaper page in Trove, your arrow keys will be enabled.

To uninstall

You can temporarily disable the script at any time by clicking on the Tampermonkey icon in your browser's navigation bar and selecting the script from the drop down menu.

You can uninstall the script completely by opening up the Tampermonkey dashboard and deleting the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment