anka-213 / webcomic_reader

Webcomic Reader userscript at
https://openuserjs.org/scripts/anka-213/Webcomic_Reader
MIT License
120 stars 27 forks source link

Script crashes when strict mode is enabled in Tampermonkey #21

Open Couchy opened 8 years ago

Couchy commented 8 years ago

I don't know what changed, but Chrome is complaining about i being undefined here. Putting "var" before the i fixes it.

for (i = 0; i < res.snapshotLength; i++) arr.push(res.snapshotItem(i));

anka-213 commented 8 years ago

This should resolve the issue you mentioned, but there are probably more places with the same error, so I'll leave this issue open for now.

anka-213 commented 8 years ago

It should only complain about this kind of error when using strict mode though, which really shouldn't be enabled by default. :S

Couchy commented 8 years ago

Maybe I had enabled strict mode on Tampermonkey at some point. Anyway, jshint should help you find any more such errors.