Get at entire web page contents using Javascript
<p>Is there a way to load the entire contents of a page into a javascript variable? (the page is not properly formatted HTML.) Ie store the page contents as a string in a variable. It only needs to work with Firefox.</p>

<p>I have some javascript running in one firefox tab that accesses the content of a page in another tab (the target window). Normally the content of the target is an HTML page so I can get at its content like this... </p>

<pre><code>targetWindowName.document.getElementsByTagName("html")[0].innerHTML;
</code></pre>

<p>However I have come across a page that is not in proper HTML and so the above doesnt work.</p>

<p>(The actual content of this awkward page is JSON. I know this would be best loaded up with AJAX or something but I have a framework already setup to process HTML pages and it would be very handy if I can treat this particular (one off) page just like a regular HTML page.)
Thanks</p>
