Grok Dev Tools

Enables the Dev Tools menu in settings on grok.com

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Grok Dev Tools
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Enables the Dev Tools menu in settings on grok.com
// @author       Blankspeaker
// @match        https://grok.com/*
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==

(function() {
    'use strict';

    try {
        // Check localStorage availability
        let localStorageAvailable = true;
        try {
            localStorage.setItem("test", "test");
            localStorage.removeItem("test");
        } catch (error) {
            localStorageAvailable = false;
            console.warn("localStorage is restricted:", error);
        }

        // Get current flags or initialize
        let rawFlags = localStorageAvailable ? localStorage.getItem("local_feature_flags") : null;
        let currentFlags = rawFlags ? JSON.parse(rawFlags) : {};

        // Set SHOW_MODEL_CONFIG_OVERRIDE flag
        currentFlags['SHOW_MODEL_CONFIG_OVERRIDE'] = true;

        // Save updated flags
        if (localStorageAvailable) {
            localStorage.setItem("local_feature_flags", JSON.stringify(currentFlags));
            console.log("SHOW_MODEL_CONFIG_OVERRIDE enabled and saved.");
        } else {
            console.warn("SHOW_MODEL_CONFIG_OVERRIDE set in memory due to localStorage restrictions.");
        }
    } catch (error) {
        console.error("Error setting SHOW_MODEL_CONFIG_OVERRIDE:", error);
    }
})();