Reputation: 49
I'm making a page that has multiple iFrames that show reports. The reports generate a ton of console output which contributes to the page taking up more memory.
I tried to do the workaround with
console.log = function() {}
As well as a couple others I found, but none of them work. Majority of the errors are "Failed to load resource" and failed GET requests. I'm wondering if there's a way to maybe filter just those out.
Again the issue is that all the iFrames are cross domain and I have 0 access to the source.
Upvotes: 1
Views: 1028
Reputation: 110
Try it like this
iframeWindow.console.log = function() { /* nop */ };
This works on Mozilla,Chrome
Upvotes: 0
Reputation:
Failed requests and other browser errors are logged by the browser internally, not through console.log
. There is no way for your page to filter them out. If you don't want to see them, don't look at the console.
Upvotes: 1