Greasy Fork

arXiv Redirect

Slove the "Access Denied" problem in arXiv

目前为 2017-09-09 提交的版本。查看 最新版本

// ==UserScript==
// @name         arXiv Redirect
// @include      https://arxiv.org/*
// @version      0.6
// @description  Slove the "Access Denied" problem in arXiv
// @author       Daqing Liu

// @date         2017.09.09

// @namespace    http://liudaqing.top
// ==/UserScript==

var content;
var CheckStr = 'Access Denied';
var IsRedirect = false;

str = document.getElementsByTagName('h1');

var i;
for (i = 0; i < str.length; i++) {
    content = str[i].innerText;
    if(content.indexOf(CheckStr) != -1){
        IsRedirect = true;
    }
}

if(IsRedirect){
    var url = window.location.toString();
    window.location = url.replace('https://arxiv.org/', 'http://cn.arxiv.org/');
}