7 ms·
Ah shoot. If Chrome allowed localStorage to be accessible from file:/// then we could add save (CTRL+S) and automatic load using this: data:text/html,<html
by simonsarris 14y ago
Ah shoot. If Chrome allowed localStorage to be accessible from file:/// then we could add save (CTRL+S) and automatic load using this:
data:text/html,<html><script>window.onload=function(){var a=document.body;a.innerText=localStorage.mydoc;a.addEventListener("keydown",function(b){b.ctrlKey&&83==b.which&&(localStorage.mydoc=a.innerHTML,b.preventDefault())},!1)};</script><body contenteditable></body></html>
Firefox will save it to localStorage but clear the local storage afterwards. Weird.
Oh well.
At least we can still turn our (Chrome) browsers into desktop calculators by pressing CTRL+SHIFT+J!
(If you want the un-minified version of the code I wrote: http://jsfiddle.net/d5sGq/ http://jsfiddle.net/d5sGq/)
- mikegirouard 14y agoIf you can sacrifice the automatic load, simply hitting C-S will allow saving a hard file to disk. What's particularly nice about this is that when re-opened, they are still editable.
- csel 14y agoEven the simple File - Save Page As and save as a txt file saves a lot of time for me. I know it adds more clutter but beats opening a new app just to type few things.
- nitrogen 14y agoFirefox has Ctrl+Shift+K for its web console. It's not as polished as Chrome's, but at least allows running JavaScript in the current page.
- jfaucett 14y agoThat is so cool :). I just slapped together a (really) simple chrome ext for opening up a new tab in "contenteditable" mode. It saves the contents into localStorage, thats it for now :) Here it is if anyones interested https://github.com/jwaterfaucett/textpad https://github.com/jwaterfaucett/textpad
- dirkk0 14y agook - and how do I retrieve the saved contents?
- brunolazzaro 14y agoThey are loaded when you re-open the extension by the looks of it.
- wilfra 14y agoCan anybody please give me quick install instructions? There is no readme and I'm unfamiliar with how to add a Chrome extension based on a Github repo.
- mmahemoff 14y agoA pity Chrome basically gave up on file:///. A lot of cool things worked better with it (like TiddlyWiki).
- Flenser 14y agoYou could use some JavaScript to change window.location.href to a new data uri containing the content of the page that you could then bookmark. There's a limit to the length of URLs so it would be an interesting trade off of save size vs features.
- jancborchardt 14y agoThere's a simple pure frontend editor web app at http://litewrite.net http://litewrite.net - since it uses AppCache and localStorage you can also use it anywhere. Even sync with remotestorage. Source is open at http://github.com/litewrite/litewrite http://github.com/litewrite/litewrite
- minikomi 14y agoIf you don't mind loading jquery I made a version which saves to OpenKeyVal. Just set your secret key.. https://gist.github.com/4672169 https://gist.github.com/4672169
- Davertron 14y agoI forked yours and made it a JavaScript editor. You can use ctrl+j to execute what's in the buffer. https://gist.github.com/4673043 https://gist.github.com/4673043
- deleted 14y ago[deleted]
- jQueryIsAwesome 14y agodata:text/html,<html><script>window.onload=function(){var a=document.body;a.addEventListener("keydown", function(b){if(b.ctrlKey&&83===b.which){document.location = 'data:text/html,' + document.childNodes[0].outerHTML;b.preventDefault();}},!1);document.title= document.body.innerText.replace(/\n[\s\S]+$/," - ")+new Date().toString();};</script><body contenteditable></body></html> With this you can save using the URL! Just press Ctrl+S and use the browser history to access it later! And this means it also haves a pseudo-version-control-system included! For easy access the first line in the text becomes the title. In coderwall: https://coderwall.com/p/xh9u3w https://coderwall.com/p/xh9u3w