I want to write a simple HTML/js app that is supposed to be used locally. It uses localStorage
for storing data. But I cannot use it because of Crome's and Edge's security politics. In Chromium browser it works fine though.
So the question is how to let my script work in those browsers? I want to use it on different machines, so using a local web server is not a good solution for me. I am not allowed (and don't want) to install extra software on those machines.
UPD 0. Say we have a file app.html
with the following content:
<script>
window.onload = function () {
try {
localStorage;
}
catch (e) {
console.error("local storage is not available");
return;
}
console.log("this text is never shown in Chrome and Edge");
}
</script>
Then we open it with a browser, hit F12, choose js console and see results. I'd like not to see any error message.
UPD 1. Saing "locally" I meant that file:// protocol was used. Not a local web server.