Porkbun Links

makes unavailable links in porkbun clickable so you can snoop on those bastards who stole your domain options!

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install an extension such as Stylus to install this style.

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

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

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

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Porkbun Links
// @namespace    http://porkbun.com/
// @version      0.3
// @description  makes unavailable links in porkbun clickable so you can snoop on those bastards who stole your domain options!
// @author       StuffBySpencer
// @match        https://porkbun.com/checkout/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Options for the observer (which mutations to observe)
    const config = { attributes: true, childList: true, subtree: true };

    // Callback function to execute when mutations are observed
    const callback = function(mutationsList, observer) {
        // Use traditional 'for loops' for IE 11
        for(const mutation of mutationsList) {
            if (mutation.type === 'attributes' && mutation.attributeName === 'class' && mutation.target.classList.contains('unavailableDomain')) {
                let link = mutation.target;
                let url = link.innerText;
                link.innerHTML = `<a href="http://${url}" target="_blank">${url}</a>`;
            }
        }
    };


    // Select the node that will be observed for mutations
    const domains = document.querySelectorAll('.searchResultRow');

    for (let i = 0; i < domains.length; i++) {
        // Create an observer instance linked to the callback function
        const observer = new MutationObserver(callback);

        // Start observing the target node for configured mutations
        observer.observe(domains[i], config);
    }
})();