Detect the internet browser
Monkey Targets Forums/HTML5/Detect the internet browser
| ||
Hi all, Is there a method in order to detect on which internet browser (IE, Safari etc) an app is running ? Thanks Pit |
| ||
See the audio test sample from Mark (mak). It shows you how to use the navigator.userAgent to get some information. The link below should give you some idea on how to use it. http://www.javascriptkit.com/javatutors/navigator.shtml |
| ||
Thanks dawlane. But the code is in javascript. No monkey code in order to do it ? cheers Pit |
| ||
UserAgent should also be accessible in the dom module in the navigator member. The link should give you some idea on what you should be searching for in a userAgent string. Edit: Some code Strict Import mojo Import dom Class CGame Extends App Method OnCreate:Int() Print window.navigator.userAgent Return 0 End Method OnUpdate:Int() Return 0 End Method OnRender:Int() Return 0 End End Function Main:Int() New CGame() Return 0 End |
| ||
ok thanks but then my question is "how to access the dom module from monkey ?" is there a method or a function able to do that ? Pit |
| ||
See edited post above with code. It's part of the dom window class. |
| ||
One more thing you will not find dom in the documentation. Why I don't know. But it may be because it's only for HTML, but for reference see the w3schools.com website and the dom module for comparison. |
| ||
thanks dawlane. in fact, it was my next question: "I don't find any dom module ?" :-) so i will try yur solution ! thanks again ! Pit |