-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHide_Some_LBButtons.user.js
More file actions
32 lines (28 loc) · 1.35 KB
/
Hide_Some_LBButtons.user.js
File metadata and controls
32 lines (28 loc) · 1.35 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
28
29
30
31
32
// ==UserScript==
// @name Hide Love, Hate, and Play Buttons on ListenBrainz
// @namespace http://tampermonkey.net/
// @downloadURL https://github.com/YoGo9/Scripts/raw/main/Hide_Some_LBButtons.user.js
// @updateURL https://github.com/YoGo9/Scripts/raw/main/Hide_Some_LBButtons.user.js
// @version 0.2
// @description Hide love, hate, and play buttons on ListenBrainz
// @author YoGo9
// @match https://*listenbrainz.org/user/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Function to hide specified elements
function hideButtons() {
const loveButtons = document.querySelectorAll('.listen-controls .love');
const hateButtons = document.querySelectorAll('.listen-controls .hate');
const playButtons = document.querySelectorAll('.listen-controls .play-button');
loveButtons.forEach(button => button.style.display = 'none');
hateButtons.forEach(button => button.style.display = 'none');
playButtons.forEach(button => button.style.display = 'none');
}
// Run the function on page load
window.addEventListener('load', hideButtons);
// Run again when mutations happen (e.g., when new elements are added dynamically)
const observer = new MutationObserver(hideButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();