Qobuz Button Fix

Fix the "Listen on Qobuz" button for open.qobuz.com links

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name        Qobuz Button Fix
// @namespace   Violentmonkey Scripts
// @match       https://open.qobuz.com/*
// @grant       none
// @version     3-10-2026
// @author      Lioncat6
// @description Fix the "Listen on Qobuz" button for open.qobuz.com links
// @icon         https://www.google.com/s2/favicons?sz=64&domain=qobuz.com
// @homepageURL  https://github.com/Lioncat6/Misc-UserScripts
// @supportURL   https://github.com/Lioncat6/Misc-UserScripts/issues
// @license MIT
// ==/UserScript==

let patchRetry = undefined;

(function () {
    'use strict';
    patchRetry = setInterval(() => patchButton(), 100);
    const originalPushState = history.pushState;
    history.pushState = function () { //Watching for location changes, since open.qobuz.com is a react app
        originalPushState.apply(this, arguments);
        patchRetry = setInterval(() => patchButton(), 100);
    };
    window.addEventListener("popstate", (event) => { //Watching for the back/forward buttons being used
        patchRetry = setInterval(() => patchButton(), 100);
    });
})();



function patchButton() {
    console.log("Attempting to patch button")
    let listenButton = document.getElementsByClassName("pct-play")?.[0];
    if (listenButton) {
        listenButton.href = window.location.href.replace("open", "play")
        console.log(listenButton.href)
        clearInterval(patchRetry);
    }
}