PPRuNe Forums - View Single Post - Links won't open
View Single Post
Old 16th Dec 2013, 02:32
  #26 (permalink)  
areobat
 
Join Date: May 2008
Location: USA
Posts: 44
Likes: 0
Received 0 Likes on 0 Posts
Yes, indeed, I had something to do with the script on the MB forum (I am a senior member there), although I did not write that actual script. Another member stepped up and did the heavy lifting because I kept procrastinating about it. I have adapted the script to various other sites, including this one.

For those not familiar with Greasemonkey, it is an add-on script manager for Firefox that lets you run scripts to control the behavior of the websites you visit. To use it, install Firefox (if you don't have it already) and then go to Get Add-ons, search for Greasemonkey, and the install it. Make sure Greasemonkey is turned on.

Then, copy the text below and paste it into Notepad:



// ==UserScript==
// @name viglink redirect remover for PPRUNE
// @namespace org.pprune
// @description Removes ad redirects that are added to links on forums.
// @include http: // * . pprune . org / *
// @grant GM_log
// ==/UserScript==


(function() {
var a = document.getElementsByTagName("a");
for (var i=0; i<a.length; i++) {
// Example: document.getElementsByTagName("a")[104].href
if (a[i].href.match(/apicdn\.viglink\.com/)) {
var realurl = /[?&]out=([^&]*)/.exec(a[i].search)[1];
if (realurl) {
a[i].href = decodeURIComponent(realurl);
} else {
GM_log("Hmm, maybe the parameter name 'out' changed and broke things");
}
}
}
})();


Note in order to prevent viglink from inserting itself in the "link" after // @include above (bolded) I have added extra spaces. After you paste this into Notepad, you must remove the spaces which I have inserted to prevent viglink from "parsing" it.

Save the file to someplace like your desktop with a file name like PPRUNE.user.js. Whatever name you choose, it MUST end with .user.js . Close Notepad. Then open Firefox and go to File | Open and navigate to the desktop and select the file you saved above. Greasemonkey will recognized is as an installable script and ask you if you want to do that. Say yes, of course. Reload pprune.org and viglink will be gone.


The link in this thread above without the script will look like:

http://apicdn.viglink.com/api/click?format=go&key=1e857e7500cdd32403f752206c297a3d&loc=htt p://www.pprune.org/computer-internet-issues-troubleshooting/528488-links-wont-open-2.html&out=http://support.microsoft.com/kb/175775%23method1&ref=http://www.pprune.org/newreply.php%3Fdo%3Dpostreply%26amp%3Bt%3D528488

You can clearly see the viglink intercept.

After the script, it is:

Nothing happens when you click a link in Internet Explorer

Enjoy!

Last edited by areobat; 16th Dec 2013 at 02:57. Reason: corrections
areobat is offline