限制网站在Firefox中打开 [英] Restricting the site to open in firefox

查看:107
本文介绍了限制网站在Firefox中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的网站仅在IE中打开.它可以自行选择浏览器吗??

I want my site to open in IE only.Can it choose the browser on its own???

推荐答案

是:请看一下 HttpRequest.Browser属性 [ ^ ]

但是请注意,如果这样做,将会严重限制您的市场/受众.如果您查看浏览器统计信息 [
Yes: Hvae a look at the HttpRequest.Browser property[^]

Be aware though, that you will severely limit your market / audience if you do that. If you look at the browser statistics[^] you will see that 60% of users will not be able to use your site...


简短答案:否.
您的代码可以检查HTTP请求中的User-Agent标头,并根据内容做出一些决定,但这绝不是万无一失的. HTTP请求者(浏览器,Spider,wGet等)可以构建包含所需内容的User-Agent标头,作为HTTP响应者,您的站点必须信任它. Google或检查
Wikipedia [ ^ ]用于用户代理欺骗"

彼得
Short answer: NO.
Your code can examine the User-Agent header in the HTTP request and make some decisions based on the content, but that is not foolproof by any means. The HTTP requester (browser, spider, wGet, etc, etc) can build a User-Agent header containing whatever it wants, ans as an HTTP responder, your site has to take it on trust. Google or check Wikipedia[^] for "User Agent Spoofing"

Peter


这篇关于限制网站在Firefox中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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