// ==UserScript== // @name Publication Auto PDF // @name:zh-CN SCI文献PDF直达 // @version 0.2.1 // @author sincostandx // @description Automatically jumps to PDF when you visit a journal article abstract page. Also includes a utility to copy or download citation info. // @description:zh-CN 访问SCI文献摘要页时自动跳转至PDF,附带文献摘录工具 // @include http*://www.sciencedirect.com/science/article/* // @include http*://pubs.acs.org/doi/* // @include http*://www.tandfonline.com/doi/abs/* // @include http*://www.beilstein-journals.org/* // @include http*://onlinelibrary.wiley.com/doi/* // @include http*://www.eurekaselect.com/*/article* // @include http*://pubs.rsc.org/en/Content/* // @include http*://link.springer.com/article* // @include http*://aip.scitation.org/doi/10* // @include http*://aip.scitation.org/doi/abs/10* // @include http*://www.nature.com/articles* // @include http*://science.sciencemag.org/content* // @include http*://journals.aps.org/*/abstract/10* // @exclude *.pdf // @grant GM.xmlHttpRequest // @grant GM.getValue // @grant GM.setValue // @run-at document-start // @namespace https://greasyfork.org/users/171198 // @downloadURL none // ==/UserScript== var tit=null; //title var doi=null; var pdf=null; //pdf url var sty=''; // citation text style if (location.href.includes('pubs.acs.org/doi/abs/')) pdf=location.href.replace('/abs/','/pdf/'); // Works for ACS journals else if (location.href.includes('pubs.acs.org/doi/10.')) pdf=location.href.replace('/doi/','/doi/pdf/'); else if (location.href.includes('journals.aps.org/') && location.href.includes('abstract/10.')) pdf=location.href.replace('/abstract/','/pdf/'); var jump = window.history.length<=1 || sessionStorage.getItem(location.pathname) === null; sessionStorage.setItem(location.pathname,'1'); if (jump && pdf !== null && location.href !== pdf) { window.stop(); location.href=pdf; } else { checkLoaded(); } function checkLoaded() { if (document.body !== null && document.body.innerHTML.length !== 0) loadMeta(); else setTimeout(checkLoaded,100); } function loadMeta() { var titmeta=['dc.title','citation_title']; var doimeta=['citation_doi','dc.identifier','dc.source']; var l=document.getElementsByTagName('meta'); for(var i=0; i