True Links for wenku8

Decrypt all flashget links in wenku8.cn

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        True Links for wenku8
// @namespace   http://inecmc.blogspot.com
// @description Decrypt all flashget links in wenku8.cn
// @include     http://www.wenku8.cn/*
// @version     0.5
// @grant       none
// ==/UserScript==

(function() {

    var links = document.querySelectorAll("a[onclick^='con']");  
    for(var i=0;i<links.length;i++){
        var dirtyLink = links[i].getAttribute("onclick");
        var start = dirtyLink.indexOf("http");
        var end = dirtyLink.indexOf("',");
        var trueLink = dirtyLink.substring(start,end);
        links[i].removeAttribute("oncontextmenu");
        links[i].removeAttribute("onclick");
        links[i].setAttribute("href",trueLink);      
    }    
})();