Changeset 66819 in webkit


Ignore:
Timestamp:
Sep 6, 2010 2:56:56 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-09-06 Robin Qiu <robin.qiu@torchmobile.com.cn>

Reviewed by Adam Barth.

https://bugs.webkit.org/show_bug.cgi?id=43982
This js file seems to be a popular script for detecting mobile WebKit but
it has a flaw that makes it fail on Android and BlackBerry.

The issue is that it looks for "Mobile/" but Android and BlackBerry
use "Mobile" with no numbering after it.
Changed RegExp pattern " Mobile/" to " Mobile
b".

  • misc/WebKitDetect.js: (WebKitDetect.isMobile):
Location:
trunk/WebKitSite
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitSite/ChangeLog

    r66233 r66819  
     12010-09-06  Robin Qiu  <robin.qiu@torchmobile.com.cn>
     2
     3        Reviewed by Adam Barth.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=43982
     6        This js file seems to be a popular script for detecting mobile WebKit but
     7        it has a flaw that makes it fail on Android and BlackBerry. 
     8
     9        The issue is that it looks for "Mobile/" but Android and BlackBerry
     10        use "Mobile" with no numbering after it.
     11        Changed RegExp pattern " Mobile/" to " Mobile\\b".
     12
     13        * misc/WebKitDetect.js:
     14        (WebKitDetect.isMobile):
     15
    1162010-08-27  Darin Adler  <darin@apple.com>
    217
  • trunk/WebKitSite/misc/WebKitDetect.js

    r25385 r66819  
    102102WebKitDetect.isMobile = function isMobile()
    103103{
    104     return WebKitDetect.isWebKit() && RegExp(" Mobile/").test(navigator.userAgent);
     104    return WebKitDetect.isWebKit() && RegExp(" Mobile\\b").test(navigator.userAgent);
    105105}
    106106
Note: See TracChangeset for help on using the changeset viewer.