Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8348959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:50:45+00:00 2026-06-09T07:50:45+00:00

I am currently experiencing some issues with some touch detection in a plugin i

  • 0

I am currently experiencing some issues with some touch detection in a plugin i am using.

The plugin uses the following code

touch = ("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch;
eventType = (touch) ? "touchend" : "click";

To determine if it should use touchend or click event on some gallery navigation.

However unfortunately when accessing the page using a Blackberry 9300 running os 6.0 its falsely reported as being a touch enabled device and event doesn’t fire.

I’ve checked the detection method used and its the same as the one in Modernizr.

Does anyone have a solution to this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:50:47+00:00Added an answer on June 9, 2026 at 7:50 am

    According to Paul Irish, RIM said this about the issue:

    Unfortunately, we had a build system issue during BlackBerry 6.0 that caused builds to have WebKit touch support enabled, even for non-touch devices. It’s long been fixed, but some public builds do have this issue.

    See these (currently open) tickets at github/Modernizr for possible work-arounds and the lastest detection code and then try to alter your plugin as needed. You might need to specifically detect blackberry if the latest detection code below doesn’t work.

    • https://github.com/Modernizr/Modernizr/issues/372
    • https://github.com/Modernizr/Modernizr/issues/548

    Also check this touch test out, the browserscope tab indicates blackberry 9000 has been detected as false, so worth a shot to test it in your device too. http://modernizr.github.com/Modernizr/touch.html

    The latest modernizr source for the touch detect appears to have an addition of an @media detection in addition to your code you posted.

    /*
     * The Modernizr.touch test only indicates if the browser supports
     *    touch events, which does not necessarily reflect a touchscreen
     *    device, as evidenced by tablets running Windows 7 or, alas,
     *    the Palm Pre / WebOS (touch) phones.
     *
     * Additionally, Chrome (desktop) used to lie about its support on this,
     *    but that has since been rectified: crbug.com/36415
     *
     * We also test for Firefox 4 Multitouch Support.
     *
     * For more info, see: modernizr.github.com/Modernizr/touch.html
     */
    
    tests['touch'] = function() {
        var bool;
    
        if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
          bool = true;
        } else {
          injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
            bool = node.offsetTop === 9;
          });
        }
    
        return bool;
    };
    

    BlackBerry/PlayBook UA sniffing

    To specifically detect a BlackBerry devices using the user agent string and borrowing from solutions given from here and here I whipped up this little function which you can test and see working on jsbin at http://jsbin.com/aliwur/1/edit#javascript,live and it should parse out Blackberry 5.0/4.0/6.0 and Playbook from the user agent strings:

    function rim_useragent_parser(ua) {
    
        var info = false,
            model = null,
            model_number = null,
            os_version = null;
    
        if (ua.indexOf("BlackBerry") >= 0) {
            if (ua.indexOf("Version/") >= 0) {
                // BlackBerry 6 and 7
                model = ua.match(/BlackBerry\s[0-9]*/);
                if (model) {
                    model_number = model[0].match(/[0-9]+/);
                    pos = ua.indexOf("Version/") + 8;
                    os_version = ua.substring(pos, pos + 3);
                    info = {
                        'model' : model[0],
                        'model_number' : model_number[0],
                        'os_version' : os_version
                    };
                }
            }
            else {
                // BlackBerry Device Software 4.2 to 5.0
                model = ua.match(/^BlackBerry[0-9]*/);
                if (model) {
                    model_number = model[0].match(/[0-9]+/);
                    var SplitUA = ua.split("/");
                    os_version = SplitUA[1].substring(0, 3);
                    info = {
                        'model' : model[0],
                        'model_number' : model_number[0],
                        'os_version' : os_version
                    };
                }
            }
        }
        else if (ua.indexOf("PlayBook") >= 0) {
            // PlayBook
            model = ua.match(/RIM Tablet OS\s[0-9].[0-9].[0-9]/);
            if (model) {
                model_number = model[0].match(/[0-9].[0-9].[0-9]/);
                pos = ua.indexOf("Version/") + 8;
                os_version = ua.substring(pos, pos + 5);
                info = {
                    'model' : model[0],
                    'model_number' : model_number[0],
                    'os_version' : os_version
                };
            }
        }
    
        return info;
    
    }
    

    Of course that might be more then you need so to simplify it to only “Blackberry 9300 6.0” I guess you could also just do this:

    var ua = navigator.userAgent;
    if (ua.indexOf("BlackBerry") >= 0) {
        if (ua.indexOf("Version/") >= 0) {
            // BlackBerry 6 and 7
            var model = ua.match(/BlackBerry\s[0-9]*/);
            if (model) {
                var model_number = model[0].match(/[0-9]+/);
                if (model_number) model_number = model_number[0];
                pos = ua.indexOf("Version/") + 8;
                os_version = ua.substring(pos, pos + 3);
    
                if (os_version === '6.0' && model_number === '9300') {
                    // do what you need specifically for this
                }
            }
        }
    }
    

    For a better all purpose User Agent parsing see ua-parser

    https://github.com/tobie/ua-parser/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently experiencing some scrolling issues in a few of my views. The performance
I'm currently developing an Android game using the SDK GLES10 and I'm experiencing some
I'm currently experiencing some problems with my server. I have a pool which is
I'm currently working with jQuery 1.4.2 and jQuery UI 1.8.2. I'm experiencing some weird
I'm experiencing some issues with rewriting my blocking socket server to a non-blocking version.
I am currently looking into socket programming in python and I am experiencing some
I'm taking over another team's project and am experiencing some bizarre Eclipse issues. I'm
i'm currently experiencing a little problem. I'm using nhibernate with around 40 entities mapped
I'm experiencing some problems when using the default date:difference EXSLT template, provided at http://www.exslt.org/date/functions/difference/index.html
I'm having some issues with spanish characters displaying in an iOS app. The code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.