I came across this bug when I was developing a custom module that uses jquery. My jQuery(document).ready() never fired when opened from my Galaxy S2 Android default browser. It does from Firefox Beta on the same device. What I thought was my code's bug turned out to be a problem persisting in the whole site, and any fresh Drupal 7 installation like I tested.

To replicate the problem install a fresh copy of Drupal, open it using Android default browser, log in using user 1, test the shortcuts toolbar collapse arrow that should use jQuery to collapse the shortcuts. It will reload the page toggling the shortcuts bar.

My mobile browser user-agent header is:
Mozilla/5.0 (Linux; U; Android 2.3.3; en-us; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

My mobile browser perfectly displays jQuery from other sites including drupalgardens.com

Comments

shadysamir’s picture

I just tested using Android SDK 2.3.3 stock browser and it showed same behavior.

droplet’s picture

Version: 7.12 » 8.x-dev

Tested.

Buggy with Drupal.behaviors.attach, comment out it and works fine.

droplet’s picture

do more tests. It seems like android or jQuery bug.

eg.

http://jsfiddle.net/zTukR/9/ broken

http://jsfiddle.net/zTukR/8/ works

shadysamir’s picture

I tested droplet Jscript and the broken link is in fact broken on Android. The only diff I see between the two codes is the condition below in Drupal.toolbar.height behavior:

if ($('#toolbar').css('filter').match(/DXImageTransform\.Microsoft\.Shadow/)) {
    height -= $('#toolbar').get(0).filters.item("DXImageTransform.Microsoft.Shadow").strength;
}

Not sure how to link jQuery(document).ready to this finding

nod_’s picture

Should be fixed by now, please retest.

cweagans’s picture

nod_’s picture

Status: Active » Postponed (maintainer needs more info)

I'm pretty sure this is fixed, please confirm.

shadysamir’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

It is fixed but I couldnt test on original browser as I now have the new Ice Cream Sandwich stock browser. Will mark as closed and fixed anyway. Thanks.