您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
根据 AIAA DOI 链接添加 PDF 下载按钮
// ==UserScript== // @name AIAA PDF Download Button // @name:zh-CN AIAA PDF 下载按钮 // @namespace https://greasyfork.org/zh-CN/users/1335433 // @version 0.3 // @description Add PDF download button based on AIAA DOI link // @description:zh-cn 根据 AIAA DOI 链接添加 PDF 下载按钮 // @author wakewon // @match https://arc.aiaa.org/* // @include *://arc-aiaa-org-s.* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Find the DOI link var doiLink = document.querySelector('.epub-section__doi__text'); if (doiLink) { var doiURL = doiLink.getAttribute('href'); var doi = doiURL.match(/https:\/\/doi.org\/(.*)/)[1]; // Find the "Read Now" button var readNowButton = document.querySelector('a[aria-label=" Read Now"]'); if (readNowButton) { // Create a new "Download Now" button next to the "Read Now" button var downloadNowButton = document.createElement('a'); downloadNowButton.href = '/doi/pdf/' + doi + '?download=true'; downloadNowButton.innerText = ' Download'; downloadNowButton.className = 'ctrl--primary ctrl'; // Add icon to the "Download Now" button var icon = document.createElement('i'); icon.className = 'icon-download'; downloadNowButton.insertBefore(icon, downloadNowButton.firstChild); // Insert the "Download Now" button after the "Read Now" button readNowButton.parentNode.insertBefore(downloadNowButton, readNowButton.nextSibling); } } })();