Skip to content

Instantly share code, notes, and snippets.

@Conal-Tuohy
Last active November 7, 2017 13:19
Show Gist options
  • Save Conal-Tuohy/5f48ede761bdf1de4a871af77e4ff341 to your computer and use it in GitHub Desktop.
Save Conal-Tuohy/5f48ede761bdf1de4a871af77e4ff341 to your computer and use it in GitHub Desktop.
Userscript for the National Library of Australia's Trove portal; sets the browser's location URL to be the canonical URL of the work
// ==UserScript==
// @name Canonicalise Trove work URI
// @namespace http://conaltuohy.com/
// @version 0.1
// @description Sets the browser location URL to the canonical URL of the work
// @author Conal Tuohy (@conal_tuohy)
// @match http://trove.nla.gov.au/work/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.history.pushState({}, '', document.querySelector('dl.details dd a').getAttribute('href'));
})();
@Conal-Tuohy
Copy link
Author

Conal-Tuohy commented Nov 7, 2017

Ensure you have TamperMonkey installed, then click to install Canonicalise Trove Work URI; TamperMonkey should then prompt you to install the userscript.

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