Bookmarklet To Remove noWraps on the ‘digg / digall’ pages at digg.com

June 9th, 2005 at 10:58 am

Update: This seems to be a bug with Firefox Deer Park Alpha 1, and doesn’t seem to happen on my Firefox 1.0.4 version at home. The issue deals with the divs inside the title# tds. The divs around the description have a style=”width:350″ attribute, but Deer Park doesn’t seem to respond to this value. I dont know if this is a problem with Deer Park or a problem with the style attribute not specifying a unit.

So, in case you haven’t noticed from the recent upswing in blog postings here, I’ve started getting into digg.com. I’ve been following the river of news from digg.com for a while but haven’t been a very active participant until recently.

Anywho, I’ve found the ‘digg / diggall‘ pages to be somewhat unpleasant with the TDs under the ‘title’ column having a noWrap=true property applied to them. So I whipped up a quick bookmarklet to fix the problem.

<a href=”javascript:(function(){ els=document.getElementsByTagName(‘td’); for(i=0;iFix Digg TDs

To use the bookmarklet simply drag it to your bookmarks toolbar / links bar, and click it after loading the digall page.

If you don’t know what the hell a bookmarklet is, here’s a quick summary: It’s a javascript function that you can cram into a bookmark. When you click the bookmark, the javascript is executed on the page you’re looking at. See Jesse’s Bookmarklets Site for more great bookmarklets.

For those who are interested the (reformatted and commented) source of the bookmarklet:

javascript:(
  function(){
    /* gets all the td elements on a page */
    els=document.getElementsByTagName('td');
    for (i=0; i < els .length; i++) {
      /*
           all the td's we're looking to fix on the
           diggall page have an id of the form
           title# (with # = 1..whatever)
           So we only want to fix the tds that
           have an id that starts with 'title'
      */
      if (els[i].id.substring(0,5).toLowerCase()=='title') {
        els[i].noWrap=false;
      }
    }
  }
)();