Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the WP8.1 / IE11 bug on the JavaScript library. IE11 has in the… #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Java/UAgentInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ public void initDeviceScan() {
*/
public boolean detectIphone() {
// The iPad and iPod touch say they're an iPhone! So let's disambiguate.
if (userAgent.indexOf(deviceIphone) != -1 &&
if (!detectWindowsPhone10() &&
userAgent.indexOf(deviceIphone) != -1 &&
!detectIpad() &&
!detectIpod()) {
return true;
Expand Down Expand Up @@ -369,8 +370,9 @@ public boolean detectIos() {
* @return detection of an Android device
*/
public boolean detectAndroid() {
if ((userAgent.indexOf(deviceAndroid) != -1) ||
detectGoogleTV())
if (!detectWindowsPhone10() &&
((userAgent.indexOf(deviceAndroid) != -1) ||
detectGoogleTV()))
return true;

return false;
Expand Down
13 changes: 6 additions & 7 deletions JavaScript/mdetect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* *******************************************
/* *******************************************
// Copyright 2010-2015, Anthony Hand
//
// BETA NOTICE
Expand Down Expand Up @@ -254,10 +254,11 @@ var MobileEsp = {
//**************************
// Detects if the current device is an iPhone.
DetectIphone : function() {

if (this.initCompleted || this.isIphone)
return this.isIphone;

if (this.uagent.search(this.deviceIphone) > -1)
if (!this.DetectWindowsPhone() && (this.uagent.search(this.deviceIphone) > -1))
{
//The iPad and iPod Touch say they're an iPhone! So let's disambiguate.
if (this.DetectIpad() || this.DetectIpod())
Expand Down Expand Up @@ -315,10 +316,11 @@ var MobileEsp = {
// Detects *any* Android OS-based device: phone, tablet, and multi-media player.
// Also detects Google TV.
DetectAndroid : function() {

if (this.initCompleted || this.isAndroid)
return this.isAndroid;

if ((this.uagent.search(this.deviceAndroid) > -1) || this.DetectGoogleTV())
if (!this.DetectWindowsPhone() && ((this.uagent.search(this.deviceAndroid) > -1) || this.DetectGoogleTV()))
return true;

return false;
Expand Down Expand Up @@ -1154,7 +1156,4 @@ var MobileEsp = {
};

//Initialize the MobileEsp object
MobileEsp.InitDeviceScan();



MobileEsp.InitDeviceScan();
6 changes: 4 additions & 2 deletions PHP/mdetect.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ function Get_HttpAccept()
// Detects if the current device is an iPhone.
function DetectIphone()
{
if ($this->initCompleted == $this->true ||
if (!($this->DetectWindowsPhone()) &&
$this->initCompleted == $this->true ||
$this->isIphone == $this->true)
return $this->isIphone;

Expand Down Expand Up @@ -347,7 +348,8 @@ function DetectIos()
// Also detects Google TV.
function DetectAndroid()
{
if ($this->initCompleted == $this->true ||
if (!($this->DetectWindowsPhone()) &&
$this->initCompleted == $this->true ||
$this->isAndroid == $this->true)
return $this->isAndroid;

Expand Down
6 changes: 4 additions & 2 deletions Python/mdetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ def detectIphone(self):
Detects if the current device is an iPhone.
"""
# The iPad and iPod touch say they're an iPhone! So let's disambiguate.
return UAgentInfo.deviceIphone in self.__userAgent \
return not self.detectWindowsPhone() \
and UAgentInfo.deviceIphone in self.__userAgent \
and not self.detectIpad() \
and not self.detectIpod()

Expand Down Expand Up @@ -315,7 +316,8 @@ def detectAndroid(self):
Detects *any* Android OS-based device: phone, tablet, and multi-media player.
Also detects Google TV.
"""
if UAgentInfo.deviceAndroid in self.__userAgent \
if not self.detectWindowsPhone() \
and UAgentInfo.deviceAndroid in self.__userAgent \
or self.detectGoogleTV():
return True

Expand Down