开发者

enabling Firefox 5.0 javascript dump()

开发者 https://www.devze.com 2023-03-16 18:38 出处:网络
I\'m going through firefox extension writing bootcamp and somewhere along the way the video\'s author is speaking a开发者_StackOverflowbout switching browser.dom.window.dump.enabled in about:config to

I'm going through firefox extension writing bootcamp and somewhere along the way the video's author is speaking a开发者_StackOverflowbout switching browser.dom.window.dump.enabled in about:config to true. This option is no longer present in 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).

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?


You confused the error console with plain linux console - if you run firefox from terminal you should see the dumps right there.

in-depth explanation


This preference was never present by default - you always had to create it and set to true. Also, the output doesn't go to Error Console, it is rather visible in the terminal you start Firefox from. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消