The Artima Developer Community
Sponsored Link

Web Buzz Forum
FIxing text/plain HTML in Firefox

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Stuart Langridge

Posts: 2006
Nickname: aquarius
Registered: Sep, 2003

Stuart Langridge is a web, JavaScript, and Python hacker, and sometimes all three at once.
FIxing text/plain HTML in Firefox Posted: Mar 21, 2005 2:49 PM
Reply to this message Reply

This post originated from an RSS feed registered with Web Buzz by Stuart Langridge.
Original Post: FIxing text/plain HTML in Firefox
Feed Title: as days pass by
Feed URL: http://feeds.feedburner.com/kryogenix
Feed Description: scratched tallies on the prison wall
Latest Web Buzz Posts
Latest Web Buzz Posts by Stuart Langridge
Latest Posts From as days pass by

Advertisement

Firefox, correctly but annoyingly, displays HTML pages served as text/plain as the raw HTML rather than as rendered HTML. Someone has come up with a very useful bookmarklet called Force HTML which fixes this. It’s pretty clever; it just reads the text from the page into a string and then document.write()s it back into the page. I would not have thought of this!
I’d like to make this a GreaseMonkey script, so that I’m never bothered by this problem again, but there are two small issues with that. Issue 1 is that I can’t work out how to discover what the content-type a page was served as from JavaScript. (This isn’t a major issue; I could check for the document element being pre and the page content containing lt and gt characters and guess from that that it’s HTML being served as text/plain, probably.) Issue 2, a bit more seriously, is that when I do implement it as a GreaseMonkey script it crashes the browser. I am guessing that this is because GM runs before proper page load, and replaces the content of the page with a totally different page using document.write(). This probably screws things up. Once I’ve narrowed this down to a test case I’ll submit it as a GM bug, although I suspect Jeremy and Aaron and crew will say: don’t use document.write() to make the whole page disappear when you’re still in the middle of rendering that page.

Read: FIxing text/plain HTML in Firefox

Topic: WordPress : Serendipity Shootout Previous Topic   Next Topic Topic: The Forums are online

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use