5
GitHub wikiページは、もはやMathJaxをサポートしていません。 dotjs Chrome extensionは、これらのページでMathJaxを有効にする方法と思われます。しかし、GitHub wikiページでMathJaxを有効にするためにJavaScriptを挿入するには?
[~]$ 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);
})();
これは動作しませんし、次のエラー:
は、ここに私のgithub.comページ上で実行し、MathJaxを有効にするために必要な権利のコードを挿入するJavaScriptを作成する最初の試みでありますChromeのJavaScriptコンソールに表示されます。
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
正しいJavaScriptは何ですか。
そこにeval関数を使用しています今、あなたは_why_ GitHubには、もはやMathJaxをサポートしている知っていないため、問題がMathJaxのソースコードであると思います。 MathJaxはCSPでは動作しません。 https://github.com/blog/1477-content-security-policy – SLaks
https://github.com/mathjax/MathJax/issues/256 – SLaks
これは、MathJaxが互換性を持たない限り、私が望むことができないことを意味しますか? CSPとは? – Michael