Skip to content

Instantly share code, notes, and snippets.

@aseemk
Last active November 5, 2021 06:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aseemk/059f8b9a08e4590148b6484bb2781c4d to your computer and use it in GitHub Desktop.
Save aseemk/059f8b9a08e4590148b6484bb2781c4d to your computer and use it in GitHub Desktop.
Bookmarklet template!

TODO: Add description of your bookmarklet here.

To add this bookmarklet to your browser, instructions for Chrome:

  1. Right-click your Bookmarks Bar.
  2. Click "Add Page..."
  3. For "Name", type "TODO: Title here".
  4. For "URL", copy-paste the below:
javascript:!function(){alert("It worked!")}();

Developer instructions:

  1. Write your raw source code in the 2-source.js file below.
  2. After testing, plug the source into JSCompress. This is important in particular to strip inline comments (which at least Chrome doesn't support in bookmarklets, because newlines are stripped).
  3. Paste the result into the code block above, after javascript:.

Enjoy!

/**
* MIT license. (c) YOUR NAME.
*/
(function () {
// TODO:
alert('It worked!');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment