Is there a way to prevent websites to clearing console outputs?

https://lemmy.world/post/12446645

Is there a way to prevent websites to clearing console outputs? - Lemmy.World

I noticed a few websites i use do that when i open the console. I don’t know if it may cause performance issues but it looks like abusing something. It happens so fast that screen flickers. I don’t know why browsers allow this and wonder if there is a simple setting to disable that action in somewhere like about:config?

You may want to see if the persistent logs setting helps:

firefox-source-docs.mozilla.org/…/index.html

Settings — Firefox Source Docs documentation

You can run console.clear = () => {} in the console to override and disable the clear method.
I should add that as a greesemonky script