.<*Gartic-Viewer*>.

A Gartic script that allows you to enter a room as a viewer with a simple right-click on the desired room name in Gartic.

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         .<*Gartic-Viewer*>.
// @namespace    http://tampermonkey.net/
// @version      1.0.2
// @description  A Gartic script that allows you to enter a room as a viewer with a simple right-click on the desired room name in Gartic.
// @author       Scripter_Plus
// @match        *://gartic.io/*
// @grant        none
// @icon         https://static.roocket.ir/images/avatar/2024/4/29/f2Sqmpbwyp6tvzs6kMVRVilOBr7fRO0RIYnW3Tzt.png
// ==/UserScript==

(function() {
    'use strict';

    document.addEventListener('contextmenu', function(event) {
        let target = event.target.closest('a');
        if (target && target.href.includes("gartic.io")) {
            event.preventDefault();
            let viewerURL = target.href + "/viewer";
            window.open(viewerURL, '_blank');
        }
    });
})();