How to detect internal browser usage?
-
Howdy;
I'm working on developing an HTML user interface component using the WebDialog class and since it has a whole bunch of JavaScript I'd like to be able to debug it in Safari. The problem, of course, are the Ruby callbacks: almost every event that occurs sets the URL of the browser to skp:action_callback@action_name, which Safari obviously can't open.
So, I'd like to modify my Ruby call method to include a check to see if the HTML is being rendered within Sketchup or not, but I'm having some trouble figuring out how to do this. The best I've been able to come up with is to check the output of the navigator.userAgent method but this doesn't seem very robust.
Does anyone know of a better way to do this?
Many thanks,
Josh
-
I think the user agent string is only available under SU8.
Not sure what other method to use. You should ask Rich Morin - he's been working in the same lines as what you mention. -
Thanks for the reply. I assume the fellow you mention is somewhere on this forum?
Josh
-
Yes. I gave him a nudge in this direction.
Advertisement