This is a template to use to host your bookmarklets on GitHub pages or anywhere else that supports JS/HTML/CSS.
- Edit
bml-code.js
to be your bookmarklet code. You can use snippets to test it and have a full editor in the browser. - Rename the
{{BOOKMARKLET_NAME}}
instances inindex.html
- Add your bookmarklet explanations as
{{EXPLANATIONS}}
- Change the author name, URL and source code location in the footer
The HTML page features a few benefits:
- It creates a link of your bookmarklet code that people can click or bookmark. This link only shows up when everything went well
- It has a dark/light mode
- It converts your code in
bml-code.js
to a bookmarklet
The script in the index.html automatically converts your bml-code.js
code to a bookmarklet and sets the href
of the link to it. That way people can drag it into their favourites/bookmark toolbars. The script automatically:
- Removes newlines and indentation
- encodes the script to be URL conform
- puts an IIFE around your script
- adds
javascript:
in front of it
This means you can concentrate on writing your code without having to convert it. If you want to use this template locally, you need to run a local server, as fetch
won't work without it.