mathml-chrome icon indicating copy to clipboard operation
mathml-chrome copied to clipboard

not working on slack.com

Open schlichtanders opened this issue 9 years ago • 5 comments

I just tried Math Anywhere and found that this github-repository corresponds to it. With my colleages we use slack.com and where I wanted to render latex messages.

I first got an error, that I cannot load "http://path-to-latest-mathjax..." within https request or something like that, where changing http -> https indeed resolved the error (in the Chrome Development Panel).

Now there is no error at all left, but $x^2$ and such does not get changed. Any idea, why this can happen?

schlichtanders avatar Feb 09 '16 12:02 schlichtanders

The reason is that on Slack text-containing elements are dynamically added and in this extension DOM tree is parsed only once in order not to slow down dynamic sites.

It should be relatively easy to extend code to support Slack (target just specific text elements which appear when you chat) and pull requests are highly welcomed :)

andrusha avatar Feb 21 '16 14:02 andrusha

Dear Andrew, thanks for the response

I just browsed a bit through your code and found

​ chrome.tabs.onUpdated.addListener (tabId, changeInfo, tab) ->

if changeInfo.status is 'loading'

math.processTab tab

math.toggleIcon tab

is there a reason that you do everything when it is loading, instead of when it is complete? Intuitively, running mathjax after the page is completely loaded would already do the trick, doesn't it? Do I miss something?

On 21 February 2016 at 15:42, Andrew Korzhuev [email protected] wrote:

The reason is that on Slack text-containing elements are dynamically added and in this extension DOM tree is parsed only once in order not to slow down dynamic sites.

It should be relatively easy to extend code to support Slack (target just specific text elements which appear when you chat) and pull requests are highly welcomed :)

— Reply to this email directly or view it on GitHub https://github.com/andrusha/mathml-chrome/issues/6#issuecomment-186833776 .

schlichtanders avatar Feb 22 '16 08:02 schlichtanders

@schlichtanders it gives better user experience, many pages take 15+ seconds to be fully loaded (including background trackers, analytics, etc), while they become browseable after 4-5 sec, so it's better to inject this dependency as soon as possible.

andrusha avatar Feb 22 '16 16:02 andrusha

is it possible to run the code twice? once in the beginning and once in the end? This may already work as a first solution, and would in general just improve the user experience

On 22 February 2016 at 17:36, Andrew Korzhuev [email protected] wrote:

@schlichtanders https://github.com/schlichtanders it gives better user experience, many pages take 15+ seconds to be fully loaded (including background trackers, analytics, etc), while they become browseable after 4-5 sec, so it's better to inject this dependency as soon as possible.

— Reply to this email directly or view it on GitHub https://github.com/andrusha/mathml-chrome/issues/6#issuecomment-187256414 .

schlichtanders avatar Feb 22 '16 17:02 schlichtanders

Not sure if it'll help, new messages are added dynamically to the page, so you have to listen to the new events to be sure if it works right. Maybe Matjax itself has some options, but I'm not sure

andrusha avatar Feb 22 '16 22:02 andrusha