Jump to content

Recommended Posts

Posted

I have a chrome window open. I need to be able to attach to it and get the current URL being browsed, I also need to be able redirect the browser to another URL.

How would I go about doing this?

Posted

Success :-)

AutoItSetOption("WinTitleMatchMode", 2)

$handle = WinGetHandle("[CLASS:Chrome_WindowImpl_0; TITLE:Getting the current chrome url]")

If @error Then
    MsgBox(4096, "Error", "Could not find the correct window")
Else
    ; alert the present url
    MsgBox(4096, "", ControlgetText($handle, "", "Chrome_AutocompleteEditView1" ))

    ;n redirect the browser
    ControlSetText ($handle, "", "Chrome_AutocompleteEditView1", "http://alterlife.org/")
    ControlSend ($handle, "", "Chrome_AutocompleteEditView1", "{enter}")
    MsgBox(4096, "Error", "The browser has been redirected to http://alterlife.org/.")
EndIf

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
  • Recently Browsing   0 members

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