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

Migrate away from MathJax CDN #52

Open
oddhack opened this issue Nov 21, 2018 · 2 comments
Open

Migrate away from MathJax CDN #52

oddhack opened this issue Nov 21, 2018 · 2 comments
Assignees

Comments

@oddhack
Copy link
Contributor

oddhack commented Nov 21, 2018

This hasn't been a problem since they implemented a redirect, but the MathJAX.org CDN has closed, and we should accomodate that. It doesn't just affect GL refpages on khronos.org, but this is a reasonable place to track the issue.

As James Riordon noted a while back, it is being used on lots of xhtml pages in the registry (eg.: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetSubroutineUniformLocation.xhtml).

This is the line:
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"/>

Also note that <script> needs a closing script tag, and not self closing. The above should be as follows:
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML”></script>

How to migrate away from mathJAX.org is located here:
https://www.mathjax.org/cdn-shutting-down/

Also, we need to add a viewport tag to all the headers of the registry pages to ensure they are properly readable on smartphones. Did one page as an example, highlighting the 2 lines that need changing in bold:

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetSubroutineUniformLocation.xhtml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>glGetSubroutineUniformLocation - OpenGL 4 Reference Pages</title>
    <link rel="stylesheet" type="text/css" href="opengl-man.css"/>
    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/>
    <meta content='width=device-width, height=device-height, minimum-scale=1.0, initial-scale=1.0, user-scalable=0' name='viewport'/>
    <script type="text/x-mathjax-config">
            MathJax.Hub.Config({
                MathML: {
                    extensions: ["content-mathml.js"]
                },
                tex2jax: {
                    inlineMath: [['$','$'], ['\\(','\\)']]
                }
            });
        </script>
	<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  </head>
@oddhack oddhack self-assigned this Nov 21, 2018
@greggman
Copy link

9 months later ... did this turn out to be harder than it looks?

TestingPlant added a commit to TestingPlant/OpenGL-Refpages that referenced this issue Jun 11, 2021
TestingPlant added a commit to TestingPlant/OpenGL-Refpages that referenced this issue Jun 11, 2021
@DaMatrix
Copy link

This hasn't been a problem since they implemented a redirect, [...]

This is now a problem: the MathJAX library won't even load for me any more on Firefox 87.0. When trying to read the docs for glBlendFunc, I noticed that the formulas in the table seemed broken. A quick look at the debug console showed that the MathJax CDN doesn't include the correct CSP headers any more: img

Setting security.csp.enable=false in about:config resolves the issue, but this should really be fixed correctly. Heck, the script at the current URL literally just loads the library from cdnjs.

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

No branches or pull requests

3 participants