Joined January 2013
·

Konrad Gretkiewicz

Cerritos, CA, USA
·
·

Posted to One line browser notepad over 1 year ago

Like @zaus said, Chrome throws "SECURITY_ERR: DOM Exception 18" for localStorage. So, simply save the code into some HTML file. Here's a version with saving every time Enter is pressed:

<!DOCTYPE html><head><meta charset="utf-8"><title>TextEditorLocal</title><script>window.onload=function(){f1()}; 
function f1(){a=window.localStorage['e'];if(a) document.body.innerHTML=a};function f2(t,e){if(e.keyCode==13){window.localStorage['e']=t.innerHTML}}</script>
<body contenteditable style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;word-wrap:break-word;background:black;color:green;" spellcheck="false" onkeypress="f2(this,event);"></body></html>
Achievements
1 Karma
0 Total ProTip Views