webview vs. safari

24 views
Skip to first unread message

RobertM

unread,
Oct 28, 2010, 4:35:31 PM10/28/10
to MathJax Users
[Previously posted at http://sourceforge.net/projects/mathjax/forums/forum/948701/topic/3905923]

pgarst
2010-10-20 18:22:05 UTC

Sorry if this is a newbie question -
I have a sample page that works fine in Safari using a local Mathjax
installation, the key line being

MathJax.Hub.Queue(["Typeset",MathJax.Hub,divobjx]);

When I run this same material in a webview in a Cocoa app it fails to
process the mathml.
I don't think it's a path problem, since it's finding images and other
items.
No error report, it just strips the xml from the mathml and leaves the
rest, for example x2+y2 instead of showing exponents.
Anyone have experience with this?

Thanks!

--------------

dpvc
2010-10-21 00:30:12 UTC

I don't know anything about WebView, but I'm wondering if it handles
JavaScript, or if there is a setting to enable it that might be off by
default? Do other scripts run properly?

If you can execute a script that does
alert(MathJax.Message.Log())
that might give some clues as to what is happening. Also, try
alert(MathJax.Hub.Browser)
to see what MathJax thinks is the browser (I'm hoping it says Safari,
which is what WebKit browsers should show up as).

Davide

--------------

pgarst
2010-10-21 19:07:20 UTC

Thanks for your note.

I pointed the webview component to the MathJax home page and it
displayed fine, so this is clearly something about using a local
installation rather than any real incompatibility.
I followed your suggestion, and MathJax in a webview does report
Safari as the browser.
Nothing in the MathJax log.

I'll look into this more. I've had problems in the past with webview
objecting to mixed local and remote content on security grounds, and
this might be related.

Peter

--------------

dpvc
2010-10-21 20:51:31 UTC

OK, thanks for the update. I suspect you are right about the mixed
local and remote content security issue. I know that Safari won't let
you inject a script tag to a local file via a bookmarklet, for
example, to it may be something like that.

If you find out anything more, please consider sharing it with us.

Davide
Reply all
Reply to author
Forward
0 new messages