Detect if website is being served thru a proxy ser

2019-04-12 15:40发布

问题:

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.