AnyChars Standalone Bypass

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

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==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 активирован автоматически!');
})();