Miscellaneous > Programming & Networking

Web bug detecting script for Firefox

(1/2) > >>

H_TeXMeX_H:
If you use Firefox you can actually detect and block web bugs:

  1) Install greasemonkey and restart browser
  2) Goto tools -> new user script

then paste this in there (right after // ==/UserScript==), save it (might wanna retitle the line @name bug detector), then open it with firefox and goto Tools -> install this user script

 
--- Code: --- (function()
{
  window.addEventListener("load", function(e)
 {
    var imgList = document.getElementsByTagName("img");
    for (i=0; i < imgList.length; i++)
  {
      if (imgList[i].width == 1 && imgList[i].height == 1 && imgList[i].src != "")
   {
        imgList[i].width = "101";
        imgList[i].height = "101";
        imgList[i].alt = "WeB BuG";
        imgList[i].border = "7";
        imgList[i].style.borderColor = '#ff0000';
        imgList[i].style.backgroundColor = '#00ff00';
   }
  }
    return;
 }, false);
})();
--- End code ---


I wrote this myself, with a little help from a few other sites :thumbup: (Upon loading a site it gathers a list of all objects tagged "img" that are 1 x 1 pixels in size and that have a url associated with them, then it makes them a lot more visible ;) based on this , except my version is better cuz it allows you to use Adblock

This produces a green box 101 x 101 pixels with a 7 pixel RED border that marks the bug ... when you right-click -> Propeties it should say "Alternate text:  WeB BuG"

  3)Use the Adblock extension to block the image, right-click the green square and Adblock image ... some of the 1x1 images are spacers for formatting purposes ... you should check the page source to make sure, but blocking the image does not affect site layout (usually), so it is safer just to block them

  4)Try it out here (refresh browser if they are not visible) and at http://www.nytimes.com/  a.k.a web bug central
or http://www.cnn.com/

187nimd4:
whoa! awesome :D all good until they make them 1x2 px ;P tnx 4 this script nigga :)

H_TeXMeX_H:

--- Quote from: 187nimd4 ---whoa! awesome :D all good until they make them 1x2 px ;P tnx 4 this script nigga :)
--- End quote ---

No problem :thumbup:

... if they do ... then change this line: (any image less than 3 x 3 ... i.e 2 x 2 or less)

 
--- Code: --- if (imgList[i].width < 3 && imgList[i].height < 3 && imgList[i].src != "")
--- End code ---
 
... just change the numbers corresponding to width and height above to match whatever they choose to change it to. Who knows, they might just do it, especially if more people know about 1x1 bugs.

You might wanna note:

Are Web Bugs always invisible on a page?    Not necessarily.  Any graphics on a Web page that is used for monitoring purposes can be considered a Web Bug.


... this often includes ads ... so block the ads too.

Here is Wiki, another test (refresh browser if they are not visible), and a recent article on web bugs

187nimd4:
You're the Don :D Tnx.

worker201:
Uhm, except for the fact that many websites still use 1x1 images for preloading purposes.  Loading a 45k image at 1x1 pixel places it into cache, so it can be loaded quickly when needed, at which time it can be displayed at its proper size.  With the increase of broadband, this isn't so much of a problem anymore.  But you still might be interfering with site loading.

Navigation

[0] Message Index

[#] Next page

Go to full version