# MathJax+MathPlayer on Windows 8 & IE10 #323

Closed
opened this issue Sep 27, 2012 · 31 comments

Projects
None yet
6 participants
Member

### pkra commented Sep 27, 2012

 (Using the IE10-fix for MathJax) On Windows 8, IE10, I get the error message that MathJax was not able to set up MathPlayer (with MathPlayer installed & properly enabled).

### NSoiffer commented Sep 18, 2013

 I accidentally ended up with an IE10 installed on one of my machines and much to my pleasant surprise, it appears they fixed a number of bugs that affected MathPlayer, so maybe there is some hope of getting MathPlayer to work with IE10. At the moment, HTML5 seems to work well, but xhtml causes a crash. I haven't looked into what is going on beyond that the crash isn't in MathPlayer. When I try MathJax, I get mixed results: If I use a local file that points to the CDN, MathPlayer works (it has TeX in it, so I know MathJax is running). If I got to mathjax.org, I get a message mentioned by Peter If I go to http://onemathematicalcat.org/Math/Algebra_II_obj/basic_probability.htm (which I think is using a local mathjax server, but I'm not sure), I don't get a warning, but there are blank areas where there should be math. In private email, Davide said: The error message is not because the ActiveXObject for the MathPlayer factory fails, it is a problem with creating the needed namespace or binding it to MathPlayer. In the past, handling the document.namespaces object in IE has been very finicky (it seems to be very buggy). Doing it at the wrong time can lead to crashes, and there doesn't seem to be a way to guarantee that we do it at the right time. The timing was different for local files versus networked ones, for example, which you are experiencing. The last time I worked on this (which was a while ago), it was getting worse and worse, and I really wasn't able to get it to work properly in IE10. Perhaps things have improved (as you indicate they have fixed some bugs), so I should give it another try. But I've just started back to teaching, so don't have a lot of spare cycles to put into it. I'll see what I can do. I responded: What I found in IE10 (which differs from IE9), is that namespace prefixes cause MathPlayer to fail to run. If you leave them as just "math" with no prefix, it works. I haven't looked into it why though -- IE 10 only supports attached behaviors [1], so the import tag is not used. The line to put in is L""); but the BHO will do that, so I don't think MathJax needs to do anything. ["#mathplayerBHO" is the id the BHO uses on the object tag for MathPlayer, but again, the BHO adds that]. Of course, it shouldn't hurt if MathJax adds those lines. Davide then said that not having to deal with namespaces would be a big since that was a really finicky thing.
Contributor

### fred-wang commented Sep 19, 2013

 Thanks Neil. Yes, Davide has not much time and I'd like him to focus on the review of remaining bugs for MathJax 2.3. However, I should have time to look into that problem.
Contributor

### fred-wang commented Sep 19, 2013

 I tried to disable the namespace mapping, but I could not really test it since I got a crash. Actually, I get a crash with pages without MathJax like I have the latest version of IE (10) and MathPlayer (3).
Contributor

### fred-wang commented Sep 19, 2013

 My previous test was on my Windows 7 virtual machine. I just rebooted and tried on Windows 8, but still get the crashes.

### NSoiffer commented Sep 19, 2013

 The big remaining crash with IE10 happens with math inside of (html) tables. Of course, lots of pages use tables including the two you listed and the main MathJax page. The crash is in IE when it does size negotiation with MathPlayer -- I compared MathPlayer and IE 9 and IE10 and everything is almost identical up until IE10 crashes -- the values being returned are very similar. Maybe I'll be able to find a work around. I seriously doubt MS will fix the problem. Outside of tables, MathPlayer is working reasonably well. Neil  On Thu, Sep 19, 2013 at 2:12 AM, Frédéric Wang notifications@github.comwrote: My previous test was on my Windows 7 virtual machine. I just rebooted and tried on Windows 8, but still get the crashes. — Reply to this email directly or view it on GitHubhttps://github.com//issues/323#issuecomment-24726062 .
Member Author

### pkra commented Sep 20, 2013

 Neil, just to confirm: does this mean you want us to ignore math in tables generally?

### NSoiffer commented Sep 20, 2013

 Math in tables currently crashes IE -- it's an IE bug that AFAIK, I can't do anything about. I tried a few things in terms of returning different ranges of values, but nothing helped. I've sent it to the IE contacts I have, but since they are onto IE11 and didn't care about plugins to begin with, I'd put the chance of a fix at less than 1%. But other plug-in code bugs got fixed, so who knows? Miracles sometimes happen. I told them exactly where in their code it is crashing (it was a few assembly instructions into some function). If they bother to look at the code, maybe it is obvious what is wrong and they'll go ahead and fix it and put it in as part of security or stability update to IE10. I know, I'm a dreamer... So for your testing, don't use an example page that has math in a table. If MathJax is able to decide on rendering individual expressions and turning over others to the native renderer (were you going to do that for FireFox?), then have MathJax render math in tables and let MathPlayer handle the rest. Neil  On Thu, Sep 19, 2013 at 6:26 PM, Peter Krautzberger < notifications@github.com> wrote: Neil, just to confirm: does this mean you want us to ignore math in tables generally? — Reply to this email directly or view it on GitHubhttps://github.com//issues/323#issuecomment-24785105 .
Contributor

### fred-wang commented Sep 20, 2013

 Thanks Neil. I tried a very simple equation  $x$  without MathJax and that does not crash. Unfortunately, I don't think the issue is limited to tables but I suspect this happens to any CSS layout that requires intrinsic width computations. For example,  $x$  crashes too. The problem is that MathJax puts each individual equation in a such a "display: inline-block" span, so when I tried my MathJax branch with http://cdn.mathjax.org/mathjax/latest/test/index.html yesterday, I got the crash too. I'm not sure why this span is necessary, but we have a similar problem with Gecko browsers and Davide's solution was to add an explicit width like  $x$  which does not crash in Internet Explorer. Also, if the equation is inside a that will become something like 
$x$
 which no longer crashes either. So here I think how we can workaround the problem: make MathJax add an explicit width for IE too. I'm not sure if the exact computation will be possible and that may require to wait that MathPlayer layout is complete. I was not very willing to add a loop that regularly checks and corrects the width in Gecko for all the [itex] elements, given that we want the native MathML mode to be fast without too much additional JS operations, so that would be a shame to add such a hack for MathPlayer :-( But the crash is a more serious issue... Also, doing that may cause a regression when printing a page (issue #386) if MathPlayer can handle the DOM, make it add a parent element with explicit width. intrinsic widths are used for linebreaking. What if you disable linebreaking in MathPlayer? (I don't think that will change anything, but it's worth trying) since you said the crash was not in MathPlayer, maybe isolate it with a minimum HTML example (as above) and a minimum plugin code ; and report that to Microsoft. As you said, that's certainly a security bug that should be fixed and is not restricted to MathPlayer: some evil people could write a plugin that exploits this crash. I'll look into the first point today.
Contributor

### fred-wang commented Sep 20, 2013

 OK, I've updated my branch to add the explicit width work around. It seems that I'm able to measure the width of the math returned by MathPlayer immediately so I finally don't need to do several tries at different time intervals. That seems to work well with the TeX input mode in the "normal" case and when you use tables too. However, there is still an issue when one uses the MathML input mode. Indeed, in that case the [itex] element may be in e.g. a table cell and MathPlayer may (and generally will) process it before MathJax (even if I remove the MathML preview of #557). Thus IE10 will crash and I don't see how MathJax can do anything to prevent that...
Contributor

### fred-wang commented Sep 20, 2013

 @NSoiffer You can download a zip of my branch here: https://github.com/fred-wang/MathJax/archive/mathplayer.zip. Be sure that your test pages point to the unpacked version MathJax-mathplayer/unpacked/MathJax.js

### NSoiffer commented Sep 23, 2013

 Thanks for looking into the crash and workarounds. I wrote to the IE team and gave them the stack trace for the crash on Thursday. The span problem crashes at exactly the same location in IE. I haven't heard back, but I like the idea of pointing out that it is a potential security bug (not sure how one can exploit it, but there are a lot of people who are more clever than I am). If they fix that problem I think IE10 will be useable again. There are still other problems, but nothing as bad as this one is left AFAIK. Neil  On Fri, Sep 20, 2013 at 1:30 AM, Frédéric Wang notifications@github.comwrote: @NSoiffer https://github.com/NSoiffer You can download a zip of my branch here: https://github.com/fred-wang/MathJax/archive/mathplayer.zip. Be sure that your test pages point to the unpacked version MathJax-mathplayer/unpacked/MathJax.js — Reply to this email directly or view it on GitHubhttps://github.com//issues/323#issuecomment-24796378 .
Contributor

### fred-wang commented Sep 24, 2013

 I'm wondering if this should be taken for MathJax 2.3? The MathML input is not really usable with IE10+MathPlayer because of this crash. However, at least the namespace mapping change will allow to make MathJax work in IE10 if Microsoft fixes this bug or Neil finds a workaround in MathPlayer ; and the width workaround will avoid the crash forthe TeX/AsciiMath input modes.

### NSoiffer commented Sep 24, 2013

 I'll ping the IE folks I sent the bug to on Wednesday if I don't hear back before then. I would suggest waiting to get some feedback from them before deciding on what to do. I hope they will fix it, but I wouldn't bet on it. Neil  On Tue, Sep 24, 2013 at 2:27 AM, Frédéric Wang notifications@github.comwrote: I'm wondering if this should be taken for MathJax 2.3? The MathML input is not really usable with IE10+MathPlayer because of this crash. However, at least the namespace mapping change will allow to make MathJax work in IE10 if Microsoft fixes this bug or Neil finds a workaround in MathPlayer ; and the width workaround will avoid the crash forthe TeX/AsciiMath input modes. — Reply to this email directly or view it on GitHubhttps://github.com//issues/323#issuecomment-24988196 .
Contributor

### fred-wang commented Oct 21, 2013

 @NSoiffer Any update from Microsoft? No work around will be included in MathJax beta but we might consider one for the release if you wish (however as I said, this won't solve the case of the MathML input + a table-like element).

### NSoiffer commented Oct 21, 2013

 My interactions with my IE contacts weren't productive about a fix: "Since the crash only occurs because of third-party software I don’t think it would meet the bar." All useful AT on Windows is third-party software... Last week, I sent email to someone in a different group at Microsoft to see if he can make them see the importance of the fix. I just pinged that person today and he said he is still discussing this with the IE group. So, sadly no positive news yet, but there is still hope. Neil  On Mon, Oct 21, 2013 at 7:39 AM, Frédéric Wang notifications@github.comwrote: @NSoiffer https://github.com/NSoiffer Any update from Microsoft? No work around will be included in MathJax beta but we might consider one for the release if you wish (however as I said, this won't solve the case of the MathML input + a table-like element). — Reply to this email directly or view it on GitHubhttps://github.com//issues/323#issuecomment-26722670 .
Contributor

### fred-wang commented Nov 11, 2013

 This will not be included in the final v2.3 release.

### drlippman commented Jul 11, 2014

 I am getting reports of users saying their IE10+MathPlayer is crashing consistently when trying to display math via MathJax. Are there any plans to workaround this issue in MathJax by avoiding MathPlayer, or do I just need to tell users to uninstall MathPlayer if they're IE>9?

### NSoiffer commented Jul 11, 2014

 IE10 has a bug that I think Fred previously reported that causes IE (not MathPlayer) to crash with math in a table or span -- my guess is that forgot to check to see if a binary behavior was handling the object. I think you disable the MathPlayer check if the emulation mode is > 9. IE when emulating earlier modes works ok, but you can't set the emulation mode via code. Only the author or developer tools can do that. Actually, there may be a problem with IE11 and emulation at >=IE8, but I'm not sure about that. They introduced "enterprise mode" which forces IE into IE8 mode for pages marked (by users) as wanting to run in enterprise mode, but I recall that when I tried that with IE11, it crashed in exactly the same spot as IE10. I filed a bug a few months back with the IE team and it is still marked as "active", so they might fix that and I suspect that if they do, it will fix emulation with IE10 also...

### NSoiffer commented Jul 12, 2014

 IE bug reports can be viewed or filed at http://connect.microsoft.com/IE.
Member Author

### pkra commented Jul 14, 2014

 @drlippman we'll try to look into this for the next release. @NSoiffer if anyone at DSI has some insights into the problem, that'd be great. The MathPlayer homepage implies that IE10/11 are not really supported, so it seems MathJax should avoid detecting MathPlayer on those platforms.

Member Author

### pkra commented Aug 20, 2014

 @NSoiffer given the situation, we'll turn off MathPlayer detection in IE10+

### NSoiffer commented Aug 20, 2014

 MathPlayer is dead in IE10+... except in emulation mode. The IE team never fixed the bug in IE10. In IE11, there is some hope they'll fix a bug which will allow MathPlayer to work in "Enterprise mode" -- basically a way for a user to say that some site should be run in IE8. I'm pretty sure Davide said that MathJax picks up the emulation mode, not actual IE version. If true, then everything is fine. If not, MathJax should switch to picking up the emulation mode.  Neil 
Member

### dpvc commented Aug 20, 2014

 MathJax used the documentMode, which I think is what gets set by the IE-emulate meta tag.

### NSoiffer commented Aug 21, 2014

 I run IE11 in emulation mode when I use MathPlayer. If there is some new version to test, I'm willing to be the guinea pig. Neil 
Member

### dpvc commented Aug 21, 2014

 Thanks, Neil, as always.

Member Author

### pkra commented Aug 22, 2014

 Thanks, Neil. => marked "ready for development"
Member

### dpvc commented Aug 22, 2014

 OK, the issue323 branch of my fork of MathJax contains the code to not use MathPlayer in IE10 and above. It will still try to use it in document modes less than 10, but I didn't have much luck with that. (IE would crash.) I did not spend a lot of time with the various emulation-mode/documentMode combinations to see if I could get it to work.

### NSoiffer commented Aug 22, 2014

 The crash exists back to IE8. Use IE7 or IE5 mode. As I said earlier in the thread, there is some hope they will fix the crash in IE8 to support their new "enterprise mode". My belief is that a fix will end up fixing the crash in IE9 and IE10 modes also because the crash is at the same spot in all those modes. Neil 
Member

### dpvc commented Aug 22, 2014

 OK, I'll try with those documenModes and see if that helps. Thanks for the information.

### dpvc pushed a commit to dpvc/MathJax that referenced this issue Aug 24, 2014

 Merge branch 'issue323' into develop. Issue mathjax#323. 
 384964d 
Member

### dpvc commented Aug 24, 2014

 => Merged.