Greasy Fork is available in English.

sciencedirect+ieeexplore+tandfonline跳转

sciencedirect+ieeexplore+tandfonline跳转 HFUT

// ==UserScript==
// @name         sciencedirect+ieeexplore+tandfonline跳转
// @namespace    hanzhang
// @version      1.3.1
// @description  sciencedirect+ieeexplore+tandfonline跳转 HFUT
// @author       hanzhang
// @match        https://www.sciencedirect.com/*
// @match        https://ieeexplore.ieee.org/*
// @match        https://www.tandfonline.com/*
// @match        https://www.springer.com/*
// @match        https://link.springer.com/*
// @match        https://onlinelibrary.wiley.com/*
// @require      http://code.jquery.com/jquery-1.11.0.min.js
// @grant        GM_openInTab
// ==/UserScript==
(function() {
    'use strict';
    let link = window.location.host;
    var html_title=new Array()
    html_title[0]= "www.sciencedirect.com"
    html_title[1]= "ieeexplore.ieee.org"
    html_title[2]= "www.tandfonline.com"
    html_title[3]= "www.springer.com"
    html_title[4]= "link.springer.com"
    html_title[5]="onlinelibrary.wiley.com"

    var button = document.createElement("input"); //创建一个input对象(提示框按钮)
    //debugger;
    button.setAttribute("type", "button");
    button.setAttribute("value", "跳转");
    button.style.width = "60px";
    button.style.align = "center";
    button.style.marginLeft = "250px";
    //button.style.paddingBottom="10px";
    button.style.marginBottom = "2px";
    button.style.background = "#ff0000";
    button.style.border = "2px solid " + "#ff0000";//52
   button.style.color = "white";

    button.addEventListener('click', function() {
        //alert("Working");

       // if(link==html_title[0])
    //{
   //     link = location.href;
     //   link = link.replace('www.sciencedirect.com','www-sciencedirect-com-443.webvpn.hfut.edu.cn');
   // }
    if(link==html_title[1])
    {
         link = location.href;
         link = link.replace('ieeexplore.ieee.org','ieeexplore-ieee-org-443.webvpn.hfut.edu.cn');
    }
    if(link==html_title[2])
    {
         link = location.href;
         link = link.replace('www.tandfonline.com','www-tandfonline-com-443.webvpn.hfut.edu.cn');
    }
    //if(link==html_title[3])
   // {
         //link = location.href;
         //link = link.replace('www.springer.com','link-springer-com-443.webvpn.hfut.edu.cn');
    //}
        GM_openInTab(link, { active: true });
    }, false);

    //button.id = "testbutton";
    //button.innerHTML = "This is a button";
    var x;
    link = window.location.host;
     if(link==html_title[0])
    {
        link = location.href;
        link = link.replace('www.sciencedirect.com','www-sciencedirect-com-443.webvpn.hfut.edu.cn');
        GM_openInTab(link, { active: true });
    }
    if(link==html_title[1])
    {
        x = document.getElementById("global-alert-message");
        x.append(button);
    }
    if(link==html_title[2])
    {
        x = document.getElementById("a8a37801-55c7-4566-bdef-e4e738967e38");
        x.append(button);
    }
    if(link==html_title[3])
    {
        link = location.href;
        link = link.replace('www.springer.com','link-springer-com-443.webvpn.hfut.edu.cn');
        GM_openInTab(link, { active: true });
    }
     if(link==html_title[4])
    {
        link = location.href;
        link = link.replace('link.springer.com','link-springer-com-443.webvpn.hfut.edu.cn');
        GM_openInTab(link, { active: true });
    }
    if(link==html_title[5])
    {
        link = location.href;
        if(link.search("onlinelibrary.wiley.com/doi/abs/") != -1)
        {
            link = link.replace('onlinelibrary.wiley.com/doi/abs/','onlinelibrary-wiley-com-443.webvpn.hfut.edu.cn/doi/');
        }
        if(link.search("onlinelibrary.wiley.com/doi/pdf/") != -1)
        {
            link = link.replace('onlinelibrary.wiley.com/doi/pdf/','onlinelibrary-wiley-com-443.webvpn.hfut.edu.cn/doi/');
        }
    }
})();