Browser security also tends to block you from accessing files on a PC. I don't know if you can get a javascript code to launch an AHK script. What you could possibly do though is have your AHK script running and monitoring for javascript to do something such as change the title of the window (I think that's possible) as a que for it to execute command X.
Here's how I would do it:
#Persistent
SetTitleMatchMode, 1
SetTimer, monitor, 500 ; loop might be better, but I'll try set timer here
return
monitor:
WinWaitActive, tampermonkeytitle ; the full title would be set as something like tampermonkeytitle cruiser - Google Chrome
WinGetTitle, name, A
StringTrimLeft, name, name, 18 ; take off the "tampermonkeytitle " from the name
StringTrimRight, name, name, 16 ; take off the " - Google Chrome" from the name
GoSub %name%
return
cruiser:
MsgBox You executed the line cruiser
return
And then your javascript should change the page's title (or window if you get that much control, I don't think you do) and include the unique prefix "tampermonkeytitle " and whichever label you would like to execute.
Now, the matter of feeding AHK commands back into javascript gets much trickier... The best I've done is use AHK to modify the javascript in my script manager extension (Scriptish in firefox) and refresh the page to execute changes.
---
OR, if you can, you can use COM which can explicitly work with websites in Internet Explorer and the syntax is similar to javascript, so it should be possible to translate your javascript code into an AHK script with COM and just have everything run from one AHK script.
Check out the Tutorials section of this forum for a few guides on using COM in Internet Explorer.