Is there a way to clear up GM_log messages from error console from userscripts on a certain event?
I don’t want to clear up manually. On trigger of certain event, want to clear up the old log from the error console and show up the new log.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot clear the error console. If you could, evil websites could clear it too and erase the record of their misdeeds.
You should no longer use
GM_Log()anyway. Use Firebug and the excellent console logging functions it provides.Then you can use
console.clear().Note, to avoid conflicts with Firefox’s newish
consolefunctions, and to ensure that the output appears in Firebug’s console, you may need to prefix the calls withunsafeWindow.So your script could do something like this:
Which would look like this in the Firebug console:

— with all the preceding cruft erased. (Anything the webpage does after the
clear()call will still appear though.)