#439 ✓fixed_in_master_branch
Olek Poplavsky

browser is not recognized properly on iPod Touch

Reported by Olek Poplavsky | November 11th, 2008 @ 06:47 PM | in 1.7

Prototype 1.6.0.3 that I am using now has very convenient feature that allows to test for the browser easily, like this:

if (!Prototype.Browser.MobileSafari) {}

Unfortunately it does not work properly in case of iPod Touch.

Here is a regexp used in the prototype's code:

navigator.userAgent.match(/Apple.Mobile.Safari/)

Here is a well-matched user agent string from iPhone: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5F136 Safari/525.20"

And here is not-matched user agent string from iPod Touch: "Mozilla/5.0 (iPod; U; CPU iPhone OS 2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Mobile/5F137"

Apparently, that regex should be either looser (with Safari part optional or missing), or it has to have extra regexp for catching iPods

Here is my quick fix for it:

MobileSafari: !!navigator.userAgent.match(/(Apple.*Mobile.*Safari)|(iPod.*AppleWebKit)|(iPhone.*AppleWebKit)/)

Comments and changes to this ticket

  • Juriy Zaytsev

    Juriy Zaytsev November 11th, 2008 @ 10:27 PM

    • Milestone set to 1.7
    • State changed from “new” to “bug”
    • Assigned user set to “Tobie Langel”
  • Tobie Langel

    Tobie Langel July 23rd, 2009 @ 04:42 AM

    • State changed from “bug” to “fixed_in_trunk”

    Thanks for your ticket.

    This should be fixed in the current master branch.

    You may build Prototype from source or wait until our next official release to benefit from it.

    I am closing this ticket as fixed_in_trunk. Thank you for your understanding.

  • Juriy Zaytsev

    Juriy Zaytsev July 23rd, 2009 @ 03:01 PM

    Tobie, I don't see it being fixed in a trunk.

    There's the very same /Apple.*Mobile.*Safari/ regex used, which, from what I can see, doesn't match iPod Touch's - 'Mozilla/5.0 (iPod; U; CPU iPhone OS 2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Mobile/5F137'

    Did I miss something?

  • Tobie Langel

    Tobie Langel July 23rd, 2009 @ 03:20 PM

    • Tag changed from 1.6.0.3, regexp, safari to needs_patch
    • State changed from “fixed_in_trunk” to “bug”
  • Tobie Langel

    Tobie Langel July 23rd, 2009 @ 03:21 PM

    • Tag changed from needs_patch to needs_patch, needs_tests
  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:26 AM

    • Tag changed from needs_patch, needs_tests to missing:tests, needs_patch

    [not-tagged:"needs_tests" tagged:"missing:tests" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:28 AM

    • Tag changed from missing:tests, needs_patch to missing:patch, missing:tests

    [not-tagged:"needs_patch" tagged:"missing:patch" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 03:36 AM

    • Tag changed from missing:patch, missing:tests to missing:patch, needs:tests

    [not-tagged:"missing:tests" tagged:"needs:tests" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 03:37 AM

    • Tag changed from missing:patch, needs:tests to needs:patch, needs:tests

    [not-tagged:"missing:patch" tagged:"needs:patch" bulk edit command]

  • T.J. Crowder

    T.J. Crowder November 16th, 2009 @ 04:50 PM

    • Assigned user cleared.

    [responsible:none bulk edit command]

  • Tisho Georgiev

    Tisho Georgiev March 1st, 2010 @ 09:50 PM

    • Tag changed from needs:patch, needs:tests to general, needs:patch, needs:tests
    • State changed from “bug” to “fixed_in_master_branch”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Pages