Tuesday, March 22, 2005

javascript:document.write("<frameset cols = \"25%, *, 25%\"> <frame frameborder=0 style=\"background-color:#000000\" /> <frame frameborder=0 marginwidth=40 src=\"" + location.href + "\" /> <frame frameborder=0 style=\"background-color:#000000\" /> </frameset>")

Updated code:
javascript:document.write("<frameset cols = \"22%, *, 22%\"> <frame frameborder=0 name=b /> <frame frameborder=0 marginwidth=40 name=a /> <frame frameborder=0 name=c /> </frameset>"); a.location.href=location.href;b.document.write("<body bgcolor=\"black\"> </body>");c.document.write("<body bgcolor=\"black\"> </body>");

That's the code I wrote for a bookmarklet that I call 'Frameit'. You can copy the above code to a bookmark in Firefox, (get rid of the newlines of course). Clicking on it encapsulates the current page in a frame surrounded to the left and right by black frames. The frames are resizable. For a lot of pages, this improves the readability as the number of words per line is reduced and the background is black and uncluttered. It's great for reading books and documentation in kiosk (F11) mode.

Known issues:
  • Does not work with Internet Explorer (and I would really want it to because you cannot view HTML Help files in Firefox.) Updated code to make it work on Internet Explorer and Firefox.
  • Does not work on certain sites like Wikipedia, which seem to explicitly disallow framing.
Any Javascript guru's know how to fix these issues?

1 comment:

i-me-moi said...

there was a time when your blog wasn't about JavaScript, CSS, Internet Explorer v/s Mozilla, MS v/s Open Source, and technology. there was a time when you wrote ... and felt more than thought ... what happened?