user-agent

How do I display content from feedburner in WebView in Full HTML?

我们两清 提交于 2019-12-10 10:19:56
问题 I am using a WebView to display this feedburner. When I view this link in Google Chrome and in the device's browser it shows the title, snippet, links, and most importantly a podcast file and other hyperlinks. However, when I view this link in my WebView it only shows it in Plain Text HTML with no hyperlinks. All i see is a title and the story snippet, followed by HTML source code. Is there a particular that must be enabled to resolve this? These are my WebView settings: newsfeed = (WebView)

is there a “rails” way to redirect if mobile browser is detected?

不问归期 提交于 2019-12-10 02:43:30
问题 I want to run a user-agent check but only on my homepage (static_controller#home) I have taken a close look at the code: http://www.arctickiwi.com/blog/mobile-enable-your-ruby-on-rails-site-for-small-screens and it seems close but it never gets tied together, its just method creation... I am open to a jquery method but would prefer ruby/rails over js. I only really care about iphone and droid... 回答1: Check out this screencast. They suggest using the following for detecting a mobile device:

how to change user agent in selenium with .net

独自空忆成欢 提交于 2019-12-10 00:48:32
问题 I want to test a web app written in .NET with different agents (iPhone, iPad, Android), I'm using NUnit for the tests and Selenium. Anyone has a sample to change the agent (for example for iPad or iPhone) in Selenium with c# or VB? 回答1: Example UA (You may need Google yourself to find the ones suit your purpose): Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25 C# Firefox: FirefoxProfile profile = new FirefoxProfile

User Agent parsing with Regex

半世苍凉 提交于 2019-12-09 21:56:01
问题 I found a method online for separating out views when viewing a Ruby on Rails application on an iPhone and it parses the user agent to detect this. I'm specifically targeting iOS 4.2+ since previous versions don't support HTML5 Web Sockets which I need for my application. So far I am parsing /(iPhone.+OS.+4_2.+Safari)/ and it seems to work a treat but the problem I am having is that if you were using a beta or a future version of the OS the user agent might not include 4_2 but it may support

Parallel requests in Mojolicious application

江枫思渺然 提交于 2019-12-09 19:19:43
问题 I have perl application which, for example, parallel searching in google: use Mojo::UserAgent; use Mojo::IOLoop; my $ua = Mojo::UserAgent->new(); my $delay = Mojo::IOLoop->delay(sub { say 'DONE1 (should be before render)'; }); foreach my $i ( 1 .. 10 ) { $delay->begin(); $ua->get("http://www.google.ru/search?q=$i" => sub { say $i; $delay->end(); }); } $delay->wait() unless $delay->ioloop->is_running(); say 'DONE2 (should be before render)'; say 'Found! (render)'; And it's works fine: 6 1 7 10

How to use Piwik device detector in php project?

笑着哭i 提交于 2019-12-09 17:40:38
问题 I want to use php device detector that is part of famous Piwik project, but i can't understand how to include and use the code in my php code? i don't want to use composer. I wrote: <?php include 'DeviceDetector.php'; use DeviceDetector\DeviceDetector; use DeviceDetector\Parser\Device\DeviceParserAbstract; $dd = new DeviceDetector($_SERVER['HTTP_USER_AGENT']); $dd->parse(); $clientInfo = $dd->getClient(); var_dump($clientInfo); But it doesn't work. i get this error: Fatal error: Uncaught

What is the iPad2 User-Agent string?

爱⌒轻易说出口 提交于 2019-12-09 17:03:22
问题 Does anyone know the user-agent string of the just released iPad2? 回答1: This is my most recent user agent record from my ipad 2: Mozilla/5.0(iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5 回答2: iPad 2 with iOS 5.1 Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3 来源: https://stackoverflow.com/questions/5677068/what-is-the-ipad2-user-agent

Custom user agent string or header without modifying cordova libs

蹲街弑〆低调 提交于 2019-12-09 16:04:34
问题 I have an Android Phonegap/Cordova app that interacts with an ASP.NET MVC web application. I am trying to detect server side whether or not the web page is being loaded from a browser or from my Phonegap/Cordova app. There are a few methods I have considered: Change the User Agent string. I found this stackoverflow link that describes a way to make that work. Unfortunately, it did not work for me. The request object did not have the custom user agent string. Include a custom header value.

How to reset all default styles of the HTML5 button element

[亡魂溺海] 提交于 2019-12-09 07:59:26
问题 Scenario I use the <button> element which appeares just as plain text with an "+" on right end. On click a div element expands and reveals some information. I think the button element is semanticaley correct to represent such a ... button ... trigger. Problem So I have mixed some buttons and h2 elements and I have got a visual problem. After resetting all default user agent style's I expect that every element I introduce to the document looks plain and unstyled. But the button element does

Rspec: how to spec request.env in a helper spec?

时光总嘲笑我的痴心妄想 提交于 2019-12-09 07:53:48
问题 In my helper module, I have: def abc(url) ... if request.env['HTTP_USER_AGENT'] do something end end In my spec file, I have: describe "#abc" do before(:each) do @meth = :abc helper.request.env['HTTP_USER_AGENT'] = "..." end it "should return the webstart jnlp file" do @obj.send(@meth, "some_url").should .... end end When I run the spec I have this error: undefined local variable or method `request' for <ObjectWithDocHelperMixedIn:0x00000103b5a7d0> How do I stub for request.env['...'] in my