Tuesday, August 2, 2011

Re: GWT Browser Support Restriction

Detecting the browser type
public static native String getUserAgent() /*-{
return navigator.userAgent.toLowerCase();
}-*/;

and using something like
if(getUserAgent().contains("msie"))
{
// code for ie
} else {

// code for other browsers
}

will get you what you want.
Possibly better is to compile only for IE by setting the user.agent
property in your .gwt.xml file and have logic in your startup page
that will display a message for "unsupported" browsers.

On Aug 2, 8:41 am, Vijay Sarin <sarinv...@gmail.com> wrote:
> Hi Team,
>
> Can we Restrict Browser Support of GWT Application to a Single One.
> For Example, i want my application to be working only on Microsoft
> Internet Explorer, and when opened in Mozilla Firefox or Safari or
> Chrome, it must show a message Stating that "You must need IE6 or
> Higher to view this Page" or something else like that.
>
> My Suggestion is, when compiling a GWT Application we are Actually
> Compiling for Each Various Browsers. That is the Output Stating
> "Compiling Permutations". So can we restrict this.
>
> I am waiting for all of your valuable replies to move on to the next
> section of my GWT Learning.
>
> Thank You

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment