Jump to content

[Solved] Smartphone IE browser emulation


Exit
 Share

Recommended Posts

[Problem solved. See post #7 ]

I have written a script for SEO (Search engine optimizing). It is running fine on desktop.

Now I would like to emulate a smartphone on the google search page.

How to tell IE to use the screen size of a smartphone?

Didn't found a solution in IE.AU3

Any advice?

TIA Exit

 

Edited by Exit
Prolem solved

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

I'm not sure what you mean.

 

If you mean to tell to a webpage that you're from a smartphone you can do it changing your User Agent to Phone's one.

 

Saludos

Link to comment
Share on other sites

You can do this.

#include <IE.au3>

Local $oIE = _IECreate()
Sleep(1000)
$oIE.Navigate2("http://www.useragentstring.com/", Default, Default, Default, _
"User-Agent: Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 520) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537")

Saludos

Link to comment
Share on other sites

Many thanks to Danyfirex  and Blue_Drache

It gave me a pointer to dig further.

I want to emulate a  4" screen (800x400).
This is possible when using F12 and click on resolution.

See this screenshot:

Zwischenablage01.jpg


How to achive this sizing with UserAgent ?

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

  • 3 weeks later...

OK, I got a solution:

#include <IE.au3>
$oIE = _IECreate()
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "", "{F12}")
Sleep(1000)
ControlSend("[Class:F12FrameWindow]", "", "", "^{F7}{TAB 3}{down}{TAB 3}{up 9}{down}")
_IENavigate($oIE, "http://www.google.com/#num=100&q=autoit+jon")
WinActivate($hIE)
MsgBox(262144, Default, "click 'OK' to close IE Test window", 0)
_IEQuit($oIE)

 

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Solution was not working.

Ctrl+F7 was wrong. Should be Ctrl+7

Here the correct script:

;
; Switch IE Browser to mobile and back.

#include <IE.au3>
$oIE = _IECreate()
$hIE = _IEPropertyGet($oIE, "hwnd")
ControlSend($hIE, "", "", "{F12}")
Sleep(1000)
ControlSend("[Class:F12FrameWindow]", "", "", "^7")
ControlSend("[Class:F12FrameWindow]", "", "", "{TAB 3}{down}{TAB 3}{up 9}{down}")
_IENavigate($oIE, "http://www.google.com/#num=100&q=autoit+jon")
WinActivate($hIE)
MsgBox(262144, Default, "click 'OK' to return to desktop mode", 0)
WinClose("[Class:F12FrameWindow]")
MsgBox(262144, Default, "click 'OK' to close IE Test window", 0)
_IEQuit($oIE)

 

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...