I've a problem to detect Safari 5.1.7 in Wndows 7. The user agent is:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2
It was detected with the following information:
Family: WebKit-based
Description: Safari-like
Version:
Full version:
Rendering Engine: WebKit 534.57.2
Is Gecko: No
Is Webkit/Blink: Yes
Is Trident: No
Is a Robot: No
The problem is on the class UserAgentDetector. In the line 1132:
I've a problem to detect Safari 5.1.7 in Wndows 7. The user agent is:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2
It was detected with the following information:
Family: WebKit-based Description: Safari-like Version:
Full version:
Rendering Engine: WebKit 534.57.2 Is Gecko: No Is Webkit/Blink: Yes Is Trident: No Is a Robot: No
The problem is on the class UserAgentDetector. In the line 1132:
context.contains("Windows NT", MatchingType.BEGINS, MatchingRegion.PARENTHESIS)
The "Windows NT" token was consumed in the SO detection and it's not available in the parenTokens property (used in getToken() method).
In the previous line, you use context.contains("Mac OS", MatchingType.CONTAINS, MatchingRegion.CONSUMED), that i think it's the correct manner.
I added the next line to your code and it's works sucessfully.
|| context.contains("Windows NT", MatchingType.CONTAINS, MatchingRegion.CONSUMED)