Improved plain-text handling in Firefox
8 March, 2013 § 30 Comments
If you’ve ever tried to read a plain-text file in Firefox, you may have noticed that we didn’t have an option to apply word wrapping to the text. New in today’s Firefox Nightly build, we are now applying word wrap to plain text documents by default.
For example, this file is very hard to read when the lines aren’t wrapped. The lines scroll offscreen horizontally, and the user has to use the horizontal scrollbar on the bottom of the screen to read the file (yuck!). Here’s a screenshot of what I’m talking about:
With word wrapping applied, the text is much easier to read and the line length will adapt to the size of the browser window:
Some documents aren’t ideal for word wrapping, and to aid that we have made it easy to disable the feature. To toggle whether the document is wrapped on a case-by-case basis, you can change between the “Wrap Long Lines” stylesheet and “No Style”.
If you’d like to disable the feature entirely, you can go to about:config
and set the plain_text.wrap_long_lines
preference to false
.
[…] another new feature in today’s build of Firefox Nightly that I want to call attention […]
Looks great and a very welcome feature. I’d love to be able to toggle the wrapping from a context menu instead of just the menu.
Yeah, I agree that the Page Style isn’t easy to stumble across. Can you file a bug for adding access to the context menu?
https://bugzilla.mozilla.org/show_bug.cgi?id=849373
It’s apparently not available at all without the menubar. Maybe add it below the “Character Encoding” entry in the Web Developer menu.
I once had a userscript that parsed plain text documents as markdown, then prettified them with an elaborate stylesheet. That was quite useful, too bad I lost it.
If you have the menubar hidden, you can hit the Alt key to temporarily show it.
What’s about adding RTL support, or even better, per-paragraph RTL support? It should not be too difficult as the RTL guessing algorithm is already landed as part of dir=auto.
Hey Tomer! Can you send me a test case? I’m curious to see it 🙂
Also, would be good to get a bug on file for it. I’m not sure of the difficulty, but if it’s a common problem for people then we should fix it.
Testcase: https://bugzilla.mozilla.org/attachment.cgi?id=722960
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=849404
Why does the pref disable the feature entirely, rather than changing the behavior for newly loaded documents and leaving the menu item enabled?
Version 1 oversight 😉
See https://bugzilla.mozilla.org/show_bug.cgi?id=849422 which was filed to fix this.
This is excellent.
I zoom pages to 200% (poor eyesight), regardless of the content, and there’s more horizontal scrolling whenever the page zoom is increased, but this new feature makes things much more comfortable.
I’m not sure why one would want to toggle the preference at all.
It would be nice if it applied to web page content as well, but this is cool.
Thanks! I’m glad you like it 🙂
The toggle feature is nice because some plain text documents were created with the expectation that word wrap would be off. You can see this page for example: http://weblogs.mozillazine.org/asa/calendar.txt and also any ASCII art files.
Ugh, the default font is still Courier New, even on Windows 7?!
Apart from that, great change!
We can probably fix that for plain-text documents that aren’t in a frame. Can you file a bug for the request?
Well, there is already “Bug 468169 – Use a better monospaced font anywhere we use Courier New right now”: https://bugzil.la/468169
Where is the original bugzilla fix of this feature?
https://bugzilla.mozilla.org/show_bug.cgi?id=253564
Very useful feature, I doubt i’ll be togging it off. Thanks!
FWIW, when this feature is active, horizontal resizing of the window is quite janky.
Thank you for your comment. I filed http://bugzil.la/854425 for this case.
If I choose to not word wrap text file (for a log file for instance), my choice is not memorized. The setting is lost when I reload the page. It should work like character encoding setting which stays active until the tab is closed.
Can you please file a bug for this? I agree that it is likely a necessary feature.