ScienceDirect下载

避免跳转在线pdf,可直接下载ScienceDirect文献到本地

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

  1. // ==UserScript==
  2. // @name ScienceDirect Download
  3. // @name:zh-CN ScienceDirect下载
  4. // @namespace tampermonkey.com
  5. // @version 1.3
  6. // @license MIT
  7. // @description Avoid jumping to online pdf, and directly download ScienceDirect literature to local
  8. // @description:zh-CN 避免跳转在线pdf,可直接下载ScienceDirect文献到本地
  9. // @match https://www.sciencedirect.com/*
  10. // @grant none
  11. // ==/UserScript==
  12. (function () {
  13. 'use strict';
  14. // get rawlink
  15. var head = document.head;
  16. // creat newlink
  17. var linkid = head.getElementsByTagName('meta')[0].content;
  18. if (linkid){
  19. var newlink = linkid + '/pdfft?isDTMRedir=true&download=true';
  20. let Container = document.createElement('div');
  21. Container.id = "sp-ac-container";
  22. Container.style.position="fixed"
  23. Container.style.left="300px"
  24. Container.style.top="28px"
  25.  
  26. Container.style['z-index']="999999"
  27. Container.innerHTML =`<a href=${newlink}><input type=button value="download" onclick="window.location.href(${newlink})"><style>input{color:#ffffff;background-color:#3366cc;border:none}</style></a>`
  28. document.body.appendChild(Container);
  29. console.log(newlink)}
  30. })();