Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable word wrapping in plain text files in Chrome

I need Chrome to display plain text files with long lines that should not be wrapped. But when Chrome displays a plain text file (text/plain) it wraps the lines around. How can I induce it to exhibit Firefox-like behavior (no wrapping, show scrollbars instead)?

I have tried to wrap the text into a element and it works but takes astonishing amount of time to load, even for relatively short text.

like image 234
VladLosev Avatar asked Apr 29 '11 21:04

VladLosev


2 Answers

I've been looking at this too. The closest I've found is to use the command line and launch chrome but forcing to create a custom user style sheet.

Documented here : http://code.google.com/p/chromium/issues/detail?id=2393

You can then edit you local style sheet and update the css for pre tags (which is how chrome renders text/plain by default) to remove the "word-wrap: break-word" so the lines are not broken.

like image 190
Flapper Avatar answered Oct 14 '22 06:10

Flapper


The easier solution for this is to right click and open "View Page Source". In this view the lines are not wrapped by default and "Line Wrap" is an option that can be toggled with a check box at the top of the page.

like image 2
Prodigy Avatar answered Oct 14 '22 06:10

Prodigy