Emulating IE in Mozilla: further thoughts

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.
I'm currently available for hire, to help you plan, architect, and build new systems, and for technical writing and articles. You can take a look at some projects I've worked on and some of my writing. If you'd like to talk about your upcoming project, do get in touch.

More in the discussion (powered by webmentions)

  • (no mentions, yet.)