如何阻止Google广告注入JavaScript [英] How to block google ads from injecting JavaScript

查看:173
本文介绍了如何阻止Google广告注入JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些谷歌广告开始在整个屏幕上注入JavaScript和弹出广告

Some google ads start injecting JavaScript and poping ads all over the screen

如何阻止通过谷歌广告注入的这些随机脚本?

How can I block these random scripts that are injected through google ads?

推荐答案

这不完美,但在我的情况下似乎非常有效(所有页面都是SSL)并且还会阻止由SSL引起的SSL混合模式消息谷歌广告第三方插件脚本...

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对于防止混合内容错误至关重要
(错误太多可以显示浏览器连接不安全和内存泄漏)
https://blog.cloudflare.com/fixing-the-mixed-content-problem-with-automatic-https-rewrites
内容安全政策如何运作?

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?

这篇关于如何阻止Google广告注入JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆