Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Suno - Hide persistent notifications bar
- // @namespace http://tampermonkey.net/
- // @version 1.3
- // @description Hide the locked notification bar on suno.com
- // @author Kinburril
- // @match https://suno.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- const selector = 'div.inset-0.overflow-y-auto.transition-transform'; // precise selector
- function removeBar(node) {
- if (node && node.matches && node.matches(selector)) {
- node.remove(); // removes the bar completely
- console.log(':white_check_mark: Notification bar removed.');
- return true;
- }
- return false;
- }
- // Initial check if it is already present
- document.querySelectorAll(selector).forEach(el => removeBar(el));
- // Observe changes in DOM (for React dynamic loading)
- const observer = new MutationObserver(mutations => {
- for (let mutation of mutations) {
- for (let node of mutation.addedNodes) {
- if (removeBar(node)) return;
- if (node.querySelectorAll) {
- node.querySelectorAll(selector).forEach(el => removeBar(el));
- }
- }
- }
- });
- observer.observe(document.body, { childList: true, subtree: true });
- })();
Advertisement
Add Comment
Please, Sign In to add comment