Skip to content

Hosted MathJax do CDN requests for dynamic font #3521

@MaxencePaulin

Description

@MaxencePaulin

Issue Summary

I use MathJax 4.1.0 only for typesetPromise([specificEl]). So i host MathJax on a Laravel application (installed via NPM).

It works. But i recently add a CSP and prevent script execution. But tex-chtml.js do a CDN request for chtml/dynamic/latin.js on default font (mathjax-newcm). I only config MathJax to prevent typeset on load and to disable some feature.

But mathjax-newcm is installed via npm too...

I tried to set dynamicPrefix in chtml config option to target local mathjax-newcm. I think it works but i have a new warning like No version information available for component. It's normal ? Should have to change something ?

Steps to Reproduce:

  1. Install MathJax 4.1.0 via NPM on web app (with default font = no specific configuration on MathJax object)
  2. Add a CSP self / nonce
  3. Try to typesetPromise on LaTeX formula and watch console (a CDN request for latin.js should be visible)

If you add dynamicPrefix on chtml in MathJax config object, you will see a warning No version information available for component

Technical details:

  • MathJax Version: 4.1.0
  • Client OS: Ubuntu 24.04
  • Browser: Brave 1.86.148

I am using the following MathJax configuration:

MathJax = {

};

and loading MathJax via NPM exposed on link :

<script src="https://exemple.com/mathjax/tex-mml-chtml.js"></script>

Supporting information:

CDN request when i use typesetPromise.

When i use this config :

MathJax = {
    chtml: {
        dynamicPrefix: "my_url_to_exposed_dynamic_font"
    }
};

The CSP error disapear but a warning appear in console : No version information available for component https://exemple.com/mathjax/chtml/dynamic/latin.js

(The url match with the dynamicPrefix)

I hope you can tell me if it's meaning latin.js is not load (unwanted behavior) and if there is a better solution for use MathJax without CDN request 😁

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code ExampleContains an illustrative code example, solution, or work-aroundQuestionv4

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions