Re: [rails-oceania] force mobile style/media?

25 views
Skip to first unread message

Warren Seen

unread,
Oct 31, 2012, 6:45:05 AM10/31/12
to rails-...@googlegroups.com
Interesting question - at a guess, I'd say that you would need to override the user agent header to impersonate eg mobile safari.

I haven't tried it, but this gem looks like it might do kind of what you want?



On 31/10/2012, at 7:11 PM, jamesl <ladd....@gmail.com> wrote:

Hi All,

I'm needing to test responsive layouts and functionality and I'm hoping to use
firefox and the usual capybara / selenium setup.

How can I trick the browser into thinking it is a mobile size device?
Obviously or not so obviously changing screen size isn't enough
as I want Twitter Bootstrap to also think it is running on a mobile.

- James.

--
You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rails-oceania/-/689K_OencTsJ.
To post to this group, send email to rails-...@googlegroups.com.
To unsubscribe from this group, send email to rails-oceani...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.

Jon Rowe

unread,
Oct 31, 2012, 6:43:35 AM10/31/12
to rails-...@googlegroups.com
You could use the iOS simulator… (New safari can run web inspector on this for added bonus)
I find chrome won't resize itself small enough.

Jon Rowe
-----------------------------

Daniel

unread,
Oct 31, 2012, 8:58:16 AM10/31/12
to rails-...@googlegroups.com
Capybara with selenium-webdriver lets you add any .xpi (firefox plugin) to the firefox session it creates.
In theory you could get Ripple going with it.

Keith Pitt

unread,
Oct 31, 2012, 6:41:46 PM10/31/12
to rails-...@googlegroups.com
Are you trying to test mobile-specific css? Or mobile-specific javascript?

-- 
Keith Pitt
Sent with Sparrow

--
You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rails-oceania/-/bkY6oriEmMEJ.

Nigel Sheridan-Smith

unread,
Oct 31, 2012, 9:15:05 AM10/31/12
to rails-...@googlegroups.com
Not sure about testing specifically, but I use Burp Suite (a security testing proxy) to overwrite the User Agent header and that works a treat. The free version is sufficient for this...

Cheers,

Nigel

--
You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rails-oceania/-/bkY6oriEmMEJ.

To post to this group, send email to rails-...@googlegroups.com.
To unsubscribe from this group, send email to rails-oceani...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.



--
 
Get together for fun activities at www.joinsomeone.com
 
Follow us on Twitter @JoinSomeoneMEL

Reply all
Reply to author
Forward
0 new messages