从vbscript向Chrome扩展程序发出XML HTTP请求

问题描述 投票:0回答:1

这是脚本,我需要它来返回我的chrome扩展的弹出式html的DOM:

URL="chrome-extension://jclgkomglckpklainiafinmjchonokdl/popup.html"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")

On Error Resume Next
http.open "GET", URL, False
http.send ""
If err.Number = 0 Then
    Wscript.Echo http.responseText
Else
    Wscript.Echo "error " & Err.Number & ": " & Err.Description
End If
set WshShell = Nothing
Set http = Nothing

它适用于之前有http://的网站,但不适用于上面的链接。在所述链接之前放置http://也不起作用。有什么方法可以使用chrome扩展吗?如果没有,是否有任何其他建议如何做到这一点?

PS vbscript是批处理文件的一部分,所以我只需双击即可设置扩展及其网页。

google-chrome batch-file google-chrome-extension vbscript xmlhttprequest
1个回答
0
投票

您无法从浏览器外部与Chrome WebExtension进行通信。它只是内部的。

您必须编写自己的WebExtension以与其接口或复制已由另一个扩展实现的功能。

我建议你阅读以下内容:

唯一的其他解决方案是使用VBScript或其他可以直接远程控制浏览器的工具,例如Selenium

© www.soinside.com 2019 - 2024. All rights reserved.