@Chimp You're code does not work for me.
So I did a mod.
_Example()
Func _Example()
_SetBroswerEmulation()
Local $o_Obj = __HTMLFILEObjCreate()
$o_Obj.write('<script src="https://momentjs.com/downloads/moment.min.js"></script>')
$o_Obj.write('<script>var JSglobal = (1,eval)("this");</script>')
$o_Obj.write('<script>function Hello(arg){return "Hello " + arg;}</script>')
Local $oJs=$o_Obj.parentwindow.JSglobal
MsgBox(0, "",$oJs.eval("moment().format('MMMM Do YYYY, h:mm:ss a');"))
MsgBox(0, "",$oJs.Hello("Danyfirex"))
EndFunc ;==>__Example_2
Func _SetBroswerEmulation()
Local $sName=@AutoItExe
Local $aSplit=StringSplit($sName,"\",1)
$sName=$aSplit[$aSplit[0]]
RegWrite("HKCU\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION",$sName,"REG_DWORD",0x2AF9)
EndFunc
Func __HTMLFILEObjCreate()
Local $Object = 0
If IsObj($Object) Then $Object = 0
$Object = ObjCreate("htmlfile")
Return $Object
EndFunc ;==>__HTMLFILEObjCreate
Saludos