This is as days pass by, by Stuart Langridge

And this is Emulating IE in Mozilla: further thoughts, written , and concerning Uncategorized

In my previous post, I suggested that an IE emulator extension for Firefox would be a good idea. On doing a bit of further research through the Mozilla Tech Evangelism bug list, it seems that sites that work in IE and don’t in Mozilla fall into one (or more) of the following categories:

  1. Use of DOM0 Mozilla-unsupported JavaScript, like window.event and document.all
  2. Browser detects that prevent access to the page at all
  3. Coding for IE bugs like not applying height correctly in CSS or specifying sizes without units (“30” instead of “30px“)
  4. MIME type bugs where pages are served as text/plain
    Point 1 can be, I would think, mostly fixed with the Firefox extension I mentioned. (In fact, WebFX’s Erik Arvidsson has already done most of this work with IEEmu, but I don’t know what the licencing requirements are on it).
    Point 2 might be fixable and might not; we could search the in-page JS code for something that looks like a browser detect, but it would be bloody hard to know whether it correctly detected Mozilla and allowed it through, or whether it blocked it (or all non-IE browsers) even though it could render the content. This might require user interaction to say “pretend to be IE for this page only“, but that’s a bit against the proposed unobtrusive nature of this extension. It might be possible to DWIM it with some thought.
    Point 3 might be fixable and might not; it could be fixed in stylesheets and style attributes, which might take care of a lot of the problems, but to have it fixed properly would require Mozilla to honour unitless dimensions as px, which might not be easily doable from an extension.
    Point 4 probably can’t be fixed; IE ignores the server-supplied Content-Type if it likes, and Moz doesn’t. If we fix the above cases, though, we’ll cover a large majority of “broken” sites.
    The extension would probably want to hook a page’s load event and run before any in-page script. It would then scan for use of any of the stuff that it “fixes”: if it finds any, it changes the DOM by adding IE-specific features to it and overriding some (working) Mozilla features in favour of the IE versions, and it alters the page’s HTML to be compliant where it needs to. This wouldn’t cover inline script that isn’t event-driven, however. The extension’s actions should be overridable in both directions: you should be able to tell it “do the IE thing on this page even though you don’t think you need to” and “don’t do it even though you think you should“, but, critically, the user should not have to use these things. It needs to work invisibly and automatically, and then it stands a good chance of being a success.

Comments

Jason

Did I not read somewhere the other day that XPSP2 fixes that IE Content-Type bug? (And introduces bizarre new ones involving file extensions having to match MIME types if you want to download something)

sil

Lots of people not using XP SP2, though, including all the people with ripped-off copies of XP as I understand it :)

u guys are losers

so you guys talked so much crap but didn’t give any solution to the problem?

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.