您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replaces the original download button to a one that redirects to the mp3 file page.
当前为
// ==UserScript== // @name Samplefocus Downloader // @namespace http://tampermonkey.net/ // @version 1.0 // @description Replaces the original download button to a one that redirects to the mp3 file page. // @author ToxicBiohazard // @match *://*.samplefocus.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const originalLink = document.querySelector('.download-link'); if (!originalLink) { console.warn('Original download link not found.'); return; } const audioElement = document.querySelector('audio'); if (!audioElement || !audioElement.src) { console.error('No audio element found or no source loaded.'); return; } const audioSrc = audioElement.src; const downloadSample = () => { if (confirm('Download the audio sample?')) { const link = document.createElement('a'); link.href = audioSrc; link.download = 'extracted-audio.mp3'; document.body.appendChild(link); link.click(); document.body.removeChild(link); } }; const downloadButton = document.createElement('button'); downloadButton.classList.add('btn-large', 'waves-effect', 'waves-light'); downloadButton.textContent = 'Download Sample'; downloadButton.addEventListener('click', downloadSample); originalLink.parentNode.replaceChild(downloadButton, originalLink); })();