Tiny URL - Skip Loading Screen

Skip annoying 3 second loading screen on TinyUrl links

2022-06-04 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

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.

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.

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

// ==UserScript==
// @name         Tiny URL - Skip Loading Screen
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Skip annoying 3 second loading screen on TinyUrl links
// @author       JohnFarrell.dev
// @match        https://tinyurl.is/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tinyurl.is
// ==/UserScript==

(function() {
    'use strict';


    // Select the node that will be observed for mutations
    const targetNode = document.querySelector('body');

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

    const callback = function() {
        const skipATag = document.querySelector("ul > li > a")
        if(skipATag) {
            const link = skipATag.href;
            window.location.replace(link);
        }
    }

    // Create an observer instance linked to the callback function
    const observer = new MutationObserver(callback);

    // Start observing the target node for configured mutations
    observer.observe(targetNode, config);
})();