SoundGasm Title Replacer

set window title to current audio

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         SoundGasm Title Replacer
// @namespace    http://tampermonkey.net/
// @version      2026-02-05
// @description  set window title to current audio
// @author       GlawGlack
// @match        https://*.soundgasm.net/u/*/*
// @match        https://soundgasm.theaviary.me/u/*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=soundgasm.net
// @grant        none
// @license      unlicense
// ==/UserScript==

(function() {
    'use strict';
    // check every 500ms on page load until found
    const checkInterval = setInterval(updateTitle, 500);

    function updateTitle() {

        let a = document.querySelector(".jp-title");
        let b = document.querySelector(".jp-details .jp-title");
        let c = document.querySelector(".jp-title > span:nth-child(1)");

        //Soundgasm Improvements case
        if (c !== undefined && c !== null)
        {
            if (document.title != c.innerHTML + " | soundgasm.net")
            {
                document.title = c.innerHTML + " | soundgasm.net"
                clearInterval(checkInterval);
                return;
            }
        }

        if (b !== undefined && b !== null)
        {
            if (document.title != b.innerHTML + " | soundgasm.net")
            {
                document.title = b.innerHTML + " | soundgasm.net"
                clearInterval(checkInterval);
                return;
            }
        }

        if (a !== undefined && a !== null)
        {
            if (document.title != a.innerHTML + " | soundgasm.net")
            {
                document.title = a.innerHTML + " | soundgasm.net"
                clearInterval(checkInterval);
                return;
            }
        }
    }
})();