AllMangasReader-dev / AMR

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

getBackgroundPage().var sometimes returns undefined even trough the variable exist #61

Open braiam opened 11 years ago

braiam commented 11 years ago

As stated here 6d6732bd91815c132811d4e4f8072a9244c03a1d sometimes getBackgroundPage() returns undefined for some (all?) variables. Polo added || [] to fix it, but then we get an empty array and we might don't want this. I was thinking to add a loop on the background page along with other things to check that everything is working as expected. What everyone things?

plduhoux commented 11 years ago

Personnally, I think that we have undefined when mirrors are not loaded yet in background page... so getBackgroundPage().mirrors returns undefined. If you refresh the page one or two minutes later... it will be ok... I added || [] to prevent the page from not loading due to this error (the option page doesn't load labels in this case and looks very weird...) The best thing to do I think is to fix #21 by displaying a message everywhere (including option page) to let the user know he must have to wait a bit... @braiam : I think you affected yourself to #21. Do you have issues solving it ? We can create a branch for this feature if you want help...

braiam commented 11 years ago

Well, when it does happen, I could call mirrors in the background page and it returns the array (I should have taken a screenshot of that), but calling getBackgroundPage().mirrors anywhere on the extension returns undefined.

About issue #21, I was just observing all the "possible bottleneck", their reason and when we are "ready", not to detect and repair errors like this one (maybe with another function) that no matter how much time we wait it remains like that. I'll be pushing what I've done to gitHUB shortly so everyone can play with it and write the how-to in the wiki. BTW, I'll be using another icon (blue) for the popup, but there should not be problem with that :wink: .

braiam commented 11 years ago

Was reading this http://stackoverflow.com/a/15976321/792066 and might play with it so we can fix this issue instead using a workaround. BTW, sometimes I get that the websites list isn't marked, maybe because I use AMR in unexpected ways or is just my luck of always find the weirdest bugs.

bessx commented 11 years ago

Well I think we should pack some basic scripts with the extension at the begining (like version 0 scripts) that are only enough to keep track of any manga pages you visit, they dont deal with any of the formatting of the page. That way, if they visit a site, and it comes up as version 0 of the script, AMR knows that they havent updated their scripts, and it also keeps track of the manga they want to keep/watch.

braiam commented 11 years ago

Mmh... I don't see the relation :confused:

bessx commented 11 years ago

Well, parts of the extension don't work when the mirrors arent loaded. This is a workaround.