AnyChars Standalone Bypass

Автоматически эмулирует режим standalone для AnyChars

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         AnyChars Standalone Bypass
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Автоматически эмулирует режим standalone для AnyChars
// @author       @Shellk0v
// @match        https://app.anychars.fun/*
// @match        https://app.anychars18.ru/*
// @grant        none
// @run-at       document-start
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 1. Подменяем matchMedia ДО того, как сайт запустится
    const originalMatchMedia = window.matchMedia;
    window.matchMedia = function(query) {
        if (query && query.includes('display-mode: standalone')) {
            return {
                matches: true,
                media: query,
                onchange: null,
                addListener: () => {},
                removeListener: () => {},
                addEventListener: () => {},
                removeEventListener: () => {},
                dispatchEvent: () => {}
            };
        }
        return originalMatchMedia.call(window, query);
    };

    // 2. Подменяем navigator.standalone
    try {
        Object.defineProperty(navigator, 'standalone', {
            value: true,
            writable: false,
            configurable: false
        });
    } catch (e) {
        console.warn('Не удалось переопределить navigator.standalone, но matchMedia должен сработать.');
    }

    console.log('🚀 AnyChars Hack: Режим standalone активирован автоматически!');
})();