title: Create Firefox addon to fix broken webpage on the fly
body: <p>At my job they use a "central login" facility on internal webpages.  Whenever an internal webpage requires authentication, it forwards you to the central login, and after logging in, it sends you back to the page you were trying to view.</p>
  
  <p>The very first line in the HTML for this central login page starts with this:</p>
  
  <pre><code>&lt;!-- Encoding=ISO-8859-1;
  </code></pre>
  
  <p>But it <strong>never</strong> ends the comment, which means that all the HTML code in the whole document is actually commented out.  This works fine in IE6 (which is the company standard - eek!), and it used to work in Firefox, but when I upgraded to Firefox 4, this no longer works (as it shouldn't - it is following standards).</p>
  
  <p>I have saved the source and changed the first line to:</p>
  
  <pre><code>&lt;!-- Encoding=ISO-8859-1; --&gt;
  </code></pre>
  
  <p>And then the page will display, but since it is loaded from <code>file:///</code>, I can't submit my credentials to the main server...</p>
  
  <p>I hate using IE6, but for all internal pages I am stuck with it because Firefox renders an empty page every time I get sent to the central login.</p>
  
  <p>Is it possible to create a Firefox addon (or even a Greasemonkey script) to modify the HTML as it is coming into the browser before it gets rendered?  I see tons of examples of modifying HTML once it is already loaded, but can't find anything to manipulate <em>while</em> loading it.</p>
  
  <p>I guess I'm open to other solutions besides an addon, but that was the only thing I could think of.  Also, we are not allowed to use Chrome or Safari, so that is out.  And no, I cannot talk to the person in charge of the central login page and get them to change it.  Proxying would probably be very difficult too because of the nature of the page.</p>
  
  <p>Thanks in advance!</p>