Page 1 of 1

Skyfire Detection

Posted: Wed Jan 23, 2013 1:59 pm
by kendallbeaman
Hey all,

Ok, I just found out that when I tried to view my site in Skyfire it did not detect it as a mobile device. Now I had to do some reading and I see that Skyfire isn't exactly a browser but more of a trans-coder / proxy ? Or something like that.

I went to http://tools.scientiamobile.com/ and I've attached a screenshot of that since I had trouble copy and pasting.

But basically my question is this. What is the recommended way to detect this situation or is there one?

This was done on a Samsung Galaxy Galaxy s3 and the version of Skyfire is 4.1.0.24912 running JellyBean

Re: Skyfire Detection

Posted: Wed Jan 23, 2013 4:38 pm
by sm_support2
Thanks. We are familiar with SkyFire and it is not always possible to detect it from the UA string alone.

Anyway, we will consider this for improvement in the next version of the API.

Thanks

Re: Skyfire Detection

Posted: Wed Jan 23, 2013 4:45 pm
by kendallbeaman
Thanks for the reply. So if I wanted to detect Skyfire right now would searching the UA for Skyfire be a bad idea? Are there non-mobile browsers that might use Skyfire in the UA?

Re: Skyfire Detection

Posted: Wed Jan 23, 2013 4:57 pm
by sm_support2
Be aware that Skyfire also exposes itself with (or at least used to expose itself with) totally generic web browser UAs.
Skyfire information would be moved to other HTTP headers in that case.
So, detecting Skyfire exclusively through the "Skyfire" substring may or may not deliver the result you expect.

Anyway, we will keep an eye on this to see how we can better detect this in WURFL.

Please feel free to share any of your findings here too

Thanks

Re: Skyfire Detection

Posted: Wed Jan 23, 2013 5:05 pm
by sm_support2
here you go (courtesy of Steve Kamerman):

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17 Skyfire/2.0

“Android” mode:
Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; GT-P7310 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30

HTTP_X_REQUESTED_WITH: com.skyfire.browser

Re: Skyfire Detection

Posted: Wed Jan 23, 2013 9:03 pm
by kendallbeaman
Thanks. So to make sure I understand, to properly detect Skyfire I should employ two checks. First check is for that first UA string. The second check is a combination of the second UA string and the header variable being set with a value of com.skyfire.browser.

Do I have this right?

Re: Skyfire Detection

Posted: Thu Jan 24, 2013 12:07 am
by kamermans
In both cases the browser sends the X-Requested-With: com.skyfire.browser header (HTTP_X_REQUESTED_WITH is the way you access that header in PHP, et al). Note that I've only personally tested this on Android. I would check the header first, than the UA.

Re: Skyfire Detection

Posted: Thu Jan 24, 2013 9:08 am
by kendallbeaman
So here is what I have.

Code: Select all

			Boolean isSkyfire = false;

			// Check to see if the Skyfire Browser is being used. This "browser" is sometimes fun to detect
			// But currently the recommended way is to first check the X-Requested-With header and then the UA string.
			if ( Request.Headers["X-Requested-With"] != null && Request.Headers["X-Requested-With"] == "com.skyfire.browser")
			{
				isSkyfire = true;
			}
			else
			{
				// Now check the UA string
				isSkyfire = request.UserAgent.Contains("Skyfire");
			}

Do you guys see potential issues? I've tested it on my Android and it works fine.

Re: Skyfire Detection

Posted: Thu Jan 24, 2013 9:36 am
by sm_support2
seems about right. What percentage of skyfire traffic are you guys observing?

Re: Skyfire Detection

Posted: Thu Jan 24, 2013 9:43 am
by kendallbeaman
None as of yet. In fact my boss was fine with waiting until we got requests but I'm a tad bit of a perfectionist. We were testing another issue which turned out to be Firefox specific and I happened to have Skyfire on my Android although I use Chrome mainly. When I went to see if that issue occurred in Skyfire I found that it wasn't being detected as mobile and that would bug me in my sleep lol.

So I just made the change and tested it on our staging site. It hasn't been pushed to the live site yet. It may be that no one was using it but I prefer to be proactive. At least when I notice it.

Re: Skyfire Detection

Posted: Thu Jan 24, 2013 10:03 am
by sm_support2
Understood and we appreciate the spirit. Thank you for the feedback.