I've always missed the possibility of splitting Firefox's screen horizontally in order to view two parts of the same document stacked one over the other, e.g. for following internal references and footnotes, comparing passages or simultaneously seeing two different rows far apart in a very long table. A feature present long ago in editors like Emacs, spreadsheets and some other programs like Mac OS X's terminal emulators.
The other day, after trying some interesting but overkill solutions like Tile Tabs for Firefox or Split Screen for Greasemonkey I found this tip for splitting any browser's screen in two frames using a little Javascript. My version of it is even simpler since it always loads the current address. Just use the bookmark management window to create a new one (the quick method of clicking the star won't work), call it “Divide horizontally” (or whatever) and enter the following location:
javascript:with(document){write('<frameset%20rows="*,*">\n<frame%20src="'+location.href+'"/>\n<frame%20src="'+location.href+'"/>\n</frameset>');close()}
If you want a vertical division instead of horizontal, just change rows
by
cols
. When you select the new bookmark while having a page open, the screen
will split into two frames with the same page. Voilà!
Caveat: this code doesn't really split the current document's view, instead it reloads its address both in the upper and lower frame. Since two independent documents are created I don't expect this to work too well with dynamic pages and form results. In fact, I doubt that the same document can actually be shown in two simultaneous views while respecting the CSS standard (where should an element fixed to the top right of the view be shown?).
Nonetheless, it's a really simple approach which works most of the time. :)