AutoHotKeys automate Chrome without Chrome.ahk

19.1.2023 - 604 просмотрa ;)

We will use no one AutoHotKeys libs.

How to inject JavaScript code to DevTools ?
Open browser:

if WinExist(«ahk_exe msedge.exe»)

I mean DevTools and favorite URL is opened.. or simply press Ctrl-Shift-j? and put URL in adress bar.

Focus on devtool console

Send, ^« ; goto console

Clear console

Send, ^l ; clear console

Remove all text in console

Send, ^+{Home}{Del} ; remove all text in console

And now send commands to page

Send, document.querySelector(«{#}platform_domain»).value=»%A_LoopField%»;{Enter}

Cause we can send variables, and hashes  we need to escaping

Commands may be like that:

Send, document.querySelector(«{#}platform_domain»).value=»%A_LoopField%»;{Enter}
Send, document.querySelector(«{#}flash_messages»).remove();{Enter}
Send, document.querySelector(«{#}addsite_submit»).click();{Enter}

Then we need some of feedback from JavaScript to AutoHotKeys.

we will do it through the clipboard

Clipboard = zzz

wait while clipboard get new data

Send, ^« ; goto console
Send, copy(document.getElementById(«flash_messages»).innerText){Enter}
if (Clipboard != «zzz»){

Gotcha !

%Clipboard% — has our data!


This schame is work fine and dont need Chrome.ahk

Статьи из раздела, Видеочат рулетка