Update chrome.js

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

View File

@ -222,7 +222,7 @@ var ChromeObject = function() {
});
};
this.sendRPC = function(method, params) {
this.sendPageRPC = function(method, params) {
this.ws.send("ws://localhost:" + this.debuggingPort + "/devtools/page/" + this.pageId, JSON.stringify({
"id": this.pageEventId,
"method": method,
@ -232,13 +232,15 @@ var ChromeObject = function() {
};
this.navigate = function(url) {
return this.sendRPC("Page.navigate", {
return this.sendPageRPC("Page.navigate", {
"url": url
});
};
this.evaluate = function(code) {
// todo
this.evaluate = function(expression) {
return this.sendPageRPC("Runtime.evaluate", {
"expression": expression
});
};
};