1 (изменено: Ander, 2021-12-02 01:51:24)

Тема: AHK: Chrome.ahk и пользователь в windows server 2008 r2

Добрый день!
Есть тестовый скрипт

#Include Chrome.ahk
ChromeInst := new Chrome(,, "--incognito") ; ,, "--headless") ;Запускаем окно браузера в режиме инкогнито
PageInst := ChromeInst.GetPage()
Send, ^l
Sleep, 500
SendRAW, https://site.com
Sleep, 100
Send, {Enter}
PageInst.WaitForLoad()
Sleep, 3000
ExitApp
return

Под учетной записью админа работает, под учетной записью пользователя выдает 2 ошибки и на этом все.
https://i.piccy.info/i9/c5f9dde15ebe7a0605522311e044ef17/1638395343/36231/1450312/test1.png
Пробовал добавить в исключения security_TEST.exe - первая ошибка уходит, по второй не получается добавить в исключения текст <!DOCTYPE html>...
Подскажите пожалуйста как решить проблему, может кто с этим стыкался?

Post's attachments

test1.png 35.38 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

2

Re: AHK: Chrome.ahk и пользователь в windows server 2008 r2

В Chrome.ahk есть следующий класс, в котором находится текст из ошибки

class WebSocket
		{
			__New(WS_URL)
			{
				static wb
				
				; Create an IE instance
				Gui, +hWndhOld
				Gui, New, +hWndhWnd
				this.hWnd := hWnd
				Gui, Add, ActiveX, vWB, Shell.Explorer
				Gui, %hOld%: Default
				
				; Write an appropriate document
				WB.Navigate("about:<!DOCTYPE html><meta http-equiv='X-UA-Compatible'"
				. "content='IE=edge'><body></body>")
				while (WB.ReadyState < 4)
					sleep, 50
				this.document := WB.document
				
				; Add our handlers to the JavaScript namespace
				this.document.parentWindow.ahk_savews := this._SaveWS.Bind(this)
				this.document.parentWindow.ahk_event := this._Event.Bind(this)
				this.document.parentWindow.ahk_ws_url := WS_URL
				
				; Add some JavaScript to the page to open a socket
				Script := this.document.createElement("script")
				Script.text := "ws = new WebSocket(ahk_ws_url);`n"
				. "ws.onopen = function(event){ ahk_event('Open', event); };`n"
				. "ws.onclose = function(event){ ahk_event('Close', event); };`n"
				. "ws.onerror = function(event){ ahk_event('Error', event); };`n"
				. "ws.onmessage = function(event){ ahk_event('Message', event); };"
				this.document.body.appendChild(Script)
			}
			
			; Called by the JS in response to WS events
			_Event(EventName, Event)
			{
				this["On" EventName](Event)
			}
			
			; Sends data through the WebSocket
			Send(Data)
			{
				this.document.parentWindow.ws.send(Data)
			}
			
			; Closes the WebSocket connection
			Close(Code:=1000, Reason:="")
			{
				this.document.parentWindow.ws.close(Code, Reason)
			}
			
			; Closes and deletes the WebSocket, removing
			; references so the class can be garbage collected
			Disconnect()
			{
				if this.hWnd
				{
					this.Close()
					Gui, % this.hWnd ": Destroy"
					this.hWnd := False
				}
			}
		}

Может кто знает как обойти эту ошибку?