extension TGPlugs Developer Guide

Create Powerful Mods for TGBrowser
For TGMod v1 to v3-secure
rocket_launch

What Are TGPlugs?

TGPlugs are modular extensions for TGBrowser that unlock endless possibilities for customization and utility. By tapping into the browser's core, you can:

new_releases

What's New?

security Enhanced Security & Validation

  • TGUID System: All TGPlugs MUST register with a unique identifier (e.g., com.shaman.darktheme).
  • Gatekeeper Protection: Mods without valid registration will now trigger security warnings in the console.

warning Breaking Changes

CRITICAL: Old mods without window.TGMoLink.register() will trigger security warnings. You must update your mods to the new standard immediately.

folder

File Structure

A standard TGPlug follows this strict directory structure to ensure the loader recognizes it correctly.

github repo for tgplugs/ └── YourModFolder/ (or TGUID) ├── style.css (optional, visual) └── main.js (required, logic)
code

Basic Template

main.js (Required)

This is the standard boilerplate for a secure TGPlug.

// TGPlug: Midnight Theme // TGUID: com.shaman.midnighttheme (function() { 'use strict'; const MOD_ID = 'com.shaman.midnighttheme'; // Check if API exists if (window.TGMoLink && window.TGMoLink.register) { window.TGMoLink.register(MOD_ID); init(); } else { // Retry logic for async loading const check = setInterval(() => { if (window.TGMoLink && window.TGMoLink.register) { clearInterval(check); window.TGMoLink.register(MOD_ID); init(); } }, 100); } function init() { console.log("Mod Loaded!"); // Your logic here } })();
verified

Best Practices

1

Always Register with TGUID

Without registration, your mod is flagged as unsafe by the Gatekeeper system.

2

Namespace Your Code

Use IIFE (Immediately Invoked Function Expressions) to avoid polluting the global scope and conflicting with other mods.

3

Security First

Never store sensitive data (passwords, auth tokens) in localStorage where other mods could read them.