2

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.

Tony T
  • 442
  • 3
  • 9
  • 1
    Interesting question. localStorage, sessionStorage, cookies all depend on having a domain name (which a data: uri does not have). – Thilo Jul 25 '14 at 01:42
  • 1
    You can disable the security on cookies to make them usable but that reaaaally reduces the portability of the uri. The intention is to throw it around to anyone and have it 'just work'. – Tony T Jul 25 '14 at 01:46

1 Answers1

0

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

Tony T
  • 442
  • 3
  • 9