Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IndexedDB User Permissions

Good day, all

I read on this page [Using IndexedDB]: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB

that browser will prompt user to give permission to create indexedDB, and the user may deny permission. See quote below:

The most likely problem is that the user decided not to give your web app permission to create a database. One of the main design goals of IndexedDB is to allow large amounts of data to be stored for offline use. (To learn more about how much storage you can have for each browser, see Storage limits.)

Obviously, browsers do not want to allow some advertising network or malicious website to pollute your computer, so browsers prompt the user the first time any given web app attempts to open an IndexedDB for storage. The user can choose to allow or deny access.

However, when testing on my localhost, neither Firefox nor Google Chrome asked me for permission. And the db was created successfully (it seems.)

So, is that article outdated? Or is it because I'm testing on localhost? or something else I'm missing?

Kind Regards

like image 506
BigName Avatar asked Jun 16 '15 15:06

BigName


People also ask

Can service workers access IndexedDB?

Note: IndexedDB can be used inside a service worker for data storage if you require it.

Is IndexedDB deprecated?

Why to use indexeddb? The W3C has announced that the Web SQL database is a deprecated local storage specification so web developer should not use this technology any more. indexeddb is an alternative for web SQL data base and more effective than older technologies.

Is IndexedDB shared across tabs?

Data stored in indexedDB is available to all tabs from within the same origin.

Is IndexedDB safer than localStorage?

If you want to store structured data on the client side, IndexedDB is the better choice, especially since localStorage isn't built to store sensitive information. But if you're storing a simple, small amount of key-value pair data, use localStorage.


1 Answers

The article is outdated. Depending on how you use IndexedDB, you might never get a prompt, but it depends on the browser and that could change in the future.

like image 147
dumbmatter Avatar answered Oct 18 '22 18:10

dumbmatter