您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Forces all Last.fm music links to include +noredirect to prevent incorrect redirection to similarly named artists. Skips image links.
// ==UserScript== // @name Last.fm: Always Use +noredirect (except image links) // @namespace https://last.fm/ // @version 1.3 // @description Forces all Last.fm music links to include +noredirect to prevent incorrect redirection to similarly named artists. Skips image links. // @author DiCK // @match https://*.last.fm/* // @grant none // ==/UserScript== (function() { 'use strict'; // Update all relevant <a> tags to use +noredirect, except if they already have it or go to /+images/ function fixLinks() { const links = document.querySelectorAll('a[href*="/music/"]'); links.forEach(link => { const href = link.getAttribute('href'); // Skip if the link already contains +noredirect or goes to an image gallery if (href.includes('/+noredirect/') || href.includes('/+images/')) return; // Match both internal and full URLs to /music/<band> const regex = /^(https?:\/\/(www\.)?last\.fm)?\/music\/([^\/?#]+)/; const match = href.match(regex); if (match) { const bandName = match[3]; const newHref = href.replace(`/music/${bandName}`, `/music/+noredirect/${bandName}`); link.setAttribute('href', newHref); } }); } // Run on page load fixLinks(); // Observe the page for dynamically added content and fix links accordingly const observer = new MutationObserver(fixLinks); observer.observe(document.body, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址