1

Freshly opened Firefox Scratchpad contains following text:

/*
 * This is a JavaScript Scratchpad.
 *
 * Enter some JavaScript, then Right Click or choose from the Execute Menu:
 * 1. Run to evaluate the selected text (Ctrl+R),
 * 2. Inspect to bring up an Object Inspector on the result (Ctrl+I), or,
 * 3. Display to insert the result in a comment after the selection. (Ctrl+L)
 */

I want to change it to something more useful like

(function(){

})();

How?

czerny
  • 15,090
  • 14
  • 68
  • 96

1 Answers1

2

Supposing that we have Firefox v38, running on Windows 7, installed in a folder {path_to_ff}.

The file {path_to_ff}/browser/omni.ja contains a lot of useful stuff that define FF's internals. This file is a .jar file, so you can simply open/extract it using your favourite file archiver.

The intro text of the scratchpad is just a text resource from the bundle, located in omni.ja/chrome/{lang}/locale/browser/devtools/scratchpad.properties ({lang} is the language code of your FF locale, that was 'fr' in my case). This text is stored under the scratchpadIntro1 key:

# LOCALIZATION NOTE  (scratchpadIntro): This is a multi-line comment explaining
# how to use the Scratchpad. Note that this should be a valid JavaScript
# comment inside /* and */.
scratchpadIntro1=/* THE TEXT */

When you change the text, make sure to keep it on a single line and to update the omni.ja file. FF should also be restarted so that the changes take effect.

Antot
  • 36
  • 2