3

Is there a way to block the google ads scripts from displaying any console messages?

(also in their third party script that may run)

My concern is that sometimes I see messages such as the one below loading large object and uncaught errors that may end up slowing down the client

enter image description here

enter image description here

Locally it really goes out of control:

enter image description here

Yovav
  • 2,557
  • 2
  • 32
  • 53
  • 2
    you are overthinking things – charlietfl Dec 18 '16 at 03:56
  • 1
    I don't think so, sometimes I'm getting uncaught errors in a loop (thousands per minute) that really slow down the browser – Yovav Dec 18 '16 at 18:48
  • 1
    AFAIK the effect of the console itself should be very small if you don't have it open. The code that's throwing thousands of errors is more likely to cause the slowdown itself. – Jeremy Dec 19 '16 at 19:36
  • 1
    Yes, very irritating. Especially how it clutters down the console while debugging. One of my ads has a slider with 20 slides and each slide is printed to the console log as an object – user3711421 Jul 27 '17 at 08:42
  • Actually I find a solution - it works 99% of the time https://stackoverflow.com/questions/44585680/how-to-block-google-ads-from-injecting-javascript – Yovav Jul 27 '17 at 17:31

1 Answers1

0

This is not perfect, but it seems to be very effective in my case (all pages are SSL) and also prevent SSL mixed mode messages caused by google ads third party plugin scripts...

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests; object-src 'none'">

Content-Security-Policy is critical to prevent mixed content errors (too many errors can show a "connection not secure" by the browser and memory leaks) https://blog.cloudflare.com/fixing-the-mixed-content-problem-with-automatic-https-rewrites and How does Content Security Policy work?

Yovav
  • 2,557
  • 2
  • 32
  • 53