reddit viglink redirect remover

Remove viglink redirects from reddit

目前为 2016-06-25 提交的版本。查看 最新版本

// ==UserScript==
// @name           reddit viglink redirect remover
// @author	       jmesmon
// @description    Remove viglink redirects from reddit
// @include        http://www.reddit.com/*
// @include        https://www.reddit.com/*
// @include        http://reddit.com/*
// @include        https://reddit.com/*
// @grant          GM_log
// @version 0.0.1.20160619212934
// @namespace https://gf.qytechs.cn/users/49902
// ==/UserScript==

(function() {
    'use strict';
    var a = document.getElementsByClassName("affiliate");
    GM_log("Found " + a.length + " affiliate links");
    for (var i=0; i<a.length; i++) {
        if (a[i].tagName != 'A') {
            GM_log("Affiliate class on item with tag " + a[i].tagName + " : " + a[i]);
            continue;
        }
        var url=a[i].getAttribute('data-href-url');
        if (url) {
            a[i].setAttribute('data-affiliate-url',url);
        } else {
            GM_log("Affiliate link has no data-href-url: " + a[i]);
        }
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址