-
9 Nov 2011 4:42 AM #1
Answered: Detecting if isWebkit Browser or supports sencha touch
Answered: Detecting if isWebkit Browser or supports sencha touch
Hallo,
how can i detect if the Browser supports "Sencha Touch 1.1" (WebKit).
In "Sencha Touch 2.0" you can do:
Is there a way to do that in Sencha Touch 1.1?Code:if(Ext.browser.is.WebKit){// WebKit specific code here}
Thanks!
-
Best Answer Posted by AndreaCammarata
Hi tr1x.
Actually in Touch 1, there is no browser check function available.
However, you can use the Ext.is and Ext.supports singleton classes to check if your browser capabilities, or, even better, you can apply a regex to the "userAgent" property of "navigator" object.
This property on webkit desktop browser should be something like:
Hope this helps.Code:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22
-
9 Nov 2011 5:09 AM #2
dirty solution
dirty solution
What about this litle solution
Code:if(!Ext.is.Android && !Ext.is.Blackberry && !Ext.is.iOS){ //do some stuff }
-
9 Nov 2011 5:11 AM #3
Hi tr1x.
Actually in Touch 1, there is no browser check function available.
However, you can use the Ext.is and Ext.supports singleton classes to check if your browser capabilities, or, even better, you can apply a regex to the "userAgent" property of "navigator" object.
This property on webkit desktop browser should be something like:
Hope this helps.Code:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22
Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
9 Nov 2011 5:38 AM #4
thx
thx
hey thx for the tip.
this is my final solution:
Code:if((/(WebKit)/i).test(navigator.userAgent) == false){ //do some cool stuff }
-
9 Nov 2011 5:45 AM #5
You are welcome
Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata


Reply With Quote