FA Dev Tools

Bookmarklet

A bookmarklet runs JavaScript on the current page instead of navigating away. Encode multi-line JS into a one-line javascript: URL, then paste it into your browser bookmark Location. When debugging in the address bar, re-type javascript: at the front — the browser strips it on paste. Making Bookmarklets

Quick

0 chars

Add JavaScript above (or a bookmarklet URL below), then enter a name in Save as.

Saved scripts follow your account to any device.

0 chars
Instructions

Turns multi-line JavaScript into a one-line javascript: URL you can save as a browser bookmark and run on any page.

  1. Write or paste your JavaScript into the editor.
  2. Choose whether to wrap in an IIFE (recommended — it keeps your variables out of the page's scope) and how to URL-encode it.
  3. Press Generate and copy the javascript: URL.
  4. In your browser, create a bookmark and paste that URL into its Location field. Clicking the bookmark runs the script on whatever page you are on.

Tips

  • The Quick panels write the script for you: copy a piece of text, fire a fetch (handy for replaying a GraphQL call), or jump to a path on the current host.
  • Pasting into the address bar strips the leading javascript: — retype it by hand when testing there. In a bookmark it is kept.
  • Paste an existing bookmarklet URL into the bottom box to decode it back to readable source.
  • Save script stores it against your account rather than this browser, so your scripts follow you to any device. It needs a signed-in session; the encoder itself does not. Keep credentials out of saved scripts.
  • Export all downloads every saved script as one JSON file, and Import… restores it — on this account or another one. An import that would replace scripts you already have names them and asks first; cancelling still brings in the new ones.
  • Loading a saved script replaces the editor. If what is in there is not saved, you are asked before anything is lost — so Save script first if you want to keep both.
  • Comments are stripped when you Encode, unless you tick Keep comments. Either way a // comment cannot survive as-is: a bookmarklet is one line, so it would swallow the rest of the script — keeping them rewrites each one to /* … */, which has an explicit end.
  • Hit Example and click any highlighted Load … example — the sample is loaded and encoded in one step, so the bookmarklet URL is ready to copy.