Sign up ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

Love typesetting? Then i bet you know exactly what MathJax is, but if you don't already know, MathJax is a javascript-based implementation of LaTeX that is compatable with a few different sets of markup.

enter image description here

MathJax is nothing new to the Exchange's chats, ManishEarth wrote a bookmarklet found here. The extension takes the bookmarklet idea to the next level.

The extension utilizes the Google Tabs api to detect when you load a* URL. A direct result of this is a small amount of code that gets evaluated on every single onUpdated tab event.

One of the issues inherent in the bookmarklet is that it relies on an ajaxComplete() event handler which, in some (most?) cases, leads to a bug that causes the equation to revert back to text until a new post is made in chat. This extension utilizes a timeout function that updates MathJax on a timer. The default time is 5 seconds, but that can be changed.

The extension adds a new button to each chat window, clicking it will open the settings menu where you can specify a different timeout length. You can also elect to use the old ajax event handler to update MathJax if performance will be an issue. There is also a checkbox to stop the extension from updating.

The extension can be found on the Chrome Store and on GitHub. The packaged .crx file is also included with the source, just in case you despise the Chrome Store.

As always, any suggestions/criticisms are welcome.

share|improve this question

1 Answer 1

I tried the extension now for a few days and generally I did not have experienced any failures (+1).

When I enter a MathJax heavy chatroom I might not want all the code to be rendered immediately (it can be a bit annoying). Sometimes I just want to leave a short message and go my merry way again. I don't need the code to be rendered then.

I'd like to have an option, so that I can trigger rendering manually, i.e. the default would be to not render MathJax commands on chat room entry.

When I use the disable option, I noticed that it only affects new posts. Switching chats will also cause to reset that, I'd like to have an option to permanently disable the rendering and only switch it on when I absolutely need it.

share|improve this answer
Yes, unfortunately the extension does not utilize the LocalStorage API like I had originally planned. I will be working on this in the next few days (probably weeks). I will keep you up to date on any changes. – David Freitag Oct 2 at 19:09
@David Thanks for looking into it and also thank you for giving us a better option than the bookmarklet. – Martin - マーチン Oct 14 at 10:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .