阻止移动网络代理注入 JavaScript [英] Stop mobile network proxy from injecting JavaScript

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

问题描述

我使用的是基于移动网络的互联网连接,当他们向最终用户展示网站时,正在重写源代码.

I am using a mobile network based internet connection and the source code is being rewritten when they present the site to the end user.

在本地主机中,我的网站看起来不错,但是当我通过移动网络连接从远程服务器浏览该网站时,该网站看起来很糟糕.

In the localhost my website looks fine, but when I browse the site from the remote server via the mobile network connection the site looks bad.

检查源代码我发现一段 JavaScript 代码被注入到我的页面,这会禁用一些使网站看起来很糟糕的 CSS.

Checking the source code I found a piece of JavaScript code is being injected to my pages which is disabling the some CSS that makes site look bad.

我不想要图像压缩或带宽压缩,而不是我精心设计的 CSS.

I don't want image compression or bandwidth compression instead of my well-designed CSS.

如何防止或阻止移动网络提供商(本例中为 Vodafone)代理将其 JavaScript 注入我的源代码?

How can I prevent or stop the mobile network provider (Vodafone in this case) from proxy injecting their JavaScript into my source code?

推荐答案

您可以在您的页面上使用它.它仍然压缩并将所有内容内联,但不会破坏像 jquery 这样的脚本,因为它会基于 W3C 标准转义所有内容

You can use this on your pages. It still compresses and put everything inline but it wont break scripts like jquery because it will escape everything based on W3C Standards

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

在您的服务器上您可以设置缓存控制

On your server you can set the cahce control

"Cache-Control: no-transform"

这将停止所有修改并按原样显示您的网站!

This will stop ALL modifications and present your site as it is!

此处参考文档

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5

http://stuartroebuck.blogspot.com/2010/08/official-way-to-bypassing-data.html

网站在 iPad/iPhone 上在 3G 下但在 WiFi 下没有显示 JavaScript 错误

这篇关于阻止移动网络代理注入 JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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