How can we clear the console in Chrome, Firefox and other browsers. I tried the following commands but no one works:
Chrome: clear()
clear()
Firefox: console.clear()
console.clear()
Any ideas?
It is different for each browser, so you can write a script to make it work for different browsers. or you can use this script
console.API; if (typeof console._commandLineAPI !== 'undefined') { console.API = console._commandLineAPI; //chrome } else if (typeof console._inspectorCommandLineAPI !== 'undefined') { console.API = console._inspectorCommandLineAPI; //Safari } else if (typeof console.clear !== 'undefined') { console.API = console; } console.API.clear();
for other browsers.
Note. Successfully tested (after editing, 08/2016) on Safari v9.1 for Mac OS and Chrome v52.0 for Mac OS
In Firefox, as of July 25, 2019, I first tried typing:
console.API.clear();
, console.API . , , -, , , , , :
console.API
console.clear();
, , . , , Firefox, , , , .
Source: https://habr.com/ru/post/1016513/More articles:How to resize / dev / shm in an Engine Flexible app - google-app-engineHow to increase size / dev / shm in docker container - dockerChrome user agent border radius overrides my style for choice - cssДовольно URL-адрес приложения MEAN-стека в nginx - url-rewritingHow can I see the source code of this website www.samy.pl? - javascriptДобавление Redux в существующее приложение React - reactjsКак Docker запускает ядро Linux под хостом macOS? - linuxWho is responsible for the general status of futures and promises - c ++Отсутствие продуктов во всех категориях и родительских категориях содержит ключевое слово - sqlDetect when Check Element is open - javascriptAll Articles