Hi,
Like property's definition of "user.agent" ( see
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/UserAgent.gwt.xml?r=4347)
you can define a property ( or extend "user.agent" ) to detect chrome
or
safari.
<define-property name="myProperty" values="safari,chrome"/>
<property-provider name="myProperty"><![CDATA[
var ua = navigator.userAgent.toLowerCase();
if (/* js test to detect chrome browser */) {
return "chrome";
} else if (/* js test to detect safari browser */) {
return "safari";
}
return "unknown";
]]></property-provider>
Thus, you can use it with <when-property-is name="myProperty"
value="safari"/> or <when-property-is name="myProperty" value="chrome"/>
Alexandre.
2011/8/29 Tarnakin Sergey <[email protected]>
> Hi, I have to compile different code for safari and chrome browsers.
> The problem is when I use code like
> this
> <replace-with
> class="org.raccoon.hit.client.ui.balancenew.BalanceViewImplChrome">
> <when-type-is
> class="org.raccoon.hit.client.ui.balance.BalanceViewImplAll"/>
> <any>
> <when-property-is name="user.agent" value="safari"/>
> </any>
> </replace-
> with>
> property "user.agent" is the same for safari and chrome.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.