Qobuz Mobile Overlay Bypass

Bypass Qobuz's mobile width warning by spoofing width and removing overlay

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Qobuz Mobile Overlay Bypass
// @namespace    https://tesla.com
// @version      1.0.0
// @description  Bypass Qobuz's mobile width warning by spoofing width and removing overlay
// @author       AI :)
// @license      MIT
// @locale       en
// @icon         https://www.google.com/s2/favicons?sz=32&domain_url=https%3A%2F%2Fqobuz.com
// @match        https://*.qobuz.com/*
// @run-at       document-idle
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const spoofWidth = 1280;

    const spoofProperty = (obj, prop) => {
        Object.defineProperty(obj, prop, {
            get: () => spoofWidth,
            configurable: true
        });
    };

    spoofProperty(window, 'innerWidth');
    spoofProperty(screen, 'width');
    spoofProperty(document.documentElement, 'clientWidth');

    const removeOverlay = () => {
        const overlay = document.querySelector('.mobileOverlay');
        if (overlay) overlay.remove();

        document.body.style.overflow = 'auto';
        document.body.style.pointerEvents = 'auto';
        document.documentElement.style.overflow = 'auto';
        document.documentElement.style.pointerEvents = 'auto';

        document.body.classList.remove('no-scroll', 'no-interaction', 'mobile-only');
    };

    window.addEventListener('DOMContentLoaded', removeOverlay);
    window.addEventListener('load', removeOverlay);
    setTimeout(removeOverlay, 1000);
})();