5th Jan 2015, 02:13 AM | #1 |
Email Monetization Expert Join Date: 2011
Posts: 2,993
Thanks: 38
Thanked 1,374 Times in 927 Posts
|
Anyone know the trick to spoofing user agent, so that a site will think it's a mobile device and return a mobile version if one exists, instead of desktop version?
|
5th Jan 2015, 10:07 AM | #2 |
Advanced Warrior Join Date: 2013 Location: teri maa ki chut
Posts: 540
Thanks: 26
Thanked 77 Times in 72 Posts
|
All you need is User Agent Switcher Addon available for Chrome and Firefox. Just google it. |
| |
6th Jan 2015, 12:03 AM | #3 |
Mobile+WP = JumpMobi.com War Room Member Join Date: 2009 Location: San Antonio, Tx
Posts: 1,270
Thanks: 301
Thanked 449 Times in 309 Posts
| |
Sorry, I am too busy helping people to think of a cool signature! | |
6th Jan 2015, 12:21 AM | #4 |
Email Monetization Expert Join Date: 2011
Posts: 2,993
Thanks: 38
Thanked 1,374 Times in 927 Posts
|
Thanks, but that's not what I'm looking for. This is a web server based simulator. Exist on a url and users with different web browsers can access it. I know the ability to spoof the user agent is possible, so that it will return a mobile version of a site if one exists, because I have seen it done. |
6th Jan 2015, 01:10 PM | #5 |
Mobile+WP = JumpMobi.com War Room Member Join Date: 2009 Location: San Antonio, Tx
Posts: 1,270
Thanks: 301
Thanked 449 Times in 309 Posts
|
I see what you are saying now - i created a mobile checker for our JumpMobi Insiders that does what you are asking... See screenshot here: http://screencast.com/t/IdV0rBEJ As you can see the last screenshot the display on the far right is what is displayed when you view the site with an active mobile user agent. This is done with PHP CURL and the CURLOPT_USERAGENT variable. If its just a screen capture you need instead of a functional page grab then i would recommend using a Screenshot API Service - it's quicker and MUCH easier to implement! For example url2png.com is a service i have used before.. Hope that helps... |
Sorry, I am too busy helping people to think of a cool signature! | |
6th Jan 2015, 06:28 PM | #6 | |
Email Monetization Expert Join Date: 2011
Posts: 2,993
Thanks: 38
Thanked 1,374 Times in 927 Posts
|
Know of any links you could point me to of examples? | |
6th Jan 2015, 06:39 PM | #7 | |
Email Monetization Expert Join Date: 2011
Posts: 2,993
Thanks: 38
Thanked 1,374 Times in 927 Posts
|
CURLOPT_USERAGENT => "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A537a Safari/419.3", // who am i So the above doesn't work, but I take it that it should. I think I have a problem with my code somewhere. I'm going to get my buddy to have a look, he is real good with this stuff. | |
7th Jan 2015, 11:50 AM | #8 |
Mobile+WP = JumpMobi.com War Room Member Join Date: 2009 Location: San Antonio, Tx
Posts: 1,270
Thanks: 301
Thanked 449 Times in 309 Posts
|
yeah serving the iframe with the user agent variable wont work create a page that grabs the user agent spoofed content first on a different page the iframe should display the page with the spoofed content you also need to delay the loading of the iframe so as to enable time to allow the content to be grabbed... if its dynamic you need to create a form that passes the variables from the form to the page that grabs the content... as you can see its not actually as straight forward as you would think it is - other things to note in some instances the url structure changes too so with curl you have to follow any re-routing urls too... some sites also use sessions/cookies to display mobile content i found out all the above through trial and error... but even when i had it working for the most part some sites still didnt render properly so its why i decided to go with the screencapture instead... hth |
Sorry, I am too busy helping people to think of a cool signature! | |
18th Feb 2015, 11:43 AM | #9 | |
Mobile+WP = JumpMobi.com War Room Member Join Date: 2009 Location: San Antonio, Tx
Posts: 1,270
Thanks: 301
Thanked 449 Times in 309 Posts
|
With a RESS/Adaptive approach the same url is used but a different HTML layout is rendered not based on screen size but by the browsers user agent type.... Hope that makes sense Cheers, Jay | |
Sorry, I am too busy helping people to think of a cool signature! | ||
Bookmarks |
Tags |
agent, based, mobile, simulator, spoof, user, web |
| |