Update chrome.js

This commit is contained in:
Namhyeon Go 2021-06-20 07:05:02 +09:00 committed by GitHub
parent 54e895b6c2
commit 331578452f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,12 +223,19 @@ var ChromeObject = function() {
}; };
this.sendPageRPC = function(method, params) { this.sendPageRPC = function(method, params) {
this.ws.send("ws://localhost:" + this.debuggingPort + "/devtools/page/" + this.pageId, JSON.stringify({ if (this.pageId != "") {
"id": this.pageEventId, this.ws.send("ws://localhost:" + this.debuggingPort + "/devtools/page/" + this.pageId, JSON.stringify({
"method": method, "id": this.pageEventId,
"params": params "method": method,
})); "params": params
this.pageEventId++; }));
this.pageEventId++;
console.info("ChromeObject().sendPageRPC() -> Sent");
} else {
console.error("pageId not specified");
}
return this;
}; };
this.navigate = function(url) { this.navigate = function(url) {