What's new
Van's Air Force

Don't miss anything! Register now for full access to the definitive RV support community.

Attention: VAF Firefox Users

aeropunk

Active Member
The Problem:

You know how sometimes, while casually browsing a 'riveting' VAF thread ( ;) ) on your laptop, you'll come across a page where someone has included a huuuge image to better illustrate their point, and it extends the right margin of the forum waaaaay off the right edge of your browser's viewscreen, forcing you to scroll back and forth just to read each post? Yeah, I hate that.

The Solution:

Well, if you use the Firefox web browser, as I do, you can install the Greasemonkey add-on, and this short little VAF user script, and those pesky huge images will trouble you no more!

The Brass Tacks:

What is Firefox? Firefox is the greatest web browser in the Known Universe. It does all the same stuff as that Little Blue 'E' you're always clicking on, but better, and sexier.

What is Greasemonkey? Greasemonkey is one of about three hundred trillion Add-ons for Firefox. Greasemonkey allows you to customize the way any webpage looks using small bits of JavaScript code.

What is a User Script? A user script is one example of the aforementioned "small bits of JavaScript," used by the Greasemonkey add-on to change the way a web page -- any web page -- looks and feels on your installation of Firefox. Computer geeks would probably consider Greasemonkey and User Scripts to be "hacks," per se, but they in NO WAY alter the data on any computer other than your own.

So how does this all work? Well if you use Firefox, just follow the links above to install Greasemonkey (first), and then the "Van's Air Force" user script, written by me. Once both are installed, simply reload the VAF page you're reading, and BOOM!, the page width will be restricted to 820 pixels, or (if you're daring) whatever width you edit the user script to display! Oh, and those huge images will still be visible, and you'll still have to scroll way over to see all of them, only now they won't knock all the other posts on the page out of whack.

What does this evil script actually LOOK like? Don't panic, Greasemonkey allows you the option of viewing any user script before you actually install it, but the script in question looks exactly like this:

UPDATE: (06/30/09 16:01 UTC) I changed the code just a bit. See below.

Code:
// ==UserScript==
// @name           Van's Air Force
// @namespace      http://aeropunk.com/
// @description    Makes VAF wide posts readable on smaller screens.
// @include        http://www.vansairforce.com/*
// ==/UserScript==


function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle('.page {width: 820px !important; float: left;}');

Learn More!

Now I bet all of you are just DYING to write your own Greasemonkey scripts and make the New York Times website display everything in Pink, Bold, Comic Sans font. Well never fear! Just surf on over to http://diveintogreasemonkey.org/ and learn the ropes. Enjoy!

Disclaimer

PS -- Doug: I hope none of the above is taken to be a critique of VAF in any way! :D (Just a computer geek tweaking a little bug.) The site looks great; keep it up!
 
Last edited:
Thanks, I'll be trying that tomorrow; right after doing a 100 hr. inspection on a powered parachute.
Work, Work, Work!
 
Another solution

Firefox has a user configurable setting that allows you to tell it not to make pictures bigger than the screen can handle. When you see one like that the cursor is a circle with a plus sign inside. If you click again you see the image full size.
 
Firefox has a user configurable setting that allows you to tell it not to make pictures bigger than the screen can handle. When you see one like that the cursor is a circle with a plus sign inside. If you click again you see the image full size.

How do you activate this feature, or does it not work with Firefox on a Mac?

Thanks,
 
Firefox has a user configurable setting that allows you to tell it not to make pictures bigger than the screen can handle. When you see one like that the cursor is a circle with a plus sign inside. If you click again you see the image full size.

It sure does, and it is the default setting since Firefox 2.0. I think you're talking about altering the setting using about:config as mentioned in this short tutorial. This feature only works when Firefox is pointed to an image file however, rather than a web page.

So, for example, this image from Kirk Groves' post today will auto-resize in Firefox (and in Internet Explorer too, I believe) when you view just the single image, but when you view the entire thread, you'll notice that the image is displayed full-size, which pushes the width of ALL forum posts on that page (along with all the text) to the same width, since the VAF forum's theme is meant to "stretch" to fit the width of your browser screen, large or small (resize your browser window to see what I mean), AND stretch to fit the width of any media files placed inside a post.

This Greasemonkey user script simply "hacks" this problem for small-screen or laptop users by fixing the width of the blue "box" for each post. In the thread mentioned above, for example, the first post (with the big images) will still stretch, but the following posts will not, making them readable without having to scroll your browser window left and right.
 
Last edited:
Update

Due to my endless and uncontrollable need to incessantly fix things that aren't broken, I updated the Van's Air Force user script just a bit.

The new version fixes the forum width at 960 pixels for all posts. If posts contain images that are wider than can be displayed in the available room (790 pixels), they'll be automatically resized to fit.

This fixed-width version actually looks pretty good on wide monitors too. The 1280px monitor on my desktop machine tended to stretch the posts so wide I'd lose my place in mid-sentence. Hopefully this version will work equally well for both laptops and big screens.

The new script is included below, or you can install it by clicking here. (You may need to uninstall the old version if you installed it before. Try Tools -> Greasemonkey -> Manage User Scripts) Enjoy!

Code:
// ==UserScript==
// @name           Van's Air Force
// @namespace      http://aeropunk.com/
// @description    Makes VAF wide posts readable on smaller screens.
// @include        http://www.vansairforce.com/community/*
// @include        http://www.vansairforce.net/*
// ==/UserScript==

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle('body {width: 960px !important; margin: 0 auto !important; overflow-x: hidden;}' +
               '#posts .page {width: 804px !important;}');

var z = document.getElementsByTagName('img');
for(i=0;i<z.length;i++) {
if(z[i].width > 790){
	z[i].width = 790;
	}
}
 
Last edited:
Opera Browser

Because my job requires me to have all major browsers available, I have taken a liking to Opera. Opera has a checkbox in "Tools>Preferences>WebPages" that performs the same function for oversized images.
I like a lot of the functions it has. I do a lot of tabbed browsing and like that when you open a new tab, it opens next to the one you are on, not the last in the list like Firefox or IE.
As far as I am concerned, Opera is still an infant and needs to grow up a bit. But I am liking what I see. If anyone wants to, they can check it out and download at www.opera.com.
 
FAR out!

Opera has a checkbox in "Tools>Preferences>WebPages" that performs the same function for oversized images.

Whoa! That's awesome! Just tried that out and it worked great. I don't use Opera often enough, but it sure does have some cool features.

As far as I am concerned, Opera is still an infant and needs to grow up a bit. But I am liking what I see.

I agree with that statement 100%. I really like using Google's Chrome and Opera, but they both need to tweak things a little before I ditch the 'Fox.

Thanks for the tip!
 
I like a lot of the functions it has. I do a lot of tabbed browsing and like that when you open a new tab, it opens next to the one you are on, not the last in the list like Firefox or IE.

Get this Firefox add-on, and you will get the tab behavior you want:

https://addons.mozilla.org/en-US/firefox/addon/1956

--Bill

Oh, I do like Opera, and if anyone has a non-iPhone smart phone, run, do not walk to get Opera Mini. The default browser on my Blackberry is useless. Opera Mini rocks!

http://www.opera.com/mini/

--Bill
 
Last edited:
Thanks - works well!

This is an excellent patch for me - I use a 1024 wide screen and an 800 wide screen on my EeePC and the sizing was a great annoyance.

I have one other issue with Firefox on the VAF forums - the tool tips show only a single line from the post when hovering the cursor over the title. On the very limited number of occasions I have used IE I see that the entire post is displayed as tooltip - very useful in scanning the new posts.

I am not sure if this behaviour is still the case for IE but if Firefox could be patched to do this it would be helpful.

Doug
 
FF 3.5 is Available

FireFox 3.5, a major upgrade is now available but not all previous stuff is compatible.
 
Back
Top