TUM eAccess Redirector

Automatically redirect to the proxified equivalent as provided by the libary of the Technische Universitaet Muenchen via the eAccess-System. TUM credentials required.

目前为 2016-07-31 提交的版本。查看 最新版本

// ==UserScript==
// @name         TUM eAccess Redirector
// @name:de      TUM eAccess Redirector
// @version      0.3.2.1
// @description  Automatically redirect to the proxified equivalent as provided by the libary of the Technische Universitaet Muenchen via the eAccess-System. TUM credentials required.
// @description:de   Userscript, dass auf einigen Seiten, mit denen die Universitätsbiblothek der Technischen Universität München kooperiert, die eAccess-Version aufruft.
// @author       zsewa
// @namespace https://gf.qytechs.cn/users/57483

// @match *://*.eaccess.ub.tum.de/*

// @match *://opac.ub.tum.de/InfoGuideClient.tumsis/*
// @match *://bvb-new-primo.hosted.exlibrisgroup.com/primo_library/libweb/action/search.do*vid=49BVB_TUM01_VU1*
// @match *://bvb-new-primo.hosted.exlibrisgroup.com/primo_library/libweb/action/dlSearch.do*vid=49BVB_TUM01_VU1*
// @match *://mediatum.ub.tum.de/*
// @match *://sfx.bib-bvb.de/*
// @match *://ezb.uni-regensburg.de/ezeit/*bibid=TUM*
// @match *://ezb.uni-regensburg.de/*bibid=TUM*
// @match *://ezb.uni-regensburg.de/index.phtml*bibid=TUM*
// @match *://rzblx1.uni-regensburg.de/ezeit/ezb.phtml*bibid=TUM*
// @match *://rzblx10.uni-regensburg.de/dbinfo/*
// @match *://dbis.uni-regensburg.de/dbinfo/dbliste.php*bibid=TUM*

// @match *://science.sciencemag.org/*
// @match *://www.sciencedirect.com/*
// @match *://www.nature.com/*

// @match *://*.thieme-connect.de/*
// @match *://link.springer.com/*
// @match *://springer.com/*

// @match *://apps.webofknowledge.com/*
// @match *://www.emeraldinsight.com/*
// @match *://www.degruyter.com/*
// @match *://ieeexplore.ieee.org/*
// @match *://onlinelibrary.wiley.com/*
// @match *://www.worldscientific.com/*
// @match *://ebooks.worldscinet.com/*
// @match *://*.ncbi.nlm.nih.gov/*
// @match *://*.tandfonline.com/*
// @match *://*.biochemj.org/*
// @match *://*.aappublications.org/*
// @match *://*.ovid.com/*
// @match *://*.scopus.com/*
// @match *://*.annualreviews.org/*
// @match *://*.thiemebilddatenbankanatomie.de/*
// @match *://*.jove.com/*
// @match *://*.jstor.org/*
// @match *://app.knovel.com/*
// @match *://tecfinder.wti.frankfurt.de/*
// @match *://*.gbv.de/*
// @match *://roempp.thieme.de/*
// @match *://*.cas.org/*
// @match *://stneasy.fiz-karlsruhe.de/*
// @match *://*.umwelt-online.de/*

// @match *://*.acs.org/*
// @match *://*.rsc.org/*
// @match *://*.gbv.de/*
// @match *://www.reaxys.com/*

// @match *://*.aacrjournals.org/*
// @match *://*.bmj.com/*
// @match *://www.hematologylibrary.org/*
// @match *://www.karger.com/*
// @match *://web.b.ebscohost.com/*
// @match *://search.ebscohost.com/*
// @match *://*.agu-hochschulen.de/*
// @match *://elibrary.asabe.org/*

// @match *://www.hanser-elibrary.com/*

// @match *://www.ami-informiert.de/*
// @match *://www.allthatstats.com/*
// @match *://www.oecd-ilibrary.org/*

// @match *://www.ams.org/*
// @match *://www.ems-ph.org/*
// @match *://*.siam.org/*
// @match *://zbmath.org/*
// @match *://proquest.tech.safaribooksonline.de/*
// @match *://www.zentralblatt-math.org/*

// @match *://error.incites.thomsonreuters.com/error/Error*DestApp=IC2ESI&*Error=IPError
// @match *://error.incites.thomsonreuters.com/error/Error*DestApp=IC2JCR&*Error=IPError
// @match *://login.webofknowledge.com/error/Error*Error=IPError

// @match *://global.factiva.com/

// @match *://www.video2brain.com/*

// @grant GM_setValue
// @grant GM_getValue
// @grant GM_addStyle

// ==/UserScript==

/*
not working (externam permitted):
UPTODATE ://www.uptodate.com/
Chemical abstracts http://webcsd.ccdc.cam.ac.uk
DIN-Normen etc. ://tum.eresearchcenter.eu
Emerald http://www.emeraldgrouppublishing.com

not working:
*/

function core(mode){
    var html = '<center><img src="http://www.ub.tum.de/files/eacessbutton.jpg" height="40" width="40"></div><br><br>Resource is reloaded via TUM eAccess...<br><br>You are redirected form '+window.location.hostname+' to the fitting resource in the TUM eAccess system. Login may be required.<br><br>To change the behavior of this userscript open it in your Tapermonkey or Greasemonkey extention. You can specify a mode there.<br><br><br><br><br><br>Thanks for using TUM eAccess Redirector.</center>';

    var domain = location.href;
    var hostname = document.location.hostname;
    //special rules - bugfixes
    //Reaxys
    if(domain.indexOf('www.reaxys.com/reaxys/session.do') != -1){var domain = 'https://www-reaxys-com.eaccess.ub.tum.de/reaxys/secured/search.do';}
    //Essential science indicators Thomas Reuters InCites
    if(hostname == 'error.incites.thomsonreuters.com' && domain.indexOf('error.incites.thomsonreuters.com/error/Error?DestApp=IC2ESI') != -1){var domain = 'https://esi.incites.thomsonreuters.com/IndicatorsAction.action';}
    //Journal Citation Reports Thomas Reuters InCites
    if(hostname == 'error.incites.thomsonreuters.com' && domain.indexOf('error.incites.thomsonreuters.com/error/Error?DestApp=IC2JCR') != -1){var domain = 'https://jcr.incites.thomsonreuters.com/JCRJournalHomeAction.action';}
    //WebofScience/WebofKnowledge
    if(hostname == 'login.webofknowledge.com'){var domain = 'https://apps.webofknowledge.com/';}
    
    switch(mode) {
        case 1:
            //confirmation mode
            if (window.confirm("Redirect to TUM eAccess?")){void(window.document.location.replace('https://eaccess.ub.tum.de/login?url='+domain));} else {
                if (window.prompt("To exclude this site ("+document.location.hostname+") permanently from redirect rules type 'yes'") == 'yes'){excludeme(); window.location.reload();}
            }
            break;
        case 2:
            //html page mode
            document.write(html);
            void(location.href='https://eaccess.ub.tum.de/login?url='+domain); //default way to reload via eacess
            break;
        default:
            //default mode - silent
            void(window.document.location.replace('https://eaccess.ub.tum.de/login?url='+domain));
    }
}

function set_usermode(value){
    GM_setValue('eAccess_reloader_mode', value);
}

function excludeme(){
    var hostname_temp = document.location.hostname;
    var excluseme_userexclude_temp = GM_getValue('eAccess_reloader_userexclude', []); if(excluseme_userexclude_temp.indexOf(hostname_temp) == -1){excluseme_userexclude_temp.push(hostname_temp);}
    //var excluseme_userexclude_temp = []; //reset via decommenting
    GM_setValue('eAccess_reloader_userexclude', excluseme_userexclude_temp);
    alert(GM_getValue('eAccess_reloader_userexclude', [])+' is excluded.');
}

function excludeme_reset(){
    var excluseme_userexclude_temp = []; //reset via decommenting
    GM_setValue('eAccess_reloader_userexclude', excluseme_userexclude_temp);
}

function markaseaccess(){
    $("body").prepend ( '<a><div id="eAccess_userscript_created_content" style="z-index:9000;float:true;bottom:1.5%;right:1.5%;position:fixed;">By <img src="https://www.tum.de/typo3conf/ext/in2template/Resources/Public/Images/tum-logo.svg" height="28 px">&nbsp;&nbsp;<img src="https://www.ub.tum.de/files/eacessbutton.jpg" height="28px" width="28px"></div></a>');
}

(function() {

    'use strict';
    //modes:
    //0: Default = Silent, redirect without showing a html page
    //1: Confirmation, ask always before reload, exclude some pages manualy
    //2: HTML page mode, show a redirect page; may cause problems with history
    //set_usermode(0); //decomment and load some page with redirection
    var usermode = GM_getValue('eAccess_reloader_mode', 0);

    var hostname = document.location.hostname;

    //exclude via hostname
    var userexclude = GM_getValue('eAccess_reloader_userexclude', []);
    //excludeme_reset(); //decomment and load some page with redirection to reset user rules

    if( hostname.indexOf('eaccess.ub.tum.de') == -1){
        if( userexclude.indexOf(hostname) == -1 ){
            core(usermode);
        }
    } else {markaseaccess();}

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址