How to Use Firefox Browser's Scratchpad

Write and test JavaScript in real time


Guiwp / Wikimedia Commons / CC BY-SA 3.0

Firefox offers many handy tools for developers, including integrated web and error consoles as well as a code inspector. It also had Scratchpad, a tool that lets programmers toy with their JavaScript and execute it from right within a Firefox window. Scratchpad's simple interface was quite convenient for developers. Sadly it's no longer available, but that doesn't mean you can't still write and test multi-line JavaScript in Firefox. We show you how.

Scratchpad was removed with the launch of Firefox 72. We have a suitable alternative for testing JavaScript code below.

Using Firefox's Web Console Editor Mode

While Scratchpad is no longer available, Mozilla did introduce a Web Console Editor Mode with Firefox 71+. This is a suitable alternative for writing and testing multi-line JavaScript. Here's how to access it.

  1. Open the Firefox browser and open the menu.

  2. Select Web Developer > Web Console. The console appears at the bottom of the screen and shows the current web page's code.

    You can also access the web console via the keyboard shortcut CTRL+SHIFT+K.

    You can access Firefox's web console via the menu
  3. You can now enter the multi-line editing mode by clicking on the icon on the lower right-hand side of the console.

    You can also access multi-line editing via the keyboard shortcut Ctrl + B (Cmd + B on macOS).

    Click the icon in the lower right of the web console to access multi-line JavaScript editing
  4. Type your code into the editor. Use Enter to add new lines, or use CTRL+Enter to run them.

    You can type JavaScript code into the editor on the left and press CTRL+Enter to run it