Link to home
Start Free TrialLog in
Avatar of NovaDenizen
NovaDenizen

asked on

How do I make Firefox kill side-scrolling?

I never ever want to see a sideways-scrolled webpage again in my life.  

I am sick and tired of forums and blogs that have braindead formatting schemes that require me to scroll the window back and forth, back and forth, for every freaking line of text.  It's driving me nuts.

I want to make Firefox enforce, with extreme prejudice, the plainly adequate width of my window on any webpages that it comes across.  No exceptions.  Surely there's an extension or a hidden setting or something?
Avatar of Eternal_Student
Eternal_Student
Flag of United Kingdom of Great Britain and Northern Ireland image

That's a very good point, however, im not sure if it is possible ?

Avatar of GrandSchtroumpf
GrandSchtroumpf

If they use tables for layout, then it will be hard to do.
Avatar of NovaDenizen

ASKER

Opera has a fit-to-window-width feature I would kill for, but I don't want to switch to opera just yet.
http://www.opera.com/support/tutorials/flash/era/
SOLUTION
Avatar of GrandSchtroumpf
GrandSchtroumpf

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
From http://forums.mozillazine.org/viewtopic.php?t=272778&start=0&postdays=0&postorder=asc&highlight=force+fit+window

I found the fix for this in a previous thread that addressed the complaint of text not wrapping. It was posted by mcm_ham in http://forums.mozillazine.org/viewtopic.php?t=228548

Create a bookmark with a Name like "Word Wrap" and paste the following javascript in the Location:
javascript:(function() { var D = document; F(D.body); function F(n) { var u, r, c, x; if (n.nodeType == 3) { u = n.data.search(/\S{45}/); if (u >= 0) { r = n.splitText(u + 45); n.parentNode.insertBefore(D.createElement('wbr'), r); } } else if ((n.tagName != 'STYLE') && (n.tagName != 'SCRIPT')) { for (c = 0; x = n.childNodes[c]; ++c) { F(x); } } } D.body.innerHTML += ' '; })();

I put the resulting bookmark in my Bookmarks Toolbar Items for quick and easy access. I just click it whenever I'm confronted with a page that isn't wrapping the text to the window size. It works well on two of the pages mentioned previously:  

WFM also mtz1of4
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
After reading, the above javascript I gave you will work if the Text is overwrapping, not if the images on the page are set too large.  Bad website coding.
> Bad website coding.
That's the real problem!!!

Nice little script though... even if it only fixes problems due to very long words.
Inserting <wbr> tags inside long words is exactly what this site does... except that it does it server-side.

If the site uses table-free layout, the long words will just overflow without influencing the width of their container.  That's why table-free layout is much more superior to table-based layout.

The nice thing about the Opera "fit to width" is that it even works on CSS fixed-width-layout pages like http://alistapart.com/
That's a very nice feature and requests have been made for firefox to develop something similar.
Opera is definitely a reference... i guess they need to if they want to stay in business...  and with support for XML+XSLT in Opera 9, the competition will need to work hard to keep up.
That javascript will come in handy, but it's not 100% of what I want.  I want everything to fit in the side bounds of the window, no exceptions for any reason.  Try reducing the width on this page to halfway, and you'll see that this wrapping javascript won't make a difference.  The javascript injects spaces into excessively long words that Firefox otherwise wouldn't wrap.  I think Firefox ought to forcibly wrap like I want.

A possible algorithm (I haven't actually done any browser code, maybe I'm thinking in the wrong direction):  Lay out the page the normal way with the excessive width, then scale down all the horizontal layout locations by whatever it takes to get it to fit in the window.  Re-layout things vertically, treating all the horizontal coordinates as fixed.
Dear NovaDenizen,

Hey, why not try MR Tech Link Wrapper plugin for firefox? I have tested it, slightly, and notice that it works. The link is here: https://addons.mozilla.org/firefox/2021

Just install it, restart Firefox and open a page which you previously have had side-scrolling enabled.

No hard in trying, eh?

Hope this helps/works - GL

# Nerd
I'm not talking about situations where links are too long.  I want a solution that works for any cause of overwidth.
I have also found Toggle Word Wrap, but it looks like it is intended strictly for text also. From the author, For Firefox (v0.8 or later), checking "Enable Word Wrap for PRE Elements" in the View menu will temporarily enable word wrapping for PRE tags in the current document (by adding a CSS rule to the HEAD element). Unchecking the menu entry will revert the document to the previous state (no word wrapping). The following page can be used to see the effect, e.g.: http://myy.helia.fi/~karte/pre-static-no-css.html If you are interested it its here.
https://addons.mozilla.org/firefox/2351/

GrandSchtroumpf, have you tried Opera on any of the pages he refers to, to see if it actually works for his situations?

NovaDenizen,
Can you give us an example of any page you are trying to get to shrink to fit for you so we can possibly find better solutions for you?

As I said, if the designer can't code his page correctly, you may not be able to get what you desire.  I currently don't have Opera installed to confirm their claims of Fit to window feature.
> GrandSchtroumpf, have you tried Opera on any of the pages he refers to, to see if it actually works for his situations?
Yes i have tried it and it works very well on all the pages i have tested.
But the question is about getting the same behaviour in Firefox.
I don't think any extension can do it.  I guess it needs to be implemented inside the rendering engine.
AFAIK, the extensions don't have any control on the rendering engine, all they can do is to modify the source code.
> But the question is about getting the same behaviour in Firefox.

True, and I am getting the same indications that it can't be done in the current builds of Firefox yet.
An Older Bug report/ request
https://bugzilla.mozilla.org/show_bug.cgi?id=276166
Here's a good example of a page thats too wide:
http://blogs.msdn.com/philipsu/archive/2006/06/14/631438.aspx
I ran a word-splitting javascript on it and its still bigger than my firefox window.  Its all text.
> Here's a good example of a page thats too wide:
To wide?  really?  =)
That kind of page should be boycotted... and the author should be sued for non-accessible design.
Yep, definitely too big.  Although possibly the column width does come in to play there, also.
Don't care.  Don't care.  Make it go away.  Please?  Anybody?
Maybe someone new will come around but if not,

I honestly think this question may be able to get answered more quickly either in the Firefox Bugs forum
http://forums.mozillazine.org/viewforum.php?f=9 or even the Firefox Support forum.

I need to look into CSS.  It might be possible to create a CSS style that enforces a 100% width limitation for the entire page.
That's what I was thinking so perhaps you could just ask in that Forum for questions above and someone there may already know the answer.
in your example page, the scroll is due to a very long link.
using the script that splits the long words should help in this case.
if that does not completely solve the problem, overriding some CSS should make it work.
split?
Nobody gave me an answer of the quality I was looking for.
What quality did you expect?  
You asked how you can add a feature to a program.
The correct answer is "you can't".

The Opera-style "fit-to-window-width" feature is already part of requested features on the mozilla dev site.
Note that this "fit-to-window-width" is not conform to the W3C standards, so you cannot blame any browser that does not implement it.

If you want FF to implement that feature, you can join the W3C and vote for that feature to be added to the standards, or you can joint the mozilla dev team and put that on the table.  I'm afraid there is no other way.