Skip to content

Instantly share code, notes, and snippets.

Embed
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 http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://arxiv.org/abs/*
// @grant none
// @require https://code.jquery.com/jquery-3.2.1.min.js
// ==/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