You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by solomax <gi...@git.apache.org> on 2018/03/21 15:45:31 UTC
[GitHub] wicket pull request #269: [WICKET-6544] mobile browser detection is improved
GitHub user solomax opened a pull request:
https://github.com/apache/wicket/pull/269
[WICKET-6544] mobile browser detection is improved
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/wicket WICKET-6544-mobile-browsers
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/wicket/pull/269.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #269
----
commit 0cc14749903f51057cc75d011cbc8a02a4e42f4c
Author: Maxim Solodovnik <so...@...>
Date: 2018-03-21T15:44:17Z
[WICKET-6544] mobile browser detection is improved
----
---
[GitHub] wicket pull request #269: [WICKET-6544] mobile browser detection is improved
Posted by solomax <gi...@git.apache.org>.
Github user solomax closed the pull request at:
https://github.com/apache/wicket/pull/269
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the issue:
https://github.com/apache/wicket/pull/269
With the addition of these new mobile browsers user agent strings the code becomes more complex.
Maybe we should think in direction how to make use of external libraries to do this checks, e.g. https://github.com/pieroxy/java-user-agent-detection or https://github.com/HaraldWalker/user-agent-utils
---
[GitHub] wicket pull request #269: [WICKET-6544] mobile browser detection is improved
Posted by solomax <gi...@git.apache.org>.
Github user solomax commented on a diff in the pull request:
https://github.com/apache/wicket/pull/269#discussion_r176132347
--- Diff: wicket-core/src/test/java/org/apache/wicket/protocol/http/request/WebClientInfoTest.java ---
@@ -680,6 +708,35 @@ public void konqueror()
}
}
+ @Test
+ public void ffMobile()
+ {
+ final String userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) FxiOS/10.6b8836 Mobile/15D100 Safari/604.5.6";
+ WebClientInfo webClientInfo = new WebClientInfo(requestCycleMock, userAgent);
+
+ assertThat(userAgent, webClientInfo.getProperties().getBrowserVersionMajor(),
+ is(equalTo(10)));
+ assertThat(userAgent, webClientInfo.getProperties().getBrowserVersionMinor(),
+ is(equalTo(6)));
+ assertThat(userAgent, webClientInfo.getProperties().isBrowserMozillaFirefox(),
+ is(equalTo(true)));
+ assertThat(userAgent, webClientInfo.getProperties().isBrowserMozilla(),
--- End diff --
This part is something I don;t really like in this PR :(
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by kbachl <gi...@git.apache.org>.
Github user kbachl commented on the issue:
https://github.com/apache/wicket/pull/269
drop this "feature" completely - it just wont work reliable anyway
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the issue:
https://github.com/apache/wicket/pull/269
I also looked a bit around and stumbled over Apache DeviceMap which has been moved into the Attic and from the Attic (http://attic.apache.org/projects/devicemap.html) I followed the link to https://github.com/nielsbasjes/yauaa which seems to be maintained.
@kbachl - I understand your suggestion to remove it because of reliability, but I would keep the functionality with the hint that there might be some not supported browsers which is better than no detection.
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by solomax <gi...@git.apache.org>.
Github user solomax commented on the issue:
https://github.com/apache/wicket/pull/269
And/or maybe browser list and supported patterns can be cleaned up to support more recent versions only?
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the issue:
https://github.com/apache/wicket/pull/269
In my opinion and because of such a big pool of browsers I would say yes.
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the issue:
https://github.com/apache/wicket/pull/269
See my suggestion over here: https://github.com/apache/wicket/pull/269
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by svenmeier <gi...@git.apache.org>.
Github user svenmeier commented on the issue:
https://github.com/apache/wicket/pull/269
Guys I get it, there are many good solutions to choose from, but why should we make Wicket dependent on anyone of them?
https://github.com/nielsbasjes/yauaa looks good, but do users really need assistance for this?
`UserAgent userAgent = analyzer.parse(new WebClientInfo(requestCycle).getUserAgent());`
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the issue:
https://github.com/apache/wicket/pull/269
I just tested a bit around and I would suggest the following changes:
* Drop the support for minor version in exchange for a full version String (11.0, 3.5.8, 4.0b4a)
* Change the implementation to yauaa - I also played around a bit and found some not correctly resolved version numbers (the browsers are all detected correctly) https://github.com/nielsbasjes/yauaa/issues/75
* Change the UserAgent enum to not handle excludes, but only browser names
If the issue is fixed I can provide a PR.
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the issue:
https://github.com/apache/wicket/pull/269
Close this one in favour of the mentioned one? (https://github.com/apache/wicket/pull/275)
---
[GitHub] wicket issue #269: [WICKET-6544] mobile browser detection is improved
Posted by solomax <gi...@git.apache.org>.
Github user solomax commented on the issue:
https://github.com/apache/wicket/pull/269
OK, let's close this one :)
---