Author Topic: Remove Yahoo tracking script  (Read 1626 times)

0 Members and 1 Guest are viewing this topic.

Offline polonus

  • Avast Überevangelist
  • Probably Bot
  • *****
  • Posts: 32820
  • malware fighter
Remove Yahoo tracking script
« on: October 17, 2006, 09:42:28 AM »
Hi malware fighters,

To remove Yahoo tracking you could use the following JavaScript,
------------------------------------
// Updated April 2, 2006
// Now removes all ylt strings.
//
// ==UserScript==
// @name          Yahoo Link Tracking Removal
// @namespace     http://www.userscripts.org/scripts/show/3642
// @description     Remove Yahoo Link Tracking (ylt)
// @include       http://*.yahoo.com/*
// ==/UserScript==

(function()
{
   function selectNodes(doc, context, xpath)
   {
      var nodes = doc.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
      var result = new Array( nodes.snapshotLength );
      
      for (var x=0; x<result.length; x++)
      {
         result
  • = nodes.snapshotItem(x);

      }
      
      return result;
   }
   
   doc = window.document;
   
   var allLinks = selectNodes(doc, doc.body, "//A[contains(@href,';_ylt=')]");
   var othrLinks = selectNodes(doc, doc.body, "//A[contains(@href,'/_ylt=')]");
   
   var hsplt = "";
   for (var x=0; x<allLinks.length; x++)
   {
      var sString = ";_ylt=";
      hsplt = allLinks
  • .href.split(sString);

      var endlink = hsplt[1].substring(28);
      allLinks
  • .href = (hsplt[0] + endlink);

   }

   hsplt = "";
   for (var x=0; x<othrLinks.length; x++)
   {
      var sString = "/_ylt=";
      hsplt = othrLinks
  • .href.split(sString);

      var endlink = hsplt[1].substring(28);
      othrLinks
  • .href = (hsplt[0] + endlink);

   }
}

)();
----------------------------

Take care you update this JK script to its latest version,

Enjoy,

polonus

Cybersecurity is more of an attitude than anything else. Avast Evangelists.

Use NoScript, a limited user account and a virtual machine and be safe(r)!