TheAdnan / hadith-of-the-day

Firefox WebExtension that displays a different hadith on click
Mozilla Public License 2.0
8 stars 3 forks source link

Load the hadith from local.storage #2

Open TheAdnan opened 6 years ago

TheAdnan commented 6 years ago

Note: Include "storage" in manifest.json

TheAdnan commented 6 years ago

For reference, take a look at the storage handling methods in this script: github.com/TheAdnan/Session-resurrection/blob/master/sessions-pop-up/save-session.js

Abdur-rahmaanJ commented 6 years ago

currently it loads from a bukhari.json. where should i add a menu to let users load their own hadith.json? by rightclick and selecting menu or the issue wants something else?

TheAdnan commented 6 years ago

That won't be necessary, just make sure that the hadith load from the local.storage, and if the storage is empty, set it using the data from the bukhari.json file.

Abdur-rahmaanJ commented 6 years ago

you've already done it here https://github.com/TheAdnan/hadith-of-the-day/blob/master/extension/hadith/script.js

first you checked for null in local storage the if it is you set local storage to bukari.json

TheAdnan commented 6 years ago

Nope, it doesn't, I've tried but I didn't know how to set it at the time.

JafarAkhondali commented 5 years ago

Where is bukari.json ?!