## #56 jax/output/HTML-CSS/jax.js fails to load

open-accepted
nobody
5
2014-08-14
2010-05-30
No

Hi,
I just wanted to integrate the awesome MathJax into my project, but apparently it has some issues with webkit based browsers. The sample.html file works in Firefox and Chromium, but in Midori 0.2.2 (webkit based, uses webkitgtk) the loading of HTML-CSS/jax.css takes really long and then stops reporting that the loading of that file failed. The formulas are correctly shown however, though not as prettily as in Firefox for example.

Is there any way I can debug MathJax to see what is going wrong?

OS: Ubuntu 10.04 64-Bit using webkitgtk 1.2.0

Thank you very much,
Jendrik

## Discussion

• Davide P. Cervone - 2010-05-30

I just checked Midori 0.1.9 on Ubuntu 9.10 (the latest versions I have), and everything works fine for me.

Can you view the previews at www.mathjax.org with Midori? Do you get the same results there? What version of MathJax do you have? (I recommend using SVN to get the latest updates rather than using one of the beta ZIP files.)

Are you sure the file that is being reported as failing is [MathJax]/jax/output/HTML-CSS/jax.css? Because there is no such file, and I don't see why MathJax would be trying to load it.

Perhaps the answers to these questions will help us track down the problem.

Davide

• Davide P. Cervone - 2010-05-30
• status: open --> open-works-for-me

• Jendrik Seipp - 2010-05-30

Can you view the previews at www.mathjax.org with Midori?
Yes. It loads the images though and therefore the output is of course not as pretty as in the other browsers. The equations are rendered acceptably fast however. So the results are the same for the mathjax.org samples and my local copy, on my local machine it just takes longer to load due to the file-loading error.

What version of MathJax do you have?
For the latest test I use the SVN version 333.

Are you sure the file that is being reported as failing is
[MathJax]/jax/output/HTML-CSS/jax.css?
No, I'm sorry, I meant [MathJax]/jax/output/HTML-CSS/jax.js

Do you have an idea what might be going wrong? Is it to be expected that midori uses images to render? Can I directly tell it to load the images, bypassing the file-load error?

Cheers,
Jendrik

• Davide P. Cervone - 2010-05-31

But you DON'T get the file load error from www.mathjax.org, right?

Midori should NOT need to use the image fonts, and it probably means that the browser detection is failing with version 0.2.2 compared to 0.1.9 that I am using. Can you enter the following in the location URL area:

and see what you get in the alert that this produces? Then try

and let me know what you get. Also, if you look at the console (in the tools menu) after the file fails to load, are there any relevant error messages?

As for the HTML-CSS/jax.js, you can not bypass that, as it contains the main code for the HTML-CSS output processor. Without that, you would not get any output. Something in the file is crashing, and we need to identify that. Unfortunately, since I can't reproduce the problem, you will need to do the ground work for me. :-)

Davide

• Jendrik Seipp - 2010-05-31

But you DON'T get the file load error from www.mathjax.org, right?
I don't get any error message.

Can you enter the following in the location URL area: javascript:alert(MathJax.Hub.Browser); and see what you get in the alert that this produces?
I get "Safari".

I get "0.0"

and let me know what you get. Also, if you look at the console (in the
tools menu) after the file fails to load, are there any relevant error
messages?
There are no messages at all.

As for the HTML-CSS/jax.js, you can not bypass that, as it contains the
main code for the HTML-CSS output processor. Without that, you would not
get any output. Something in the file is crashing, and we need to identify
that. Unfortunately, since I can't reproduce the problem, you will need to
do the ground work for me. :-)
I'll do my best ;-)

Jendrik

• Davide P. Cervone - 2010-05-31

OK, thanks for running the tests. That's a help. Was this on the www.mathjax.org site, or on your own site? (I need it for the site that is failing.)

In any case, the browser is right, but the version number is not being properly detected (this is a rather fragile process). Can you do

and

and let me know what you get? Thanks.

Finally, on the site that is failing, do

and send what that produces.

The version of 0.0 is what is triggering image mode, but I'm still trying to find out why HTML-CSS/jax isn't loading properly. It should work even in image mode.

Davide

• Davide P. Cervone - 2010-05-31
• status: open-works-for-me --> open-accepted

• Jendrik Seipp - 2010-05-31

Was this on the www.mathjax.org site, or on your own site? (I need it for the site that is failing.)
Actually it's the same for both sites. (Safari, 0.0)

-> Midori/0.2.2 (X11; Linux x86_64; U; de-de) WebKit/531.2+

-> 0.2.2 (X11; Linux x86_64; U; de-de) WebKit/531.2+

Finally, on the site that is failing, do
->

• Davide P. Cervone - 2010-05-31

OK, that helps. I have updated the version detection to what I think will work for this. Check out SVN 335 and see if that helps with the version number problem (you should end up being identified as Safari 4.0).

As for the failed file load, I suspect you have not installed the image font (or haven't installed them properly). The failing file is actually [MathJax]/fonts/HTML-CSS/TeX/imagedata.js, so check if you have that file. If you checked out MathJax using SVN, then be sure you unpack the fonts.zip file that was downloaded with the initial checkout. If you downloaded one of the beta ZIP files, be sure you have also downloaded the corresponding webfonts ZIP file and unpacked it. (You might check that before updating the version checker, since if that works, you won't be using the image fonts.)

Anyway, please let me know what happens with the new version number check and whether you have properly installed the image fonts.

Davide

• Jendrik Seipp - 2010-05-31

Check out SVN 335 and see if that helps with the version
number problem (you should end up being identified as Safari 4.0).
-> Yes, I get Safari 4.0

As for the failed file load, I suspect you have not installed the image
font (or haven't installed them properly). The failing file is actually
[MathJax]/fonts/HTML-CSS/TeX/imagedata.js, so check if you have that file.
-> The file is present.

If you checked out MathJax using SVN, then be sure you unpack the fonts.zip
-> I thought I did that.

of the beta ZIP files, be sure you have also downloaded the corresponding
webfonts ZIP file and unpacked it.
-> I had done that before switching to SVN, too.

The sample file works now and looks pretty, but the loading takes very long probably due to the file still not being loaded. Can I use MathJax without loading the image fonts? Can I even use it without the fonts zip file? This would actually be very important for embedding MathJax in my application.

Now the log shows:

[MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js is present, too.

Thanks,
Jendrik

• Davide P. Cervone - 2010-06-01

OK, glad the browser detection is now working properly. As for the file load problem, I'm wondering whether there is a problem in your configuration for HTML-CSS. Are you using in-line or file-based configuration? If the former, can you send the MathJax.Hub.Config() command that you are using? If the latter, can you indicate what changes you made to the default configuration?

Here's another thing to try. If you do in-line configuration, add
[code]
MathJax.Hub.Startup.signal.Interest(function (message) {MathJax.Message.Set("Startup: "+message,null,600)});
[/code]
and if you are using config/MathJax.js, add that command to the bottom of the file right before the final loadComplete call. Then let me know what the message log says.

Davide

• Davide P. Cervone - 2010-06-01

You can set the noImageFonts parameter in the config file to tell MathJax not to use image fonts.

> Can I even use it without the fonts zip file?

Well, you need to have part of the file (the web-based fonts are in there as well), but you can remove the fonts/HTML-CSS/TeX/png directory and its contents, which is where the image fonts are stored, provided you set the noImageFonts parameter in the configuration file.

Davide

• Jendrik Seipp - 2010-06-01

I'm wondering whether there is a problem in your
configuration for HTML-CSS. Are you using in-line or file-based
configuration?
-> I was using the vanilla sample.html file from the test directory (SVN 335). The command is:
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
tex2jax: {inlineMath: [["$","$"],["\$","\$"]]}
});

Here's another thing to try. Then let me know what the message log says.
->
Startup: Begin
Startup: Begin Config
Startup: End Config
Startup: Begin Styles
Startup: End Styles
Startup: Begin Jax
Startup: End Jax
Startup: Begin Extensions
Startup: End Extensions
Startup: Begin Browser
Startup: End Browser
Startup: Begin Typeset
Startup: TeX Jax Config
Startup: TeX Jax Require
Startup: anonymous Jax Config
Startup: anonymous Jax Require
Startup: anonymous Jax Startup
Startup: TeX Jax Startup
Startup: HTML-CSS Jax Config
Startup: HTML-CSS Jax Require
Startup: HTML-CSS Jax Startup
Startup: End Typeset
Startup: End

Do you have an idea how to fix the file load or to prevent the file from being loaded if possible?

• Davide P. Cervone - 2010-06-01

OK, I've just updated to Midori 2.6 and I am unable to reproduce the problem you are having.

If I understand you correctly, you are getting this problem from the MathJax/test/sample.html file? What happens with the MathJax/test/index.html and index-images.html files? These all load fine for me in Midori 0.2.6.
.
The message log you provided indicates that the HTML-CSS jax is failing during its Startup routine. But since the mathematics seems to render after that, it probably means it is making it through most of it. I suspect it may be having trouble setting the styles or preloading web fonts, which are the last two actions. You may want to try modifying MathJax/jax/output/HTML-CSS/jas.js by commenting out the last line of the Startup function and see if that helps. If that works, we can try adding one of the two actions in and see which one is failing.

Since things are working for me, however, I am wondering if there is a problem associated with your environment somewhere. Do you have any extensions or other add ons installed for Midori? The other thing to remember is that Midori is still in the early stages of development (version 0.2.x) and so may still be too buggy to be reliable for MathJax. It may not be worth putting too much more effort into debugging this issue.

Davide

• Jendrik Seipp - 2010-06-01

Thanks for looking into the problem. I updated my Midori Version to 0.2.6 too now but the error persists.

What happens with the MathJax/test/index.html and index-images.html files?
-> Same problem on those. First the raw Tex text is shown and it says that it doesn't work, then it loads fine after some time.

I opened the webinspector in Midori and loaded the sample.html file once again. I get several warnings in the console, maybe they help you:
MathJax_Main-Regular.otf Resource interpreted as font but transferred with MIME type application/x-font-otf.
MathJax_Main-Bold.otf Resource interpreted as font but transferred with MIME type application/x-font-otf.
MathJax_Math-Italic.otf Resource interpreted as font but transferred with MIME type application/x-font-otf.
MathJax_Size1-Regular.otf Resource interpreted as font but transferred with MIME type application/x-font-otf.
MathJax_Size2-Regular.otf Resource interpreted as font but transferred with MIME type application/x-font-otf.
MathJax_Size3-Regular.otf Resource interpreted as font but transferred with MIME type application/x-font-otf.
MathJax_Size4-Regular.otf Resource interpreted as font but transferred with MIME type application/x-font-otf.

You may want to try modifying
MathJax/jax/output/HTML-CSS/jas.js by commenting out the last line of the
Startup function and see if that helps. If that works, we can try adding
one of the two actions in and see which one is failing.
-> Commenting out line 317 in jax.js (return AJAX.Styles(this.config.styles,["PreloadWebFonts",this]);) makes no difference.

Do you have any
extensions or other add ons installed for Midori?
-> Nope.

It may not be worth putting too much more effort into debugging this issue.
-> You're probably right and it might just be an issue caused by my environment. I'll try replicating it on a 32bit virtual machine.

Jendrik

• Davide P. Cervone - 2010-06-04

Any luck with the 32-bit VM?

One thing I should have pointed out: when you comment out line 317, you will probably need to clear your cache AND restart the browser in order to be sure to get the new version. (Just reloading the page isn't enough, even forcing the reload, and clearing the cache seems not to be enough without the restart.)

The font warnings you are getting should not be a problem, and I don't think are related to the issue you are having (but it does show that you are actually getting the web-based fonts, which is good.)

Davide

• Jendrik Seipp - 2010-06-06

Any luck with the 32-bit VM?
-> It ssems to be a webkitgtk problem. I get the same errors on a 32-bit system and with epiphany.

Also restarting and clearing the cache didn't improve the midori situation with the commented out line 317.

The good thing is that it works and looks really pretty in my application (using webkit) it's just very slow... I'll probably just wait for newer webkit and mathjax versions and retry later.