Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mathjax doesn't works in Firefox 69.0.2 (Windows 8.1) #306

Closed
sindzicat opened this issue Oct 7, 2019 · 25 comments · Fixed by #307
Closed

Mathjax doesn't works in Firefox 69.0.2 (Windows 8.1) #306

sindzicat opened this issue Oct 7, 2019 · 25 comments · Fixed by #307

Comments

@sindzicat
Copy link

Let's say we have some test file:

= Test file
:nofooter:
:stem: latexmath

stem:[\sin(x^2)]

In browser we see the following:

image

It's okay. Please do nothing and wait for several seconds (approx 25 seconds).

You will see:

image

Please fix this and update mathjax version.

Unfortunately this error doesn't produce anything in devtools console. The only I found is:

TypeError: c.FONTDATA.FONTS.MathJax_Main[8212][5] is undefined

but this error is shown before math processing error.

Best regards,
Andrey.

@sindzicat
Copy link
Author

I found, what causes this error. But I was need to write video and make screenshot from video player, because error text was replaced by html page quickly:

image

@sindzicat
Copy link
Author

I reinstalled extension and found a way to get error message:

Error: this.imgEmWidth is undefined

file: moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/jax/output/HTML-CSS/imageFonts.js?V=2.7.2
line: 19

Debugging tips: use 'unpacked/MathJax.js', inspect 'MathJax.Hub.lastError' in the browser console

@sindzicat
Copy link
Author

MathJax.Hub.lastError
TypeError: "this.imgEmWidth is undefined"
    initImg moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/jax/output/HTML-CSS/imageFonts.js?V=2.7.2:19
    Translate moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/jax/output/HTML-CSS/jax.js?V=2.7.2:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    Process moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    call moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    WAITEXECUTE moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19

@sindzicat
Copy link
Author

Very strange... I repeated my experiments and got another error:

MathJax.Hub.lastError
TypeError: "MathJax.OutputJax[c.outputJax].Process is not a function"
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    AFTER moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processError moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    processOutput moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    execute moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    Process moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    call moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    WAITEXECUTE moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19
    cb moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/MathJax.js?config=TeX-MML-AM_HTMLorMML:19

@sindzicat
Copy link
Author

MathJax.Message.Log()
"
Loading [MathJax]/config/TeX-MML-AM_HTMLorMML.js
Loading [MathJax]/jax/output/HTML-CSS/jax.js
Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js
Loading [MathJax]/jax/output/HTML-CSS/imageFonts.js
Loading [MathJax]/fonts/HTML-CSS/TeX/png/imagedata.js
File failed to load: moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/fonts/HTML-CSS/TeX/png/imagedata.js
File failed to load: moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/jax/output/HTML-CSS/jax.js
Error preparing HTML-CSS output (preProcess)
File failed to load: moz-extension://c6b73dec-c558-458d-808c-0d837a088a39/vendor/MathJax/jax/output/HTML-CSS/imageFonts.js"

@sindzicat
Copy link
Author

Hm... It seems that Firefox blocks to load some files...

@ggrossetie
Copy link
Member

Thanks for raising this issue and digging into it!
I believe this issue should belong to https://github.com/asciidoctor/asciidoctor-browser-extension right? Let's continue the discussion over there 😉

@ggrossetie ggrossetie transferred this issue from asciidoctor/asciidoctor.js Oct 7, 2019
@sindzicat
Copy link
Author

Yes, it's right. I'm about extension for Firefox.

@sindzicat
Copy link
Author

sindzicat commented Oct 7, 2019

The problem is that something blocks some MathJax files in Firefox. Any ideas to fix this?

@ggrossetie
Copy link
Member

Firefox 68 introduced a strict security policy: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/68#Security

Can you please try this procedure: #302 (comment) ?

@sindzicat
Copy link
Author

sindzicat commented Oct 7, 2019

privacy.file_unique_origin is false already. Sorry, this didn't help me.

@sindzicat
Copy link
Author

sindzicat commented Oct 7, 2019

By the means, I switched privacy.file_unique_origin to false, because include directive didn't work. I found you comment and made this change.

@sindzicat
Copy link
Author

sindzicat commented Oct 7, 2019

I found a workarround:

  1. about:config
  2. type policy in search field and wait for a few seconds
  3. backup value of field extensions.webextensions.default-content-security-policy in text file.
  4. copy value of field extensions.webextensions.base-content-security-policy to value of field extensions.webextensions.default-content-security-policy. In my case I copied script-src 'self' https://* moz-extension: blob: filesystem: 'unsafe-eval' 'unsafe-inline'; object-src 'self' https://* moz-extension: blob: filesystem:;

After these manipulations all works fine.

That means that problem is in content security policy. It seems to me you should edit extension manifest to fix this problem.

UPD: Sorry, this is NOT a workarround.

@sindzicat
Copy link
Author

Just found (maybe, this will be usefull):

Firefox does not support 'http://127.0.0.1' or 'http://localhost' as script sources: they must be served over HTTPS.

@sindzicat
Copy link
Author

Now I found what causes this problem.

I got log again:

MathJax.Message.Log()
"
Loading [MathJax]/config/TeX-MML-AM_HTMLorMML.js
Loading [MathJax]/jax/output/HTML-CSS/jax.js
Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js
Loading [MathJax]/jax/output/HTML-CSS/imageFonts.js
Loading [MathJax]/fonts/HTML-CSS/TeX/png/imagedata.js
File failed to load: moz-extension://a1ee119f-6f8c-4372-b219-7f46295a6157/vendor/MathJax/fonts/HTML-CSS/TeX/png/imagedata.js
File failed to load: moz-extension://a1ee119f-6f8c-4372-b219-7f46295a6157/vendor/MathJax/jax/output/HTML-CSS/jax.js
Error preparing HTML-CSS output (preProcess)
File failed to load: moz-extension://a1ee119f-6f8c-4372-b219-7f46295a6157/vendor/MathJax/jax/output/HTML-CSS/imageFonts.js"

The first problem file is moz-extension://a1ee119f-6f8c-4372-b219-7f46295a6157/vendor/MathJax/fonts/HTML-CSS/TeX/png/imagedata.js I tried to open this link in Firefox and saw that there is no such file.

Then I found extension xpi file, copied it on Desktop and opened this file via 7zip as archive. I found that folder png is really missing in vendor/MathJax/fonts/HTML-CSS/TeX/. So this is definitely error of this extension.

image

Please update Mathjax to the latest 2.7.6 version and pack it correctly.

@ggrossetie
Copy link
Member

Then I found extension xpi file, copied it on Desktop and opened this file via 7zip as archive. I found that folder png is really missing in vendor/MathJax/fonts/HTML-CSS/TeX/. So this is definitely error of this extension.

We do not include the whole MathJax distribution (33Mb).
The browser extension (without MathJax) is only a few Mb and I don't want to add more than 30Mb just for one feature.

Also, please note that the package hasn't changed in years and, as far as I know, it was working fine in Firefox 68 (and it's also working fine in Chrome). So something changed in Firefox.

Please update Mathjax to the latest 2.7.6 version and pack it correctly.

There's already an issue to upgrade to MathJax 2.7.6: #274

I will try to include the whole Mathjax distribution in extension to troubleshoot this issue on Firefox.

@sindzicat
Copy link
Author

Surprisingly, Chrome extension doesn't have this file too. But log is difference slightly:

Loading [MathJax]/config/TeX-MML-AM_HTMLorMML.js
Loading [MathJax]/jax/output/HTML-CSS/jax.js
Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js
Loading web-font TeX/Math/Italic
Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/AMS/Regular/Main.js
Loading web-font TeX/Main/Regular"

So it's possible for MathJax to load web fonts in Chrome. That's why I see first error TypeError: c.FONTDATA.FONTS.MathJax_Main[8212][5] is undefined in Firefox.

According documentation this is an expected behavior. Hm...

@sindzicat
Copy link
Author

I downloaded and installed MathJax fonts from here and restarted Firefox. This solved my problem.

Maybe you need to update documentation. Also it seems to me that such problem will not presented in MathJax 3.0.

@sindzicat
Copy link
Author

@Mogztter, sorry, I didn't see your answer. You don't need to include full MathJax distro in extension. Just add in documentation, that Firefox users need install Mathjax font on their computers.

@ggrossetie ggrossetie reopened this Oct 8, 2019
@ggrossetie
Copy link
Member

No worries.
MathJax should work out of the box, I will see what I can do to please Firefox 😉

@ggrossetie
Copy link
Member

Using MathJax 3+ seems to resolve this issue.

@ggrossetie
Copy link
Member

I've just released and published version 2.3.0: https://github.com/asciidoctor/asciidoctor-browser-extension/releases/tag/v2.3.0
Could you please confirm that this issue is now resolved (using MathJax 3.0.0) ?

Also the rendering should be faster ⚡

@sindzicat
Copy link
Author

Just tested in Firefox. All works fine! 👍 Many thanks!

Also, rendering is very fast now!

@ggrossetie
Copy link
Member

I'm glad to hear that!
Thanks for your report 🧾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants