Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Auto ChatJax
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match http://chat.stackexchange.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- setTimeout(function(){
- // Your code here...
- if(window.MathJax===undefined){
- var script = document.createElement("script");
- script.type = "text/javascript";
- script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML";
- var config = 'MathJax.Hub.Config({' + 'extensions: ["tex2jax.js"],' + 'tex2jax: { inlineMath: [["$","$"],["\\\\\\\\\\\\(","\\\\\\\\\\\\)"]], displayMath: [["$$","$$"],["\\\\[","\\\\]"]], processEscapes: true },' + 'jax: ["input/TeX","output/HTML-CSS"]' + '});' + 'MathJax.Hub.Startup.onload();';
- if (window.opera) {script.innerHTML = config;}
- else {script.text = config;}
- document.getElementsByTagName("head")[0].appendChild(script);
- var doChatJax=(function(){window.setTimeout(doChatJax,1000);MathJax.Hub.Queue(["Typeset",MathJax.Hub]);})();
- }else{
- MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
- }},1000);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement