Detect if website is being served thru a proxy server like Opera Mini?

谁说我不能喝 提交于 2019-12-06 13:36:01

问题


Many feature phones use Opera Mini to serve webpages. Similarly Kindle Fire uses Amazon Silk. Is there a way in JavaScript to detect that a proxy is being used without UA detection?


回答1:


In Opera Mini's case: no. The JavaScript will in fact be executed by the "proxy server", not by the real client.




回答2:


My hypothesis is that such cloud based browsers cannot support a subset of events. For detecting such browsers I am using a javascript test that checks support for an event scroll.

var cloudBrowser = ('onscroll' in window?false:true);

I was able to find this working successfully on opera mini on my android (Samsung Galaxy Note 2) and also on Nokia C2-03 browser. (I was unable to check this for Amazon Silk as I do not have the device).

Do let me know if you are aware of any other cloud browsers for android that I can download and extend the testing.



来源:https://stackoverflow.com/questions/10222172/detect-if-website-is-being-served-thru-a-proxy-server-like-opera-mini

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!