1

新打开的 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(){

})();

如何?

4

1 回答 1

2

假设我们有 Firefox v38,在 Windows 7 上运行,安装在一个文件夹{path_to_ff}中。

该文件{path_to_ff}/browser/omni.ja包含许多定义 FF 内部的有用内容。该文件是一个.jar文件,因此您可以使用您喜欢的文件存档器简单地打开/提取它。

暂存器的介绍文本只是捆绑包中的文本资源,位于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 也应该重新启动以使更改生效。

于 2015-08-15T19:40:52.820 回答