如何更改 Firefox Scratchpad 中的默认文本?

How to change default text in Firefox Scratchpad?

新打开的 Firefox Scratchpad 包含以下文本:

/*
 * 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)
 */

我想把它改成更有用的东西,比如

(function(){

})();

怎么做?

假设我们在 Windows 7 上安装了 Firefox v38 运行,安装在文件夹 {path_to_ff}.

文件 {path_to_ff}/browser/omni.ja 包含许多定义 FF 内部结构的有用内容。此文件是一个 .jar 文件,因此您可以简单地 open/extract 使用您最喜欢的文件归档程序。

暂存器的介绍文本只是捆绑包中的文本资源,位于 omni.ja/chrome/{lang}/locale/browser/devtools/scratchpad.properties{lang} 是您的 FF 区域设置的语言代码,即 'fr'我的情况)。此文本存储在 scratchpadIntro1 键下:

# 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 */

当您更改文本时,请确保将其保留在一行中并更新 omni.ja 文件。 FF也应该重新启动以使更改生效。