Simulating Fennec on desktop



All timestamps are based on your local time of:

Posted by: stak
Tags: mozilla
Posted on: 2012-05-21 10:52:09

A lot of you probably know this already, but I thought I'd put it here anyway for future reference. Now that we've released Firefox for Android Beta, we're getting a lot of bug reports of various websites that behave unexpectedly or just plain don't work (this is great, keep the bugs coming!). Often it turns out that the page is just poorly designed for mobile browsers, and the problem isn't really in the browser but in the mobile-specific content that is served to us.

As one of the first steps when investigating bugs of the kind "Site X misbehaves in Fennec", I always check to see if I can reproduce the behaviour in desktop Firefox using the User Agent Switcher add-on to get the mobile-specific content. The User Agent Switcher add-on is great because it lets you modify the fields (User-Agent HTTP header and some window.navigator properties) that pages often use to do mobile detection. By using a desktop browser with Fennec UA properties, I can narrow down the scope of the bug as being a Fennec-specific bug, a Gecko core bug, or a website error.

If this is useful to you, you can get the addon here. It doesn't come with the Fennec UA settings by default, but allows import/export of settings. I have the XML file for Fennec 15.0a1 (current nightly) available for download here. I also have a page that shows you the necessary UA settings for any browser - just navigate to this page in the browser whose settings you want to see.

There is a caveat though: some websites use other forms of UA detection to serve mobile-specific content. For example, CSS3 Media Queries is one way to do it. I haven't run into too many sites that do this, but that number will (hopefully) grow, so it's something to keep in mind.

Posted by Stephan Sokolow at 2012-05-21 13:37:00
None of my pages do ANY UA sniffing whatsoever beyond one special page which uses it for telling the user how frequently the site is tested against their browser.

As a result, I'm keeping an eye on Bug 750366 (Start producing Android x86 Firefox builds) so, once it's resolved, I can just throw a copy of Fennec into the VirtualBox VM I use to test my pages in the default Android browser.
[ Reply to this ]
Posted by stak at 2012-05-21 14:58:04
Have you tried running Fennec in the android emulator? As of v14 you should be able to run it since it has ARM emulation.
[ Reply to this ]
Posted by Stephan Sokolow at 2012-05-21 15:24:02
I don't bother with the Android Emulator. Browsers written for modern ARM processors run so slowly in it that the time spent testing would cost me more in lost potential earnings than I'd spend just paying someone with a real phone to test for me... and I can't afford that either.

My current approach is to test my adaptive sites on a narrow desktop Chromium window (Chromium can be narrowed down to just over 200px wide. No other desktop browser can.) and, once they're ready, on Android's stock x86 browser in VirtualBox, the newest XUL Fennec I can find for Linux amd64 (10.0.0.2 currently), and in the Opera Mobile and Opera Mini simulators.

...and the only change I see myself making to that process, prior to being able to replace XUL Fennec with x86 Native Fennec, is incorporating some form of automation to handle setting up and puppeting all those browsers so I can check for layout bugs just by glancing over a bunch of automatically-captured full-page screenshots. (Among other things, that will enable me to test many more form factors)
[ Reply to this ]

[ Add a new comment ]

 
 
(c) Kartikaya Gupta, 2004-2018. User comments owned by their respective posters. All rights reserved.
You are accessing this website via IPv4. Consider upgrading to IPv6!