2

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?

Asix3
  • 21
  • 1
  • do you have any extensions for development? say, a javascript beutifier or something? turning them off may do it – JSelser May 27 '15 at 17:59
  • Not that I know of -- wouldn't running firefox in safe mode fix the problem if an extension was the issue? The problem still exists in safe mode. – Asix3 May 27 '15 at 18:51
  • I have the same problem, and I’ve tried with a fresh install (version 40) with an entirely new profile. – lydell Aug 30 '15 at 12:07
  • Do you by any chance use the Firefox variant called Abrowser? I do, and if you do as well it’s most likely a problem with Abrowser, not Firefox. Need to know which issue tracker to report to :) – lydell Aug 30 '15 at 13:06

1 Answers1

0

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.

lydell
  • 1,147
  • 12
  • 16