Skip to content

Instantly share code, notes, and snippets.

@oliveratgithub
Last active May 20, 2022 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oliveratgithub/006284221e65ff43c5799717df82c922 to your computer and use it in GitHub Desktop.
Save oliveratgithub/006284221e65ff43c5799717df82c922 to your computer and use it in GitHub Desktop.
πŸ“ On-page Website Content Editing: contentEditable browser bookmarklets to start/stop live-edit mode
javascript:document.body.contentEditable=true;
javascript:document.body.contentEditable=false;
data:text/html, <title>Take notes</title><body contenteditable style="font:2rem/1.5 Helvetica,monospace;max-width:60rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;"><script>const beforeUnloadListener=(event)=>{event.preventDefault();return event.returnValue="Have you saved your notes?"};const check=document.querySelector("body");check.addEventListener("input",(event)=>{addEventListener("beforeunload",beforeUnloadListener,{capture:true})});</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment