Closed GoogleCodeExporter closed 9 years ago
Actually not even the fallback 'desktop' version works on Firefox for Android
because of inconsistent permutations:
1) Firefox mobile has the ua string: Mozilla/5.0 (Android; Mobile; rv:13.0)
Gecko/13.0 Firefox/13.0
2) The property-provider for mgwt.os (com/googlecode/mgwt/dom/DOM.gwt.xml) thus
returns: "android"
3) This mgwt.os is then however overwritten (in
com/googlecode/mgwt/dom/DOM.gwt.xml) with
>>
<set-property name="mgwt.os" value="desktop" >
<none>
<when-property-is name="user.agent" value="safari" />
</none>
</set-property>
<<
4) And this leads to an inconsistent "*.nocache.js" file:
>>
...
unflattenKeylistIntoAnswers(['retina', 'yes', 'safari'], 'HASHASH');
unflattenKeylistIntoAnswers(['ipad_retina', 'yes', 'safari'], 'HASHASH');
unflattenKeylistIntoAnswers(['blackberry', 'no', 'safari'], 'HASHASH');
unflattenKeylistIntoAnswers(['android', 'yes', 'safari'], 'HASHASH');
strongName = answers[computePropValue('mgwt.os')][computePropValue('phonegap.env')][computePropValue('user.agent')];
<<
which fails at the last line in this snippet because
computePropValue('mgwt.os') gives "android" but no android/phonegap/gecko
permutation was created.
Workaround:
To me it seems the inconsistency problem is actually a gwt issue.
in any case, the workaround I found is to redefine the property-provider for
mgwt.os to make it consistent with the set-property rule:
>>
<property-provider name="mgwt.os"><![CDATA[
{
var mgwt_os = (function(){
var ua = window.navigator.userAgent.toLowerCase();
//!!! ADDED TO MAKE CONSISTENT WITH set-property rule ('non-safari -> desktop')
if(ua.indexOf("safari")<0) return "desktop";
if(ua.indexOf('android') != -1) {
if(ua.indexOf('mobile') != -1) {
return "android";
} else {
return "android_tablet";
}
}
...
<<
Original comment by robert.h...@gmail.com
on 11 Nov 2013 at 12:57
just for reference, I have opened a GWT issue too -
https://code.google.com/p/google-web-toolkit/issues/detail?id=8427
Original comment by robert.h...@gmail.com
on 11 Nov 2013 at 1:22
WIth mgwt 2.0 we added a more generic way of permutations per device, so we do
not need to list any device explicitly anymore.
Original comment by kurka.da...@gmail.com
on 13 Jul 2014 at 5:13
Original issue reported on code.google.com by
robert.h...@gmail.com
on 10 Nov 2013 at 4:26