Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Don't redirect a pdf link to a abstract link if there's a noredirect=1 parameter
// ==UserScript==
// @name ArxivPdfNoRedirect
// @namespace
// @version 0.1
// @description try to take over the world!
// @author You
// @match*
// @grant none
// @require
// ==/UserScript==
(function() {
'use strict';
var x = $("a[href^='/pdf/']")[0].href.split('/');
var new_url = "/pdf/"+x[x.length-1]+"?noredirect=1";
$("a[href^='/pdf/']")[0].href = new_url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment