View Single Post
  #1  
Old 06-04-2005, 03:55 PM
StevieG StevieG is offline
Senior Member
 
Join Date: Jan 2003
Location: Baltimore, MD, USA
Posts: 157
Default Stop horizontal sprawl on 2+2 pages with this Firefox extension

Posts with large images or long link text can sprawl horizontally, and that makes reading every other post on the page a chore.

Previously, I wrote a Grease Monkey user script for the Firefox browser that enforced page width by replacing long link text, but it did nothing to address images.

Now there is an improved version that wants to resize images that exceed a certain width (user specified).

How to install:

1. The rename user script requires Firefox to have the Grease Monkey extension. You need to have Grease Monkey 0.3 or higher. You can check what version you have by looking at the menu item Tools > Extensions. Grease Monkey is available at mozdev.org.

2. Once you have that installed you will need to exit Firefox and relaunch the application for the extension to be installed.

3. Right click the UBB preserve width link here and choose the "Install User Script..." option from the context sensitive menu.

4. Browse 2+2 and try it out. The first time you use it, the script will prompt you for the maximum image width to allow. I suggest 600 for 1024x768 resolution, and 800 for higher.

5. If you want to change this maximum image width value, select the menu option Tools > User script commands > Reset UBB page max image width

6. If you were using the previous script I wrote, it is now redundant. Remove it by going to Tools > Manage User Scripts..., highlighting "Rename unbroken long anchor text" in the left hand side of the window, and then using the Uninstall button in the lower right hand side of the window.

7. PM me with suggestions or bugs.

Notes:

First, the replacement happens after the page is loaded, so you may notice a delay, and you may see the page refresh. This refresh won't happen unless a replacement is made.

If the page has a lot of large images then the script may act before the images are loaded and therefore may not realize how large they were. If this happens, just wait for the page to load and try a refresh, this seems to help in many cases. This is a something I would like to improve, but for now, we live with it.

Also, it will only rename the text to (renamed long text) and it will only do this in the case of URLs that have no white space whatsoever, and are at least 81 characters long. That '81' magic number is fixed, but seems to work nicely.

The no white space requirement means if someone posts a link as "see http://really.long.ass.url" then that little bit of whitespace between "see" and the long ass URL will prevent the replacement from happening. But, hey, if they put in different text for the link than the URL itself, chances are it does not need to be cleaned up.
Reply With Quote