.<*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.

当前为 2025-03-16 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==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');
        }
    });
})();