AllMangasReader-dev / AMR

AllMangasReader developer branch
www.allmangasreader.com
Other
98 stars 54 forks source link

Different context of the img object in different sites #43

Closed braiam closed 9 years ago

braiam commented 11 years ago

Extension just stop trying to get the images for some sites. The bug is permanent once it appears and there is no way to get rid of it. Here the console log:

Error in event handler for 'undefined': NotFoundError: DOM Exception 8 Error: An attempt was made to reference a Node in a context where it does not exist.
    at Function.b.extend.buildFragment (chrome-extension://nhjloagockgobfpopemejpgjjechcpfd/js/jquery.js:5:296)
    at b.fn.extend.domManip (chrome-extension://nhjloagockgobfpopemejpgjjechcpfd/js/jquery.js:4:28300)
    at b.fn.extend.append (chrome-extension://nhjloagockgobfpopemejpgjjechcpfd/js/jquery.js:4:26162)
    at b.fn.(anonymous function) [as appendTo] (chrome-extension://nhjloagockgobfpopemejpgjjechcpfd/js/jquery.js:4:30403)
    at writeImages (chrome-extension://nhjloagockgobfpopemejpgjjechcpfd/js/back.js:1092:12)
    at chrome-extension://nhjloagockgobfpopemejpgjjechcpfd/js/back.js:97:17
    at <error: illegal access>
    at Event.dispatchToListener (event_bindings:356:21)
    at Event.dispatch_ (event_bindings:342:27)
    at Event.dispatch (event_bindings:362:17) event_bindings:346
Event.dispatch_ event_bindings:346
Event.dispatch event_bindings:362
chromeHidden.Port.dispatchOnMessage miscellaneous_bindings:253

Thanks to the guys at stackoverflow, I've noticed that console.log($(img)) when working and when not have different context:

Working:

[img.imageAMR, context: img.imageAMR, jquery: "1.9.1", constructor: function, init: function, selector: ""…]
0: img.imageAMR
context: img.imageAMR
length: 1
__proto__: Object[0]

Not working:

[HTMLImageElement, context: HTMLImageElement, jquery: "1.9.1", constructor: function, init: function, selector: ""…]
0: HTMLImageElement
context: HTMLImageElement
length: 1
__proto__: Object[0]

My guess, Chrome is being vengeful that we are still popular even trough we don't use the store anymore so they are screwing with us... or just some race condition.

plduhoux commented 11 years ago

Waow... that's weird... does anyone has ever seen this too ????

braiam commented 11 years ago

Asked in stackoverflow http://stackoverflow.com/q/15469763/792066

braiam commented 11 years ago

@AllMangasReader-dev Anyone is seeing the same issue in canary? The stable version works fine, unsurprisingly.

plduhoux commented 11 years ago

Nope... never seen it...

gendouhydeist commented 11 years ago

I'm also getting this error on Batoto and Japanzai, other sites like Mangastream and RedHawk works fine.

braiam commented 11 years ago

@gendouhydeist sorry but, this error is in all sites that I'm getting it.

braiam commented 11 years ago

Ok, now the thing just got weirder... Here in Japanzai it just "works" image But Batoto does not... image Some nasty race condition? Also notice that the console.log is different in both cases... will check the implementations.

plduhoux commented 11 years ago

Ahhhhh I got it.... it works fine on MangaFox and maybe few others... but Batoto, manga access, manga panda and maybe others are not working... o_O

braiam commented 11 years ago

Modified the original issue with updated information, and going to sleep as you can see on my screenshots :sleepy:

plduhoux commented 11 years ago

@braiam : Please confirm that this fix the issue for you too... but sleep a bit before that :). I just woke up :)

braiam commented 11 years ago

Indeed it fixes it! When I wake up I will respond my question in SO and open an bug on chrome... or you just do. BTW this is the last bug for AMR 1.5.0 so making the release branch and pushing. image

plduhoux commented 11 years ago

Hum... we should finish the release note and change version number... no ??

gendouhydeist commented 11 years ago

Awesome everything works great! Thanks guys!

braiam commented 11 years ago

Seems that all DOM's methods have problems. Here the bug in chrome/ium https://code.google.com/p/chromium/issues/detail?id=245296

braiam commented 11 years ago

The chromium team has a fix for this bug at http://code.google.com/p/chromium/issues/detail?id=245296. We should revert commits 456ee8e5b69b4b51433a0d972d357dc3f827f384 and 8f06219 when they merge the changes.

braiam commented 11 years ago

Fix was rejected for previous builds of chrome/ium, so we should bump Minimun-version in the manifest.json.