TrixBox

Embeds the TrixBox chat for territorial.io and FXclient.

اعتبارا من 11-11-2025. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey 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 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.

You will need to install a user script manager extension to install this script.

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

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         TrixBox
// @namespace    http://tampermonkey.net/
// @version      0.0.1
// @description  Embeds the TrixBox chat for territorial.io and FXclient.
// @author       Painsel
// @match        https://territorial.io/*
// @match        https://fxclient.github.io/FXclient/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 1. Append the main chat library to the <head> of the page.
    const chatLibraryScript = document.createElement('script');
    chatLibraryScript.src = 'https://iframe.chat/scripts/main.min.js';
    document.head.appendChild(chatLibraryScript);

    // 2. Create and append the chatbox iframe to the <body>.
    const chatIframe = document.createElement('iframe');
    chatIframe.src = 'https://iframe.chat/embed?chat=15234533';
    chatIframe.id = 'chattable';

    // Basic styling to make the chatbox a floating element in the corner.
    // You can adjust these values as needed.
    chatIframe.style.position = 'fixed';
    chatIframe.style.bottom = '15px';
    chatIframe.style.right = '15px';
    chatIframe.style.width = '350px';
    chatIframe.style.height = '500px';
    chatIframe.style.border = '1px solid #cccccc';
    chatIframe.style.borderRadius = '8px';
    chatIframe.style.boxShadow = '0 2px 10px rgba(0,0,0,0.2)';
    chatIframe.style.zIndex = '99999'; // High z-index to appear over other elements

    document.body.appendChild(chatIframe);

    // 3. Initialize the chat once the main library has loaded.
    // This ensures that the 'chattable' object is available before we try to use it.
    chatLibraryScript.onload = function() {
        const initializationScript = document.createElement('script');
        // Since no chattable.css file was provided, we call initialize without parameters.
        initializationScript.textContent = 'chattable.initialize({});';
        document.body.appendChild(initializationScript);
    };
})();