Last active
January 20, 2024 22:11
-
-
Save PixelRobot/456b807549c729db0976 to your computer and use it in GitHub Desktop.
A bookmarklet for taking notes in the browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:( | |
function(doc){ | |
doc.write('<body contenteditable style="font:12px monospace; max-width:50em; margin:0; padding:10px;">'); | |
var key = 'PixelRobot'; | |
var body = doc.querySelector('body'); | |
if (localStorage[key] != undefined) | |
body.innerHTML = localStorage[key]; | |
else | |
body.innerHTML = 'Type your notes here'; | |
body.oninput = function(){ | |
localStorage[key] = body.innerHTML; | |
} | |
} | |
)(document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I really liked the idea!
Collaborating with some modifications: