If I call the following:
window.onbeforeunload = function() {
localStorage.clear();
};
Does this clear all local storage from a user machine or just what my site has set?
If I call the following:
window.onbeforeunload = function() {
localStorage.clear();
};
Does this clear all local storage from a user machine or just what my site has set?
Copyright © 2021 Jogjafile Inc.
From the spec for
clear
:In the above, "the object" in this context would be
localStorage
. What islocalStorage
? From the spec:So, it will just clear out the data for your origin, or domain.