imgbi / img.bi

img.bi main website
GNU General Public License v3.0
194 stars 29 forks source link

Conflicts when there is other stuff in local storage #65

Open rugk opened 8 years ago

rugk commented 8 years ago

E.g. when you create debug = "undefined" in your local storage img.bi tries to read and parse it when visiting the "my" page, which of course results in an parse error.

Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data
@https://domain.example/scripts/main.js:8:28334
r@https://domain.example/scripts/main.js:1:4487
@https://domain.example/scripts/main.js:8:28254
a/<@https://domain.example/scripts/main.js:3:2656
Yt/this.$get</h.prototype.$eval@https://domain.example/scripts/main.js:3:9989
Yt/this.$get</h.prototype.$digest@https://domain.example/scripts/main.js:3:8557
Yt/this.$get</h.prototype.$apply@https://domain.example/scripts/main.js:3:10285
c@https://domain.example/scripts/main.js:2:17715
b@https://domain.example/scripts/main.js:2:19904
ht/</S.onload@https://domain.example/scripts/main.js:2:20450
 main.js:2:28031
o/<() main.js:2
nt/this.$get</<() main.js:2
a/<() main.js:3
Yt/this.$get</h.prototype.$eval() main.js:3
Yt/this.$get</h.prototype.$digest() main.js:3
Yt/this.$get</h.prototype.$apply() main.js:3
c()

So it might be worth to prefix the values for saved pictures img.bi creates, so that it does not read and clash with other things in the local storage.