Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed crash on Chrome 27 #438

Closed
wants to merge 1 commit into from
Closed

Conversation

soyangel
Copy link
Contributor

Fixed Colorbox crash on Chrome 27 when clicking image:

Error message: "Uncaught Error: NotFoundError: DOM Exception 8 "

@jackmoore
Copy link
Owner

Sorry, but I wasn't able to reproduce this issue. Works fine for me in Chrome 27 on Mac. Do you have any additional information?

@soyangel
Copy link
Contributor Author

Using Chrome 27 Ubuntu 13.04 (64 bits).

Was working fine until today when I update to Chrome 27.

I have seen another report of this here:

http://drupal.org/node/2001346

Full error stack:

Uncaught Error: NotFoundError: DOM Exception 8 jquery-1.9.0.min.js:3

st.extend.buildFragment jquery-1.9.0.min.js:3
st.fn.extend.domManip jquery-1.9.0.min.js:3
st.fn.extend.append jquery-1.9.0.min.js:3
publicMethod.prep jquery.colorbox.js:685
photo.src jquery.colorbox.js:944

Let me know if you need more info.

Thanks!

@jackmoore
Copy link
Owner

Thanks, I appreciate the details and the pull request. I just hate to merge something that I don't understand when I can't reproduce the issue. I am also using Chrome 27, jQuery 1.9, and Mac 10.8.3 like the other guy that filed an issue. The fix just looks like voodoo to me because I can't tell what the substantive difference is.

@WanderingZombie
Copy link

Just a thought... does the old (existing) code give you a jQuery object based on a javascript Image object and the new suggested code give you a jQuery object based on DOM img object?

@jackmoore
Copy link
Owner

jQuery probably uses document.createElement() rather than using Image(), but they should both produce a DOM img object.

@jackmoore jackmoore closed this in 54467a9 May 23, 2013
@jackmoore
Copy link
Owner

This commit should be the same as the proposed pull request, minus creating a new variable. There may be some minute difference between new Image() and document.createElement('img'), but this is the first time I've run into an issue with it.

@soyangel
Copy link
Contributor Author

Great, I will try it tomorrow!

Sincerelly I didn't know exactly why it stopped working and why it worked again with the hack in my patch. I saw it in this Stackoverflow post:

http://stackoverflow.com/questions/15469763/an-attempt-was-made-to-reference-a-node-in-a-context-where-it-does-not-exist

@drhanlau
Copy link

drhanlau commented Jun 6, 2013

Hi Jack, thanks you for the great work but I have the same problem. Chrome 27, Windows 8.

@jackmoore
Copy link
Owner

Quick question Hans, does it fix the problem if you set the preloading property to false?

@drhanlau
Copy link

drhanlau commented Jun 6, 2013

I haven't gone that far Jack, I am just trying to get the example on your website to work.

@jackmoore
Copy link
Owner

I haven't been able to reproduce this issue. Tested Chrome 27 on Mac and Chrome 27 on Win 7. :/

@jackmoore
Copy link
Owner

Ok, it looks like this is a widespread problem. It's a bug in Chrome that has apparently been fixed in Canary:
https://code.google.com/p/chromium/issues/detail?id=243033

Other people are having the same issue and working around it the same way (replacing new Image() with document.createElement('img')). That's why I asked to try to turn off preloading, because it was still using new Image().

I'll change out the code in preloading since I'm pretty sure that's the problem, but regardless it should be temporary since it was a Chrome bug that's already been resolved.

@jackmoore
Copy link
Owner

The change has been committed.

@drhanlau
Copy link

drhanlau commented Jun 6, 2013

Thanks Jack, I will try it on my own time. I tried to show this to my boss on your website but just can't get it to work. Arghhh :'(

@jackmoore
Copy link
Owner

Oh, I didn't update my website. It's still using colorbox from a few versions back. I'll update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants