I would like Firefox to display XML document trees in a monospace font, instead of using the default proportional serif font.

For a single document I can do this from the menu View->Page Style->Monospace, but it falls back to the default if I reload the document or fetch a new one.

Is there a way to permanently change the font used for rendering XML document trees in Firefox without affecting the way non-XML documents are rendered?

link|improve this question
feedback

1 Answer

up vote 3 down vote accepted

Note: The following solution will also affect the View Source browser.

  1. Edit the file C:\Program Files\Mozilla Firefox\res\viewsource.css
  2. Add the line font-family: monospace; to the *|*:root block.
  3. Restart Firefox.

Example (truncated file):

...
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */

*|*:root {
  background-color: white;
  color: black;
  font-family: monospace;
}
...
link|improve this answer
Not a very clean solution, but if it's the only way to accomplish what I want, I'll use it. Thanks. – Lars Haugseth Jul 8 '10 at 10:56
By the way, I'm using Ubuntu Lucid, and there the file is located at /usr/lib/firefox-3.6.6/res/viewsource.css. – Lars Haugseth Jul 8 '10 at 10:58
@Lars: Agreed, not a clean solution, but I couldn't think of another way. – grammar31 Jul 8 '10 at 20:25
This solution does not work with Firefox 11 (the file does not exist). Is there another way? – Markus Johnsson Apr 4 at 7:25
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.