Michael Schwartz
Michael Schwartz

Reputation: 8425

Clear the console in Firefox

Is there a way to clear the console in Firefox?

In Chrome I can use...

console.clear()

(Not sure if it works for Safari or Opera though)

However I haven't been able to find a solution for Firefox. Is this type of API not yet available? Is there a workaround that doesn't require?

console.log("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");

Upvotes: 21

Views: 19378

Answers (7)

Mr.Cat
Mr.Cat

Reputation: 330

In more recent versions of Firefox, you can use console.clear() or built-in helper function clear() to clear console screen
and clearHistory() to entirely clear console's command history.

Check out more useful helper functions here

Upvotes: 0

Yusril Maulidan Raji
Yusril Maulidan Raji

Reputation: 1952

Perhaps you also want to clear via GUI of the browser.

  1. Open the inspect element / Ctrl+shift+i
  2. click console menu
  3. click the trash bin logo

Here is the screenshot:

enter image description here

Upvotes: 1

Shayan Ahmad
Shayan Ahmad

Reputation: 1165

Keep it simple. Better press Ctrl +Shift + L to clear the output in Firefox 44+. Whereas in previous versions press Ctrl + L.

In Mac, for Chrome (105.0.5195.102) and firefox(v103.0.2) Ctrl + L still works.

Upvotes: 18

Mwiza
Mwiza

Reputation: 9021

You can also use the following shortcut depending on your OS

Windows & Linux: Ctrl + Shift + L

Mac: Ctrl + L or Cmd + K for Firefox 67 or newer.

Upvotes: 1

Gerard Reches
Gerard Reches

Reputation: 3164

For anyone who comes to this question, console.clear() works in Firefox since version 48.0.

https://developer.mozilla.org/es/docs/Web/API/Console/clear

Upvotes: 5

aemonge
aemonge

Reputation: 2347

I've been looking for future implementations of firefox, but still they don't want to implement it. So basically you can't in webconsole, but you can in firebug.

See: https://developer.mozilla.org/en-US/docs/Web/API/console

Upvotes: 0

Todd Mark
Todd Mark

Reputation: 1885

In firefox you can just input clear(). It well be done.

Here's a link to the Developer's website for Javascript console commands: http://msdn.microsoft.com/en-us/library/windows/apps/hh696634.aspx

Upvotes: 21

Related Questions