// ==UserScript== // @name Bypass paywalls for scientific documents // @name:it Bypassa le richieste di pagamento per i documenti scientifici // @namespace StephenP // @version 3.3.7 // @description Bypass paywalls for scientific documents by downloading them from sci-hub instead of paying something like 50 bucks for each paper. This script adds download buttons on Google Scholar, Scopus and Web Of Science, which lead to sci-hub. In this way you can get free access to scientific papers even if you or your university can't afford their prices. // @description:it Bypassa le richieste di pagamento per i documenti scientifici scaricandoli da sci-hub invece di pagarli qualcosa come 50 sacchi ciascuno. Questo script aggiunge i tasti per scaricare su Google Scholar, Scopus e Web Of Science, che indirizzano a sci-hub. In questo modo puoi ottenere l'accesso gratuito ai documenti scientifici anche se tu o la tua università non potete permettervi il loro costo. // @author StephenP // @include http://scholar.google.*/scholar?* // @match http://www.scopus.com/record/display.uri?* // @match http://apps.webofknowledge.com/full_record.do?* // @match http://apps.webofknowledge.com/InterService.do?* // @match http://apps.webofknowledge.com/CitedFullRecord.do?* // @include https://scholar.google.*/scholar?* // @match https://www.scopus.com/record/display.uri?* // @match https://apps.webofknowledge.com/full_record.do?* // @match https://apps.webofknowledge.com/InterService.do?* // @match https://apps.webofknowledge.com/CitedFullRecord.do?* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; //If Sci-Hub address changes, just replace the URL below with the new one var sciHubUrl='https://sci-hub.do/'; var documentId; var site=window.location.href.toString(); var i; if(site.includes("://www.scopus.com/")){ try{ var fullDocument=document.createElement("LI"); fullDocument.innerHTML="Full text from Sci-Hub"; fullDocument.style.cursor="pointer"; fullDocument.style.color="#ff6c00"; console.log("::Bypass paywalls for scientific documents:: Obtaining document id..."); documentId=document.getElementById("recordDOI").innerHTML; console.log("::Bypass paywalls for scientific documents:: Document id is "+documentId); fullDocument.addEventListener('click',function(){window.open(sciHubUrl+documentId)}); console.log("::Bypass paywalls for scientific documents:: Finding a place where to put the Sci-Hub button..."); document.getElementById('quickLinks').children[0].appendChild(fullDocument); console.log("::Bypass paywalls for scientific documents:: Sci-Hub button placed!"); var donateBtn=document.createElement("LI"); donateBtn.innerHTML="Donate to Sci-Hub"; donateBtn.style.cursor="pointer"; donateBtn.addEventListener('click',function(){donate(sciHubUrl)}); console.log("::Bypass paywalls for scientific documents:: Finding a place where to put the donation button..."); document.getElementById('quickLinks').children[0].appendChild(donateBtn); console.log("::Bypass paywalls for scientific documents:: Donation button placed!"); } catch(err){ console.log("::Bypass paywalls for scientific documents:: Error! "+err); } } else if(site.includes("://apps.webofknowledge.com/")){ var mode; var genericID=document.getElementsByClassName("block-record-info block-record-info-source")[0].getElementsByClassName("FR_label"); for(i=0;i<=genericID.length;i++){ if((genericID[i].innerHTML==="DOI:")||(genericID[i].innerHTML==="PMID:")){ documentId=genericID[i].parentNode.children[1].innerHTML; console.log(documentId); break; } } if(documentId!==undefined){ addButtonWOS(sciHubUrl,documentId); } } else if(site.includes("://scholar.google.")){ var resourcesList=document.getElementById('gs_res_ccl_mid'); var results=resourcesList.children.length; var gs_ggs_gs_fl; for(i=0;iDonate to Sci-Hub project'); list.lastChild.lastChild.removeAttribute("href"); list.lastChild.lastChild.addEventListener("click", function(){donate(sciHubUrl);}); list.lastChild.lastChild.style.cursor="pointer"; fTBtn.parentNode.insertBefore(sciHubBtn, fTBtn); //list.insertBefore(sciHubBtn,list.lastChild); } catch(err){ console.log(err); } //setAttribute('onclick',donate(sciHubUrl)); } function addButtonScholar(sciHubUrl,linkDiv){ //alert(linkDiv.innerHTML); var link; try{ link=linkDiv.getElementsByTagName("A")[0].href; } catch(err){ link=linkDiv.parentNode.getElementsByClassName("gs_rt")[0].getElementsByTagName("A")[0].href; } if(link.includes("scholar?output")){ link=linkDiv.parentNode.getElementsByClassName("gs_rt")[0].getElementsByTagName("A")[0].href; } if(link!=undefined){ var creatingElement; if((link!=undefined)&&(link.search("patents.google")==-1)){ creatingElement=document.createElement("a"); creatingElement.innerHTML='Search on Sci-Hub'; linkDiv.getElementsByClassName("gs_or_ggsm")[0].appendChild(creatingElement); linkDiv.getElementsByClassName("gs_or_ggsm")[0].lastChild.addEventListener("click", function(){window.open(sciHubUrl+link);}); linkDiv.getElementsByClassName("gs_or_ggsm")[0].lastChild.style.cursor="pointer"; //setAttribute("onclick",'window.open(\"'+sciHubUrl+link+'\");'); } } document.head.innerHTML = document.head.innerHTML.replace(/13px 8px 9px 8px/g, '0px 8px 0px 8px'); } function donate(sciHubUrl){ window.open(sciHubUrl+'#donate'); }