5

The GitHub wiki pages no longer support MathJax. It seems like the dotjs Chrome extension might be a way to enable MathJax on these pages.

Here is my first attempt at creating javascript that would execute on github.com pages, and insert the right code needed to enable MathJax:

[~]$ cat .js/github.com.js
(function () {
  var script = document.createElement("script");
  script.type = "text/javascript";
  script.src = "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
  document.getElementsByTagName("head")[0].appendChild(script);
 })();

This doesn't work, however, and the following error appears in the Chrome JavaScript Console:

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'
https://github.com https://a248.e.akamai.net https://jobs.github.com https://ssl.google-analytics.com https://secure.gaug.es https://collector.githubapp.com https://gist.github.com".
    c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML:29

What is the correct JavaScript?

Michael
  • 517
  • 1
  • 4
  • 14

1 Answers1

0

I think the problem is in the source code of MathJax because it uses the eval function there

0e4ef622
  • 460
  • 4
  • 14