Friday, April 29, 2011

Re: GWT and PS3

I rewrote the whole property provider, forcing PS3 pick up IE6
implementation, so even sample GWT have not being executed

<property-provider name="user.agent"><![CDATA[
var ua = navigator.userAgent.toLowerCase();
var makeVersion = function(result) {
return (parseInt(result[1]) * 1000) + parseInt(result[2]);
};

if (ua.indexOf("opera") != -1) {
return "opera";
} else if (ua.indexOf("webkit") != -1) {
return "safari";
} else if (ua.indexOf("msie") != -1) {
if (document.documentMode >= 8) {
return "ie8";
} else {
var result = /msie ([0-9]+)\.([0-9]+)/.exec(ua);
if (result && result.length == 3) {
var v = makeVersion(result);
if (v >= 6000) {
return "ie6";
}
}
}
}
else if (ua.indexOf("playstation") != -1) {
return "ie6";
}
else if (ua.indexOf("gecko") != -1) {
var result = /rv:([0-9]+)\.([0-9]+)/.exec(ua);
if (result && result.length == 3) {
if (makeVersion(result) >= 1008)
{
return "gecko1_8";
}
}
return "gecko";
}
return "unknown";
]]></property-provider>

Any other inputs to consider is highly appreciated.

On Apr 28, 4:27 pm, Excell <anton.fedo...@gmail.com> wrote:
> user.agent for PS3 is Mozilla/5.0 (PLAYSTATION 3; 1.00)
>
> so, do you mean that I have to add something like that
>
> <property-provider name="mobile.user.agent"><![CDATA[
>   {
>     var ua = window.navigator.userAgent.toLowerCase();
>     if (ua.indexOf('playstation') != -1) { return 'ie6'; }
>   }
> ]]></property-provider>
>
> or am I missing something here?
>
> On Apr 20, 6:39 am, jhulford <jhulf...@gmail.com> wrote:
>
>
>
> > The user agent detection is defined in the UserAgent.gwt.xml module
> > definition file (http://code.google.com/p/google-web-toolkit/source/
> > browse/trunk/user/src/com/google/gwt/user/UserAgent.gwt.xml).  You can
> > actually override that provider in your own module file by making your
> > own <property-provider name="user.agent"> in it.  If you figure out
> > what the PS3's user agent is and map it to any of the user agents that
> > are currently utilized in GWT.  That won't mean everything will
> > necessarily work if the PS3 browser doesn't actual work like the
> > browser you're mapping it to, but it will get you past the hump of
> > getting the PS3 browser to run your GWT code.
>
> > On Apr 19, 7:45 pm, Excell <anton.fedo...@gmail.com> wrote:
>
> > > Is anyone achieve loading GWT compiled app in PlayStation 3 (Netfront)
> > > browser. I have tried to compile IE6 only permutation, but PS3 did not
> > > pick it up. Any suggestions?

--
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