# Google Chrome Chat MathJax Extension

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.

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 http://chat.stackexchange.com/rooms/* 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.

## 1 Answer

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.

• 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. Oct 2 '15 at 19:09
• @David Thanks for looking into it and also thank you for giving us a better option than the bookmarklet. Oct 14 '15 at 10:28