Skip to content

Instantly share code, notes, and snippets.

@diegocard
Last active February 24, 2022 04:12
Show Gist options
  • Select an option

  • Save diegocard/53f8a80096aeac3e5d87 to your computer and use it in GitHub Desktop.

Select an option

Save diegocard/53f8a80096aeac3e5d87 to your computer and use it in GitHub Desktop.
JavaScript editor bookmarklet (open in a new tab)
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://ace.c9.io/build/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script src="http://ace.c9.io/build/src-noconflict/ext-language_tools.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.setOptions({enableBasicAutocompletion:true});e.getSession().setMode("ace/mode/javascript");addEventListener("keydown",function(evt){if(evt.ctrlKey && evt.keyCode==13) eval(e.getSession().getValue());});var link=document.createElement("link");link.type="image/x-icon";link.rel="shortcut icon";link.href="https://raw.githubusercontent.com/diegocard/diegocard.github.io/master/images/icon.png";document.getElementsByTagName("head")[0].appendChild(link);</script>
@diegocard
Copy link
Author

Open a new tab and copy the bookmarklet into the URL to use it.

  • Supports autocompletion (ctrl + space)
  • Run the code by pressing ctrl + enter

@diegocard
Copy link
Author

diegocard commented Feb 20, 2019

Another version:

data:text/html,<title>DoJS</title><style type="text/css">#e{font-size: 16px; position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/javascript");</script>

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