简体   繁体   English

启用 Firefox 5.0 javascript 转储()

[英]enabling Firefox 5.0 javascript dump()

I'm going through firefox extension writing bootcamp and somewhere along the way the video's author is speaking about switching browser.dom.window.dump.enabled in about:config to true.我正在通过firefox 扩展编写训练营,以及视频作者正在谈论将about:config中的browser.dom.window.dump.enabled切换为 true 的某个地方。 This option is no longer present in firefox 5.0. firefox 5.0 中不再存在此选项。 From what I read during my google searches, in ff 4.0 you had to create this preference yourself, and it seems like in firefox 5.0 it doesn't work anymore - I can't seem to dump information to firefox error console any more (regardless of whether console2 is enabled or not).从我在谷歌搜索期间读到的内容来看,在 ff 4.0 中,您必须自己创建此首选项,而且在 firefox 5.0 中它似乎不再起作用 - 我似乎无法再将信息转储到 firefox 错误控制台(无论如何控制台2是否启用)。

Relevant code:相关代码:

Here's how I'm launching the browser:这是我启动浏览器的方式:

/usr/bin/iceweasel -profile /some/path -no-remote -jsconsole

And here's the code that only shows the alert, without writing anything to the error console:这是只显示警报的代码,没有向错误控制台写入任何内容:

onCommand: function(event) {
  toJavaScriptConsole("toJavaScriptConsole: hello world");
  dump("Hello world!\n");
  alert("Hello world!\n");
}

Any idea what I can do to have working dump() called from the ff extension I'm working on in firefox 5.0?知道我可以做些什么来让我在 firefox 5.0 中工作的 ff 扩展调用工作 dump() 吗?

You confused the error console with plain linux console - if you run firefox from terminal you should see the dumps right there.您将错误控制台与普通的 linux 控制台混淆了 - 如果您从终端运行 firefox ,您应该在那里看到转储。

in-depth explanation深入解释

This preference was never present by default - you always had to create it and set to true .默认情况下,此首选项从不存在 - 您始终必须创建它并将其设置为true Also, the output doesn't go to Error Console, it is rather visible in the terminal you start Firefox from.此外,output 不会 go 到错误控制台,它在您启动 Firefox 的终端中相当可见。 If you happen to test on Windows you should specify -console command line flag to open a terminal window for the output, on Linux simply starting Firefox from a terminal window will do. If you happen to test on Windows you should specify -console command line flag to open a terminal window for the output, on Linux simply starting Firefox from a terminal window will do.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM