Web console stuck in quasi multiline mode -- bug?

244 views Asked by At

In the javascript web console, when I press <enter> the expression is evaluated, but the input does not clear -- instead a new line is inserted. The behavior is as though I'm pressing both <enter> and <shift>+<enter> for multi-line input.

I have tried starting firefox in safe-mode, upgrading, and "refreshing" firefox, all to no avail.

Is there some setting that sets multi-line input to the default behavior?

1

There are 1 answers

0
lydell On

I opened the Browser Console, cleared it, and put it next to my Firefox window. Then I typed an expression in the Web Console and hit enter. The instant I did so an error appeared in the Browser Console:

NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getIntPref] utils.js:555:0

That utils.js:555:0 is a link, taking you to that specific line of that file:

WebConsoleUtils._usageCount = Services.prefs.getIntPref("devtools.selfxss.count");

Apparently something’s seems to be up with this devtools.selfxss.count pref. I opened about:config to see if I could figure out what.

It turned out that this pref was missing! So I right-clicked, and chose “New > Integer”, entered devtools.selfxss.count as the pref name and 0 as the value.

It worked!

Then I researched what this pref is all about, and found https://bugzilla.mozilla.org/show_bug.cgi?id=994134#c89:

What does this option exactly do and does setting it to 100 completely disable this feature or making the message just less likely to appear?

The selfxss prevention works by counting the number of times you have used the console, and turning off paste protection when you cross a certain number, which is at the moment 5 (the number also stops incrementing after that). Alternatively, when you type "allow pasting" into the console when the prompt comes up, this pref is set to a number >5.

Setting it to any number more than 5 should fix this. 100 is just a high enough number that it will be resilient to all change.

The question now is why it was missing.

You could check if you’re having the same problem. Otherwise this at least might be helpful to track down your problem.