-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathQuickAddCoverLink.user.js
More file actions
27 lines (24 loc) · 1.03 KB
/
QuickAddCoverLink.user.js
File metadata and controls
27 lines (24 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ==UserScript==
// @name MusicBrainz Quick Add Cover Art
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Adds an "Add Cover Art" link to release edit search results on MusicBrainz.
// @match *://musicbrainz.org/search/edits*
// @match *://beta.musicbrainz.org/search/edits*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Select all release links in the edit search results
document.querySelectorAll("a[href*='/release/']").forEach(link => {
// Create the new "Add Cover Art" link
const coverArtLink = document.createElement('a');
coverArtLink.textContent = "Add Cover Art";
coverArtLink.href = link.href + "/cover-art";
coverArtLink.style.marginLeft = "10px";
coverArtLink.style.color = "blue";
coverArtLink.style.textDecoration = "underline";
// Insert the "Add Cover Art" link after the existing release link
link.parentNode.insertBefore(coverArtLink, link.nextSibling);
});
})();