Search code examples
persistenceindexeddbdata-urisessionstorage

Is there any persistance available to a data uri?


I have a very basic data uri:

data:text/html,<body contenteditable style="font: 2rem/1.5 monospace; max-width: 60%; padding: 50px;" onload="document.body.focus();">

I would like to store the text written in the body when it changes and load it when the url is opened again.

I have attempted to use localStorage, sessionStorage and cookies but they are not available to the data uri. I haven't tried indexedDB because it seemed like far too much code for a PUT on change and a GET on load.


Solution

  • To answer my own question: no. This is by design so I went about it another way.