3 ms·
There is a clever and simple code snippet to convert a tab into a notepad: data:text/html, <html contenteditable> Copy and paste into your browser address b
by dpflan 11y ago
There is a clever and simple code snippet to convert a tab into a notepad:
data:text/html, <html contenteditable>
Copy and paste into your browser address bar. Just bookmark that and you have a notepad with content that you can italicize, embolden, print, export, etc. I'm sure someone here can tweak this code to be even more feature-rich yet still compact. Or check the comments from the original web page.
This snippet was shared a while ago on HN: https://news.ycombinator.com/item?id=5135194 https://news.ycombinator.com/item?id=5135194
- thenomad 11y agoEither FF or Noscript disables that for me in Firefox. Works in Chrome though.
- dpflan 11y agoWhat version of FF? On FF 44 this code works with the following warning in the console: The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
- thenomad 11y agoFF44 for me too. Must be Noscript disabling it.
- two2two 11y agoThis works great in Safari for Mac and iOS. Thank you very much for filling a void in my work flow.
- aagat 11y agoI have something similar bookmarked though I can't remember the original author. I've been using it for a while as quick note taking app and it works wonderfully. (tested on chrome) javascript:(function(d){d.write('<body contenteditable style="font: 2rem/1.5 monospace;max-width:60rem;margin:0 auto;padding:4rem;">');var k = 'c'; var q = d.querySelector('body');q.innerHTML=localStorage[k];q.oninput=function(){localStorage[k]=q.innerHTML;}})(document);
- dksidana 11y agoYou are missing usecase that content has to be saved and retrieved on reopening