Description
During testing, I encountered two issues:
-
We are currently stringifying values only if they are instances of
window
ordocument
objects in@bigbinary/console-feed
. When I clone thewindow.parent
object as shown below and attempt to log it, the page crashes. While this scenario is not common, it illustrates that if a user were to copy and paste a large JavaScript object with circular dependencies, the current logic would fail.const windowParent = structuredClone(window.parent); console.log(windowParent);
-
Even when logging the stringified value of a
window
ordocument
object, each code change appends this large stringified value to the current log history, eventually causing the page to hang.
To address this, we either need to truncate the large stringified output (which would undermine the purpose of logging the entire object) or programmatically clear the console when detecting a large object in the current log history. Please investigate.