Jump to content
seangriffin

Chrome UDF

Recommended Posts

jdelaney

Try using the class instead

[CLASS:Chrome_WidgetWin_1]


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
Zohaib

Hello Friends.
please guide me for how to navigate chrome by its autoit udfs.
 

_ChromeStartup() ... this function takes url and opne chrome with this url. i want to navigate the chrome frome this url to another url. how i can do it?

Thanks in Advance

Share this post


Link to post
Share on other sites
junkew

I assume you can do something like

Not tested but should lead to something like

_ChromeEval("window.location = "http://www.mozilla.org";");

alternate udf is to search for iuiautomation in example forum

  • Like 1

Share this post


Link to post
Share on other sites
Zohaib

I assume you can do something like

Not tested but should lead to something like

_ChromeEval("window.location = "http://www.mozilla.org";");

alternate udf is to search for iuiautomation in example forum

 

I tried to use _ChromeEval("window.location = "http://www.mozilla.org";"); this but it dosn't work. i also find iuiautomation example but it was mouse movement. i want to automate chrome without using mouse like IE and FF.

Is there any other way to navigate chorome?

Share this post


Link to post
Share on other sites
arthalita01

where  _ChromeObjSetValueById ?

 i try add

Func _ChromeObjSetValueById($objid, $value, $index = 0, $timeout = 5)

    dim $response = ""

    $response = _ChromeEval("document.getElementsById('" & $objid & "')[" & $index & "].value = '" & $value & "';", $timeout)

    SetError(@error)

    return $response
EndFunc

Html Target

<TITLE>Chrome Example Form</TITLE>

<input type='text' id='textExample' value='http://' size='20' maxlength='30'>
#Include <Array.au3>
#Include <Chrome.au3>

_ChromeShutdown()
_ChromeStartup("http://192.168.2.100/x/cromeauto1")
_ChromeDocWaitForExistenceByTitle("Chrome Example Form", 5)

_ChromeObjSetValueById("textExample", "12121218") ;<<<<<<<---- BUT not working

>_<


tanks..

Edited by arthalita01

Share this post


Link to post
Share on other sites
neonoff

Hello Friends.

please guide me for how to navigate chrome by its autoit udfs.

 

_ChromeStartup() ... this function takes url and opne chrome with this url. i want to navigate the chrome frome this url to another url. how i can do it?

Thanks in Advance

_ChromeEval("document.location.replace('YOUR URL');")

that worked for me

Edited by neonoff

Share this post


Link to post
Share on other sites
neonoff

Recently Google has  disabled all extensions not from the google extension store. That's why this UDF stopped work, cause autoit extension was disabled by chrome. There are several ways to hack this but the most appropriate for my goals was to downgrade chrome.

This politics was annonced by Google in the January 2014 so all versions of Chrome after January automatically disables non store extensions. I chose the latest stable version of Chrome before 2014, it is 31.0.1650.63. Then I modified my host file (C:WINDOWSsystem32driversetchosts) with usual Windows notepad and added this strings:

127.0.0.1 clients.google.com
127.0.0.1 clients1.google.com
127.0.0.1 clients2.google.com
127.0.0.1 clients3.google.com
127.0.0.1 clients4.google.com
127.0.0.1 clients5.google.com
127.0.0.1 clients6.google.com
127.0.0.1 clients7.google.com
127.0.0.1 clients8.google.com
127.0.0.1 clients9.google.com
127.0.0.1 lh1.googleusercontent.com
127.0.0.1 lh2.googleusercontent.com
127.0.0.1 lh3.googleusercontent.com
127.0.0.1 lh4.googleusercontent.com
127.0.0.1 lh5.googleusercontent.com
127.0.0.1 lh6.googleusercontent.com
127.0.0.1 lh7.googleusercontent.com
127.0.0.1 encrypted-tbn1.gstatic.com
127.0.0.1 encrypted-tbn2.gstatic.com
127.0.0.1 encrypted-tbn3.gstatic.com
127.0.0.1 encrypted-tbn4.gstatic.com
127.0.0.1 encrypted-tbn5.gstatic.com

 

this strings prevent Chrome from upgrading.

Pros

I have working version of Chrome where I can install any extension I want and this extansions are enabled each time I start up Chrome.

Cons

I have not the latest version of Chrome with possible drawbacks, but I have this version installed on my virtual machine so for me it's not a minus at all.

P.S. One can have up-to-date Chrome and working extension, but each time you start up Chrome you will see annoying message about non store extension with suggestion to disable it.

Edited by neonoff

Share this post


Link to post
Share on other sites
duzers

where  _ChromeObjSetValueById ?

 i try add

Func _ChromeObjSetValueById($objid, $value, $index = 0, $timeout = 5)

    dim $response = ""

    $response = _ChromeEval("document.getElementsById('" & $objid & "')[" & $index & "].value = '" & $value & "';", $timeout)

    SetError(@error)

    return $response
EndFunc

Html Target

<TITLE>Chrome Example Form</TITLE>

<input type='text' id='textExample' value='http://' size='20' maxlength='30'>
#Include <Array.au3>
#Include <Chrome.au3>

_ChromeShutdown()
_ChromeStartup("http://192.168.2.100/x/cromeauto1")
_ChromeDocWaitForExistenceByTitle("Chrome Example Form", 5)

_ChromeObjSetValueById("textExample", "12121218") ;<<<<<<<---- BUT not working

>_<

tanks..

 

Not getElementsById but getElementById, and maybe without $index.

Try this:

Func _ChromeObjSetValueById($objid, $value,  $timeout = 5)
    dim $response = ""
    $response = _ChromeEval("document.getElementById('" & $objid & "').value = '" & $value & "';", $timeout)
    SetError(@error)
    return $response
EndFunc

Share this post


Link to post
Share on other sites
sthornhill11

 

STEP 2: Install the AutoIT Chrome Native Messaging Host.

Open the following link and download the file named autoit_chrome_native_messaging_host_install.exe:

https://docs.google.com/file/d/0B_6JmwNIIZ06eDgxaVJPNUNxa28/edit?usp=sharing

Note - you may be prompted to login with a Google account as this file is hosted on Google Drive.

 

I cannot get this file to download.

It keeps giving me an error message -

"Sorry, this file is infected with a virus

Only the owner is allowed to download infected files."

 

Looking forward to trying this out!

Share this post


Link to post
Share on other sites
AdnanZahid

I can install AutoIt extension but cannot enable it because it is not available on Chrome Web Store. Any ideas?

Share this post


Link to post
Share on other sites
Berfs

Hi,

Thanks for the script. I have the problem, that when i use your first example, autoit opens chrome and navigate to the page. But nothing happens, no entry is filled or clicked.

Edited by Berfs

Share this post


Link to post
Share on other sites
junkew

@Berfs: Probably better to open a new thread in general help and support if you have issues with the iuiautomation and chrome. Most likely you missed chrome://accessibility page

For others using chrome you can communicate thru a textbox and addressbar commands

Type this once for each page and an edit will be added

javascript: var e = document.createElement("input");e.setAttribute("value","Hello world");document.body.appendChild(e);void(0); 

then if you want to have data in it you type in addressbar

javascript: e.setAttribute("value", document.documentElement.innerHTML);

and this data you can retrieve with regular IUIAutomation scripts

I just did not have time to wrap that into UIAWrappers logic (as this concept works on all browsers that support bookmarklets)

Edited by junkew

Share this post


Link to post
Share on other sites
Oldeschool

Is there any plans of getting the Chrome UDF submitted to the Chrome Store?  I see that you are going a different way with IUI automation?    Can we still get support for the Chrome UDF such as downloading the files required?  Would you be willing to let someone else pursue the submitting extension to the Google store?

Share this post


Link to post
Share on other sites
obryana

Any ideas for how I can automatically disable the Save Password box that pops up every time someone logs in to a password protected website?

Share this post


Link to post
Share on other sites
directxguy

Hello. I too am wondering if there are any plans to submit this to the store so that it can be used with current versions of chrome.

Share this post


Link to post
Share on other sites
amartinez

Extensions can be loaded in unpacked mode by following these steps:

  1. Visit chrome://extensions (via omnibox or menu -> Tools -> Extensions).
  2. Enable Developer mode by ticking the checkbox in the upper-right corner.
  3. Click on the "Load unpacked extension..." button.
  4. Select the directory containing your unpacked extension.

The crx file needs to be extracted first. CRX files are zip files with a different header. Any capable zip program should be able to open it. If you don't have such a program, I recommend 7-zip.

Edited by amartinez

Share this post


Link to post
Share on other sites
mazinasm

Hi I have a problem with querySelector.

When i use my code, extension is down and doesn't work 

 image: http://screencast.com/t/AT1F45pF

Translation image

"There has been a breakdown AutoIT for Google Chrome. Click on this message to re-download this extension"

$class="input.mailbox__auth__button[type='submit']"
$oInputs = 'document.querySelector("'&$class&'").click()'
_ChromeEval("document.getElementsByName('Login')[0].value='petrsbu62'")
_ChromeEval("document.getElementsByName('Password')[0].value='z123456'")
_ChromeEval($oInputs)

I check full js in input.txt all is right 

document.querySelector("input.mailbox__auth__button[type='submit']").click()

I know that i can use some of the function from chrome.au3, but i need to now is querySelector are work in Chrome.ua3 or not. 

Edited by mazinasm

Share this post


Link to post
Share on other sites
wowxxoo

hi,polymath.

i have a question:i have opened one chrome browser,can i use the opening chrome  navigate another url by the chrome UDF? thank you very much!! 

Share this post


Link to post
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

  • Similar Content

    • caramen
      By caramen
      I watched _OL_ItemSend&_OL_ItemFind&_OL_ItemCreate in OutlookEx UDF but hmmm
       
      Since it use the test environnement i cant get the orders of the mail creation
       
      Can someone make me win some time of reading all exemples script and lead me how to do one ?
      That whould be lovely.
      Gnight
    • stafe
      By stafe
      Hello
      I am trying to get chrome to save it's current webpage to a pdf using autoit.  I wold like to save the file into a folder on the desktop called "ChromeFiles" .  However when I use the send command chrome only occasionally responds.
      Thank you
      Simon
       
    • Tersion
      By Tersion
      Here the this wiki page with list of available UDFs for data compression. For my tasks I only need ZIP support, so I started looking at pure AutoIt UDFs without any 3rd party dlls. And found out that most of available realizations uses standard ("native method") Windows dll - "zipfldr.dll". So for now I chose ZIP UDF by wraithdu. I've tested it on Windows 7 (x64) and it seem works fine. But here the comment from another topic where user says that Windows 10 discontinued support of "zipfldr.dll". Now I confused. I don't have around any Windows 10 machine to tested it. So maybe someone could confirm or deny that? Or maybe would better to switch to UDF with 7zip dll?
      I need an advice...
    • TheSaint
      By TheSaint
      Here is the bare bones of a UDF I have started work on.
      Mostly just a proof of concept at this stage, and still need to add some functions and dress the UDF up a bit ... to look like a UDF ... though it has my own distinct styling, especially as I have never really developed a UDF before now .... used plenty and modified plenty though. I've even invented my own UDF variable naming convention, which I am sure some of you will be aghast at. I work with what feels best for me, but others are free to adapt if they wish.
      The idea is to emulate the simplicity of INI files, but gain the benefits of SQL.
      Two scripts are provided.
      (1) The UDF, a work in progress - SimpleSQL_UDF.au3
      (2) An example or testing script - UDF_Test.au3
      Another first for me, is creating a 2D array from scratch, never done that before, that I can recall ... never had a need, and even for 1 dimension arrays, for a long time now, I have just used _StringSplit to create them. So I needed a bit of a refresher course, which my good buddy @TheDcoder assisted me with ... not without some angst I might add. LOL
      SimpleSQL_UDF.zip  (12 downloads previously)
      (I have now completed all the functions I intended to. My next update will be a big improvement, bringing things more inline with my latest INItoSQL DB program changes.)
      Program requires the sqlite3.dll, not included, but easily enough obtained.
      Hopefully the usage is self-evident ... just change the Job number variable in the UDF_Test.au3 file to check the existing functions out.
      Enjoy!
      P.S. This is also related to a new program I have just finished and uploaded - INItoSQL DB
    • nooneclose
      By nooneclose
      I want to check some Excel data against data on a website in Chrome. I use Chrome because the site I use does not function properly in Internet Explorer or Firefox. I know how to do the Excel stuff I just can not figure out how to send to Chrome, let alone check to see if the data matches or not. I am also having trouble finding any help online while searching for Chrome functions for Autoit. I have a Chrome UDF installed but I still can not figure out how to get my code to properly function. (I am not posting code because I am  sure my code isn't right, to begin with)
      As usual, any and all help would be greatly appreciated. 
×