I am only concerned with mozilla's use of localStorage. When i store strings into localStorage
example:
on tab A, I insert:
localStorage["item"] = "hello";
on tab B, I request the same item using
localStorage.getItem("item");
I cannot access this item for some reason in Tab B if i set the the value in Tab A, however i have used the same code in Google Chrome before and it has shown Global characteristics.. why does it not work in Mozilla Firefox the same way?? Other stackoverflow threads have said to use globalStorage but that is a deprecated method according to documentation.
Thanks,
Aiden
localStorage demo The main features of localStorage are: Shared between all tabs and windows from the same origin. The data does not expire. It remains after the browser restart and even OS reboot.
You can use localStorage and its "storage" eventListener to transfer sessionStorage data from one tab to another. This code would need to exist on ALL tabs. It should execute before your other scripts.
To inspect your localStorage items you may type console. log(localStorage); in your javascript console (firebug for example or in new FF versions the shipped js console). Note that in recent versions Firefox has a built-in JavaScript console ("Web Console"), so one doesn't have to install Firebug to do this.
The DOM storage data is stored in the webappsstore. sqlite file in the profile folder. The profile folder is located in %APPDATA%\Mozilla\Firefox\Profiles\ , named something like 321edcba. default , and within it, there's the webappsstore.
What you may try is to set the localStorage
value as:
localStorage.setItem("item", "hello");
or
localStorage.item = "hello"
According to the specification all documents with the same origin share the same localStorage
data (regardless of the origin of the scripts that actually access localStorage
). They can read each other’s data. And they can overwrite each other’s data. But documents with different origins can never read or overwrite each other’s data (even if they’re both running a script from the same third-party server).
This means that you should be able to access the same localStorage
date from different tabs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With