您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Highlights matching ISRCs in green and non-matches red
当前为
// ==UserScript== // @name ISRC Hunt: Highlight ISRC matches and differences // @namespace https://musicbrainz.org/user/chaban // @version 1.1.1 // @description Highlights matching ISRCs in green and non-matches red // @tag ai-created // @author chaban // @license MIT // @match *://isrchunt.com/spotify/importisrc // @match *://isrchunt.com/deezer/importisrc // @grant none // ==/UserScript== (function() { 'use strict'; const table = document.querySelector('.table'); if (!table) { return; } const rows = table.querySelectorAll('tr'); for (let i = 1; i < rows.length; i++) { const row = rows[i]; const spotifyIsrcCell = row.querySelector('td:nth-child(4)'); const mbIsrcCell = row.querySelector('td:nth-child(7)'); if (spotifyIsrcCell && mbIsrcCell) { const spotifyIsrcs = spotifyIsrcCell.textContent.trim().split(',').map(isrc => isrc.trim().toLowerCase()); const mbIsrcsLowercased = mbIsrcCell.textContent.trim().split(',').map(isrc => isrc.trim().toLowerCase()); const mbIsrcsSetLowercased = new Set(mbIsrcsLowercased); const originalMbIsrcs = mbIsrcCell.textContent.trim().split(',').map(isrc => isrc.trim()); let spotifyHtml = ''; spotifyIsrcs.forEach((sIsrcLower, index) => { const originalSIsrc = spotifyIsrcCell.textContent.trim().split(',')[index].trim(); const bgColor = mbIsrcsSetLowercased.has(sIsrcLower) ? 'lightgreen' : 'salmon'; spotifyHtml += `<span style="background-color: ${bgColor};">${originalSIsrc}</span>`; if (index < spotifyIsrcs.length - 1) { spotifyHtml += ', '; } }); spotifyIsrcCell.innerHTML = spotifyHtml; const spotifyIsrcsSetLowercased = new Set(spotifyIsrcs); let mbHtml = ''; originalMbIsrcs.forEach((originalMIsrc, index) => { const mIsrcLower = mbIsrcsLowercased[index]; const bgColor = spotifyIsrcsSetLowercased.has(mIsrcLower) ? 'lightgreen' : 'salmon'; mbHtml += `<span style="background-color: ${bgColor};">${originalMIsrc}</span>`; if (index < originalMbIsrcs.length - 1) { mbHtml += ', '; } }); mbIsrcCell.innerHTML = mbHtml; } } })();