Bug Tracker

Modify

Ticket #11183 (closed bug: wontfix)

Opened 4 months ago

Last modified 2 months ago

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
Blocking: Blocked by:

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

comment:1 Changed 4 months 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 4 months ago by rwaldron

  • Cc timmywil added

4807 compareDocumentPosition is actually in Sizzle

comment:3 Changed 4 months ago by timmywil

  • Priority changed from undecided to low
  • Component changed from unfiled to core

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 3 months ago by sindresorhus

  • Status changed from new to closed
  • Resolution set to wontfix

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.