// ==UserScript==
// @name         Pastebin URL Converter
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Convert Pastebin iframe embed URLs to JS embed format
// @match        https://www.thecoli.com/threads/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to convert Pastebin embed URL
    function convertPastebinURL(oldURL) {
        // Extract the paste ID from the old URL format
        const pasteIDMatch = oldURL.match(/\?i=([A-Za-z0-9]+)/);

        if (pasteIDMatch && pasteIDMatch[1]) {
            const pasteID = pasteIDMatch[1];
            return `https://pastebin.com/embed_js/${pasteID}`;
        }

        return oldURL;
    }

    // Function to modify iframe sources
    function modifyIframes() {
        const iframes = document.querySelectorAll('iframe');

        iframes.forEach(iframe => {
            if (iframe.src.includes('pastebin.com/embed_iframe.php')) {
                const newSrc = convertPastebinURL(iframe.src);
                iframe.src = newSrc;
            }
        });
    }

    // Run the modification when the page loads
    modifyIframes();

    // Optional: Use a MutationObserver to handle dynamically loaded content
    const observer = new MutationObserver(modifyIframes);
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();
Edit

Pub: 07 Feb 2026 19:38 UTC

Edit: 07 Feb 2026 19:43 UTC

Views: 10