How can I disable Javascript error messages within browser consoles?

1.5k Views Asked by At

I am using the old Froogaloop2 Vimeo library and I know that this library is deprecated, but I have multiple embeds in a website and it was the only way I could get it to run.

There are console errors...

Uncaught TypeError: Cannot read property 'ready' of undefined at l (froogaloop2.min.js:1) 30froogaloop2.min.js:1 Uncaught TypeError: Cannot read property 'value' of undefined at l (froogaloop2.min.js:1)

I've tried to disable console.log but this unfortunately doesn't fall under that output.

console.log = function() {}

I simply want to avoid the outputs above.

2

There are 2 best solutions below

0
Mustafa Gürbüz On

If you need disable "console.log()" try this.

console.log("Hello World."); // Output : "Hello World."

console.log = function (param) {return;}

console.log("Hello World."); // Output : nothing.

0
J. Doe On

or disable all console logs ;)

 for (let func in console) {
      console[func] = function () {};
 }