Steam Linkfilter Remover

Removes Steams linkfilter url from url on steamcommunity pages, and replaces them with the correct target url. Script writen by https://github.com/corylulu

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu betiği yüklemek için bir betik yöneticisi eklentisi yüklemeniz gerekecektir.

(Zaten bir betik yöneticim var, hadi yükleyelim!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Steam Linkfilter Remover
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Removes Steams linkfilter url from url on steamcommunity pages, and replaces them with the correct target url. Script writen by https://github.com/corylulu
// @author       Ryonez (script by corylulu)
// @match        https://steamcommunity.com/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';

    function processLink(el) {
        var href = el.href;
        if(href) {
            var match = href.match(/https:\/\/steamcommunity.com\/linkfilter\/\?url\=(.*)/);
            if(match) {
                el.href = decodeURIComponent(match[1]);
            }
        }
    }
    // Wait for page to load a bit more, just in case
    setTimeout(function() {
        Array.prototype.forEach.call(document.querySelectorAll('a'), function(el, i) {
            processLink(el);
        });

        // Observer to watch for new links on the page.
        var observer = new MutationObserver(function(mutations) {
            mutations.forEach(function(mutation) {
                if (!mutation.addedNodes) return;
                // For each added node that isn't just plain text, add the same link listener.
                for (var i = 0; i < mutation.addedNodes.length; i++) {
                    var node = mutation.addedNodes[i];
                    if (node.nodeName !== "#text") {
                        Array.prototype.forEach.call(node.querySelectorAll('a'), function(el, i) {
                            processLink(el);
                        });
                    }
                }
            })
        })

        // WARNING: You'll want to tailor this for the site because if it
        //          does a lot of dynamic loading, it can bog things down.
        //          My script monitors for "div.content" to work on reddit,
        //          because that's as specific as I need to be, but using it
        //          on "body" will bog things down when new things load in
        observer.observe(document.querySelector("body"), {
            childList: true
            , subtree: true
            , attributes: false
            , characterData: false
        });
    }, 2000);
})();