我有以下qml代码
WebEngineView {
id: _webView
height: parent.height - 20
width: parent.width - 20
x: 10
y: 10
backgroundColor: "#e3e3e6"
userScripts: WebEngineScript {
injectionPoint: WebEngineScript.DocumentCreation
sourceCode: "document.cookie = " + readyCookie
}
url: "http://example.com"
}我在readyCookie变量中有一个cookie。例如:
JSESSIONID=DUo6nBoJgAJAsimljT5PdfGc5hs97kSbb1LqMjgL.dfvdf-dfv-fdf; domain=something.ru; path=/我尝试在url: "http://example.com"字符串中进行授权,使用
userScripts: WebEngineScript {
injectionPoint: WebEngineScript.DocumentCreation
sourceCode: "document.cookie = " + readyCookie
}但这不管用。曲奇是对的。
有什么想法吗?
发布于 2020-11-03 22:31:42
问题解决了:
userScripts: WebEngineScript {
injectionPoint: WebEngineScript.DocumentCreation
sourceCode: "document.cookie = \"" + readyCookie + "\""
}https://stackoverflow.com/questions/64664455
复制相似问题