|
// ==UserScript== |
|
// @name epdf -> pdf |
|
// @namespace https://gist.github.com/ms609/beaed274ec473fbe0f929d1ea88e4158 |
|
// @version 0.2.2 |
|
// @description Go directly to the PDF, not the "epdf" |
|
// @author Martin R. Smith |
|
// @match https://www.journals.uchicago.edu/doi/* |
|
// @match https://www.lyellcollection.org/doi/* |
|
// @match https://onlinelibrary.wiley.com/doi/* |
|
// @match https://aslopubs.onlinelibrary.wiley.com/doi/* |
|
// @match https://besjournals.onlinelibrary.wiley.com/doi/* |
|
// @match https://bsapubs.onlinelibrary.wiley.com/doi/* |
|
// @match https://esajournals.onlinelibrary.wiley.com/doi/* |
|
// @match https://journals.asm.org/doi/* |
|
// @match https://www.scup.com/doi/* |
|
// @match https://www.idunn.no/doi/* |
|
// @match https://pnas.org/doi/* |
|
// @match https://www.pnas.org/doi/* |
|
// @match https://www-pnas-org.ezphost.dur.ac.uk/doi/* |
|
// @match https://royalsocietypublishing.org/doi/* |
|
// @match https://www.science.org/doi/* |
|
// @match https://www.tandfonline.com/doi/* |
|
// @icon https://www.google.com/s2/favicons?sz=64&domain=wiley.com |
|
// @grant none |
|
// ==/UserScript== |
|
|
|
(function() { |
|
'use strict'; |
|
if (document.location.href.match("/epdf/")) { |
|
document.location.href = document.location.href.replace("/epdf/", "/pdf/"); |
|
} else if (document.location.href.match("/epub/")) { |
|
document.location.href = document.location.href.replace("/epub/", "/pdf/"); |
|
} else { |
|
var anchors = document.getElementsByTagName("a"); |
|
for (var i = 0, len = anchors.length; i < len; i++) { |
|
anchors[i].href = anchors[i].href.replace("/epdf/", "/pdf/"); |
|
anchors[i].href = anchors[i].href.replace("/epub/", "/pdf/"); |
|
} |
|
} |
|
})(); |