OpenGL-Refpages icon indicating copy to clipboard operation
OpenGL-Refpages copied to clipboard

Migrate away from MathJax CDN

Open oddhack opened this issue 6 years ago • 2 comments

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:

Also note that

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 avatar Nov 21 '18 14:11 oddhack

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

greggman avatar Aug 15 '19 08:08 greggman

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.

DaMatrix avatar Oct 10 '21 14:10 DaMatrix