user-agent

How to only allow one user agent on .htaccess?

£可爱£侵袭症+ 提交于 2019-12-03 14:47:36
I have been searching all over google and I really need to know how to only allow one user agent on .htaccess? All I found is how to do it on a Dedicated or private server. If the user-agent that you want to allow is: Lynx/2.8.8dev.12 Then you want these rules in the htaccess of the directory you want to restrict: RewriteEngine On RewriteCond %{HTTP_USER_AGENT} !Lynx/2\.8\.8dev\.12 [NC] RewriteRule ^ - [F,L] Every other user agent is forbidden with a 403. 来源: https://stackoverflow.com/questions/12142792/how-to-only-allow-one-user-agent-on-htaccess

Determine if operating system is Mac

天大地大妈咪最大 提交于 2019-12-03 13:29:46
问题 I have been doing a lot of Googling recently to try and find a simple, easy php script that will identify if the user is on a Mac or not. I want to use this to tell users if the keyboard shortcut I am telling them is "control" or "command". I don't need to know the browser or anything, just if the computer is a Mac. Here is an outline of what I'm asking is possible: if (operating_system == Mac) { echo "command"; } else { echo "control"; } 回答1: Create a page: identifier.php <?php $user_agent =

教你怎么屏蔽掉在移动端的宽带运营商的流量劫持,屏蔽无耻的广告

独自空忆成欢 提交于 2019-12-03 12:38:53
自从住进了租房以来,在使用租房的宽带的时候总有个问题,已经几个月了,今天我实在无法忍受这些广告了。决定要整治这些劫持广告。 一开始想到用socks5代理,需要自己租服务器,而且很麻烦,而且我研究了下劫持的页面,并且从网上也发现了一些其它用户遇到的问题。 这里有一个链接: http://bbs.kafan.cn/thread-1856999-1-1.html 上面这个链接详细描述了劫持的毒害。。。。 我主要遇到下面几个类型的劫持: 类型一: 输入百度的时候,后面会自动被加上尾巴然后进行跳转。尤其是输入www.hao123.com的时候,会跳转到 http://www.hao123.com/?tn=94150859_hao_pg 但是如果你使用https://www.baidu.com是没法跳转的,建议大家修改自己的chrome的浏览器的默认搜索引擎,加上https,还好百度开启了https, 这时候我深感推广https的重要性 。没有https的话,这些运营商想怎么改你的网页就怎么修改。 类型二:就是常见的右下角广告了,这个还好解决,装上adblock plus就可以一劳永逸了。 但是真正让我苦恼的是下面的类型三: 类型三:手机访问网页的时候,运营商会根据你的UA来植入广告,这个广告是和pc上浏览器的是不同的。 这个广告是类似于我们玩手游的时候,在网页 中间插入一个广告悬浮窗达到目的

How exactly hash fragment based security works?

独自空忆成欢 提交于 2019-12-03 09:56:13
问题 I'm learning OAuth 2.0 and couldn't get the way of securing access token in implicit grant flow . There are some theses in specification and some upvoted SO answers looking contradicting to each other. Could somebody clear it up? Quotes from SO answers and specification that are confusing me: (From spec) Redirection URI used to deliver the access token to the client. The access token may be exposed to the resource owner or other applications with access to the resource owner's user-agent.

Javascript user-agent (ajax) different to sent user-agent when requesting website

淺唱寂寞╮ 提交于 2019-12-03 06:44:16
问题 I noticed that Chrome (64.0.3282.137) on my phone (OnePlus 3, Android 8.0.0) sends slightly different user-agents when requesting a webpage in contrast to requesting via ajax. This user-agent is sent when requesting a webpage: Mozilla/5.0 (Linux; Android 8.0.0; ONEPLUS A3003 Build/OPR6.170623.013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36 This user-agent is sent making an ajax-call and is also returned when calling navigator.userAgent : Mozilla/5.0

Set useragent in WKWebview

自古美人都是妖i 提交于 2019-12-03 06:32:55
问题 How do I set a custom useragent string in a WKWebView? I'm trying to embed the version of my app so that my server-side can see what features are available. I found the following method: let userAgent = "MyApp/1.33.7" request.setValue(userAgent, forHTTPHeaderField: "User-Agent") NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue()) {(response, data, error) in let content = NSString(data: data, encoding: NSUTF8StringEncoding) self.web!.loadHTMLString(content!,

Strange User Agent With Google Chrome

烂漫一生 提交于 2019-12-03 06:32:50
问题 I was working with some javascript and found a strange user agent with my Google Chrome. I have Google Chrome 7.0.517.41 beta installed on my Ubuntu Laptop. Now AFAIK my user agent should be something close to Chrome/7.0.517.41 but it is showing me: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7 Why is this happening.. I have disabled all the installed extensions but it is still the same.. 回答1: The UA string tells the long and

Mimicking iPhone user agent in Chrome? [duplicate]

天涯浪子 提交于 2019-12-03 05:57:33
This question already has an answer here: User Agent Switcher for Chrome 6 answers I'm tinkering with a phpbb mod which adds a skin for mobile phones, and to work on it in my computer I want to mimic an iphone. In Firefox I manage to do this using the "user agent switcher" extension which comes with built-in "iphone" feature: https://addons.mozilla.org/en-us/firefox/addon/user-agent-switcher/ However, in Chrome (which I prefer) I cannot make this happen. I downloaded what seemed to be the relevant extension: https://chrome.google.com/extensions/detail/aafciojnlamllgpkpdkbamkfgbofhgcj?hl=he It

How to detect device name in Safari on iOS 13 while it doesn't show the correct user agent?

末鹿安然 提交于 2019-12-03 05:37:53
问题 After Apple's iOS 13 reales, I realized window.navigator.userAgent in Safari on iPad iOS 13 is same as on MacOS. Something like this: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15 As you see, it's a wrong user-agent for iPad and even there is no way to detect if the current device is an iDevice. After an initial research, I found a work around for it: Go to Settings -> Safari -> Request Desktop Website -> All websites. You

What causes the “user agent stylesheet” to use “border-box” instead of “content-box” for box-sizing?

限于喜欢 提交于 2019-12-03 04:27:12
I'm under the impression that the user agent stylesheet in browsers such as Safari, Chrome and Firefox is something that is internal to the browser and can't be directly modified (rather a style property needs to be overridden). I'm also under the impression due to various websites including Mozilla's that the default value of the box-sizing property for Webkit and Mozilla is "content-box." I tested this on a rather simple dummy page viewed in various browsers. My problem is that on two pages in our production application the default property is different, and we can't figure out why this is.