Now regarding document.cookie. It's specifially tied to web. It's not a browser technology, It's a web technology tied to HTTP protocol .
Cookies are fondamentally tied to remote servers. It's not your browser fault if is preventing you from using it on a file. it makes no sense to have cookies on files (imagine, this would mean having tied cookies for each file you browse on the web). No cookies are tied to a remote domain. It's their definition.
Now regarding localstorage. It's the same reason, localStorage by design are tied to a domain, not a file. Again, tying it to a file would make it useless for the web.
Now regarding doing cool things on browser without a server to share something between pages... i have your back.
Go here, this is called WebRTC. One cool thing with this. You don't need a web server. You can make two HTML files communicate with javascript.
Can WebRTC hold data even when the browser is closed?
That's part of the functionality I was after when trying to see if I could use cookies or localStorage.
Unfortunately, no. There is no storage you can use on a browser without attaching it to a domain and then to a server.
The only thing you can do, is having a local html file that interact with a third party service that will store it for you, like aws dynamoDB. But if you really want your page to not need internet access, i'm affraid you can't.
I just þought:
Could I do some Stop'N'Swap shit to store data? Basically open a new tab, sync local-storages, close first tab to simulate data transfer?
Or is ðat no good?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Let me rephrase this. I don't mean to be rude. No harm ahead.
First, Javascript is not tied to web browser technology. Like i said, Javascript can be used outside of browsers :
Now regarding
document.cookie
. It's specifially tied to web. It's not a browser technology, It's a web technology tied to HTTP protocol .Cookies are fondamentally tied to remote servers. It's not your browser fault if is preventing you from using it on a file. it makes no sense to have cookies on files (imagine, this would mean having tied cookies for each file you browse on the web). No cookies are tied to a remote domain. It's their definition.
Now regarding localstorage. It's the same reason, localStorage by design are tied to a domain, not a file. Again, tying it to a file would make it useless for the web.
Now regarding doing cool things on browser without a server to share something between pages... i have your back.
Go here, this is called WebRTC. One cool thing with this. You don't need a web server. You can make two HTML files communicate with javascript.
Now have fun.
I didn't think you intended to originally.
Can WebRTC hold data even when the browser is closed?
That's part of the functionality I was after when trying to see if I could use cookies or
localStorage
.Unfortunately, no. There is no storage you can use on a browser without attaching it to a domain and then to a server.
The only thing you can do, is having a local html file that interact with a third party service that will store it for you, like aws dynamoDB. But if you really want your page to not need internet access, i'm affraid you can't.
Thanks for your help.
But as a subrant, that's stupid.
There should be like
directoryStorage
, which is likelocalStorage
for the CWD of the HTML file.I just þought:
Could I do some Stop'N'Swap shit to store data? Basically open a new tab, sync local-storages, close first tab to simulate data transfer?
Or is ðat no good?