mathML support


Recommended Posts

This is not an extension request, i'm just willing to share with Maxthon users a simple way to get support of mathML in the browser after having spent time on my own to get things to work properly.


You need to install ViolentMonkey extension to be able to run scripts :


Then use the applet coming from this page below, it sends mathML code to MathJax online translater and display it back in the browser.


For the sake of simplicity, you can just copy/paste the code below to ViolentMonkey

// ==UserScript==
// @name MathJax Bookmarklet
// @grant GM_addStyle 
// ==/UserScript==

javascript: (function()
    function e(e)
        var t = '.MathJax .mn {background: inherit;} .MathJax .mi {color: inherit;} .MathJax .mo {background: inherit;}';
        var a = e.createElement('style');
        a.innerText = t;
            a.textContent = t
        catch (n)
        var i = e.createElement('script'),
        i.src = '';
        i.type = 'text/javascript';
        o = 'MathJax.Hub.Config({tex2jax:{inlineMath:[[\'$\',\'$\']],displayMath:[[\'\\\\[\',\'\\\\]\']],processEscapes:true}});MathJax.Hub.Startup.onload();';
        if (window.opera) i.innerHTML = o;
        else i.text = o;

    function t(t)
        if (t.MathJax === undefined)
            t.MathJax.Hub.Queue(new t.Array('Typeset', t.MathJax.Hub))
    var a = document.getElementsByTagName('iframe'),
        n, i;
    for (n = 0; n < a.length; n++)
        i = a[n].contentWindow || a[n].contentDocument;
        if (!i.document) i = i.parentNode;

When this is done, activate the script in ViolentMonkey and go to this page for instance in order to test it :


Rem: For this to work you need to be in Ultra mode, this won't work in Retro mode.


Hope you will find this useful.  :)

  • Like 1
Link to comment
Share on other sites