Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#11183 closed bug (wontfix)

jQuery is not working in Chrome 18 (dev) extensions

Reported by: ewolf Owned by:
Priority: low Milestone: None
Component: core Version: 1.7.1
Keywords: Cc: timmywil
Blocked by: Blocking:

Description

Browser: Google Chrome 18.0.1003.1 dev Operating System: Mac OS X 10.7.2

When being loaded as a content script as part of a browser extension, jQuery triggers an error in Chrome 18, the current developer version of Chrome, and prevents code depending on jQuery from being executed.

The issue has been reported before by somebody else in the Chrome bug tracker: http://code.google.com/p/minimalist/issues/detail?id=171

To reproduce the issue, you can download this extension I created to demonstrate the problem: http://cl.ly/DPhc

The exact error varies across different versions, but leads to a failure of code dependent on jQuery in most cases (except 1.5).

1.7.1: Uncaught TypeError: Cannot read property 'compareDocumentPosition' of null at line 4807'

1.7: Uncaught TypeError: Cannot read property 'firstChild' of null at line 1520

1.6.4: Uncaught TypeError: Cannot read property 'firstChild' of null at line 1320

1.6.3: Uncaught TypeError: Cannot read property 'firstChild' of null at line 1320

1.6.2: Uncaught TypeError: Cannot read property 'firstChild' of null at line 1310

1.6.1: Uncaught TypeError: Cannot read property 'firstChild' of null at line 1288

1.6: Uncaught TypeError: Cannot call method 'appendChild' of null at line 1287 NOT WORKING

1.5: Uncaught TypeError: Cannot read property 'compareDocumentPosition' of null at line 4148 (Simple code depending on jQuery can, however, still be executed with v1.5)

I am aware that this version of Chrome is a developer version that may contain bugs and does not have to necessarily be supported by jQuery. However, I would like to ask you to keep an eye on this in order to ensure full functionality of jQuery once Chrome 18 becomes beta or stable.

Change History (4)

comment:1 Changed 7 years ago by ajpiano

This may be related to #9449, as other offset-related methods seem to just fall right down in Chrome extensions as well. The isolated environment's 'window' object seems to have some significant differences from a "normal" window object.

comment:2 Changed 7 years ago by Rick Waldron

Cc: timmywil added

4807 compareDocumentPosition is actually in Sizzle

comment:3 Changed 7 years ago by timmywil

Component: unfiledcore
Priority: undecidedlow

Sounds like a browser bug. compareDocumentPosition is only used if it is present on the current document element. My guess is that document.documentElement is null in the environment somehow.

comment:4 Changed 7 years ago by sindresorhus

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.