Skip to content

Instantly share code, notes, and snippets.

@DaCuteRaccoon
Created October 25, 2022 21:36
Show Gist options
  • Save DaCuteRaccoon/2b7214100f785c78c57293adc6c7e133 to your computer and use it in GitHub Desktop.
Save DaCuteRaccoon/2b7214100f785c78c57293adc6c7e133 to your computer and use it in GitHub Desktop.
Toggle between editing and viewing a website
if (document.body.contentEditable == 'inherit' && document.designMode == 'off') {
document.body.contentEditable = true;
document.designMode = 'on';
void 0;
} else {
document.body.contentEditable = 'inherit';
document.designMode='off';
void 0;
}
@DaCuteRaccoon
Copy link
Author

javascript:if(document.body.contentEditable=='inherit'&&document.designMode=='off'){document.body.contentEditable=true;document.designMode='on';void 0;}else{document.body.contentEditable='inherit';document.designMode='off';void 0;};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment