Possible feature to make AHK working with Browser

Propose new features and changes
brandonhotkey
Posts: 113
Joined: 03 Nov 2013, 05:46

Possible feature to make AHK working with Browser

10 Feb 2023, 08:52

Hello,
I use Firefox browser for long time. As far as i remeber years ago, when I was active in discussions there was the problem, that when you want to do some job with AHK in site loaded in Firefox browser, it was not easy because the AHK doesn't have access to the identificator or handle of the windows or controls in the browser. Tell me if this problem was solved. If not, here is my solution. Maybe you'll find willing programmer of helping with an add-on for browser like Firefox or Chrome, which can do the job fixing the communication between the browser and running AHK script. I think the solution could be pretty simple. I am sure that every-one knows bar codes. The solution would be either to create new form on the Addon side, with a JQuery script to collect data. Than the collected data would be located in a specified element specified by the barcode. This would be information for the AHK, where the data are located on the site and what is result of the JS operation. The bar code could be located at bottom or on top of the screen but would be part of the html/body page injected by addon.

Notice, instead the barcodes it could be easier to work with binary information coded into color of the pixels. The bar code could be short just to check if it is present and then the rest of the information could be like one or two lines (rows) of pixels.

My idea about the data what should Javascript pass to the barcode:
1) Time needed to load the document. This would be usefull when you need to load more pages of the site. The time would help AHK script to detemine how long to wait for response. For example www load time would be 4 seconds, and the AHK script could use 1 second delay in a loop to read bar code etc.
2.a) Current position in the document or what is displayed. E.g. 0 can indicate beging of the html document.
2.b) Sensitivity of vertical scroll element. Is this possible to detect to use mouse scroll to navigate on the html site?
2.c) Sensitivity of horizontal scroll element. Is this possible to detect to use mouse scroll to navigate on the html site?
3.a) Width and
3.b) Height of the document.
4.a) Width and
4.b) Height of the button or element to be clicked on.
or possibly alternative could be area to be selected to copy text. So the addon can specify exact position where to click to select the text. Or even, the addon itself can select the text and place it to clipboard.
5) timestamp when the last change in the output box was made. This should prevent of copy the same content multipletimes in a loop.
6) boolean result True or False if successful operation was made or the text was not found.
7) location of the element to click next (where to click).

So if we would have this addon made for Firefox/Chrome, then some feature could be implemented directly into AHK core. So make it easy for AHK users to control the html site/page.

I can give you example. Let's say I want to copy verses from biblehub site.
biblehub dot com/text/isaiah/52-1.htm
The problem on the page is that I cannot select the table with columns of the Strongs numbers and hebrew text and english text, transliteration and morphology, because this would be hardly parsable. But using JQUery I can easely get six groups of data: numbers, dixtionary meaning, transliteration, hebrew text, english meaning, morphology. Every single group can be located in tag p with a class name. This would be the job of JQuery. So it will copy the nodes, send them to corresponding output box, create a barcode. AHK will read the barcode, copy, and then will click on next verse.

The job for AHK should be quite easy. The only thing what is needed is a person which would like to do the Firefox/Chrom addon for AHK. This should be universal, to be used on any page.
yousef_badr23
Posts: 19
Joined: 26 Aug 2022, 07:18

Re: Possible feature to make AHK working with Browser

07 Mar 2023, 12:10

There is a tutorial series on youtube for automating browsers with AHK, using UIA library maintained by Descolada. Search for it at
Joe - AUTOHOTKEY Guru channel
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Possible feature to make AHK working with Browser

07 Mar 2023, 12:27

Take a look at viewtopic.php?t=102616
You should be able to do anything you want with it.

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 11 guests