Update chrome.js

This commit is contained in:
Namhyeon Go 2021-07-30 03:28:22 +09:00 committed by GitHub
parent 297a116923
commit 2b5a4ad0ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -497,10 +497,14 @@ var ChromeObject = function() {
return page.url;
};
this.getCurrentDomain = function() {
return this.getEvaluatedValue('document.domain');
};
this.triggerEvent = function(eventName, selector) {
return this.evaluate('document.querySelector("' + selector + '").dispatchEvent(new Event("' + eventName + '"))');
};
this.scrollBy = function(dx, dy) {
var dx = (typeof(dx) !== "undefined" ? dx : '0');
var dy = (typeof(dy) !== "undefined" ? dy : '0');
@ -523,7 +527,7 @@ var ChromeObject = function() {
console.error("ChromeObject.hasClass() -> " + e.message);
}
};
this.getAttribute = function(selector, attributeName) {
return this.getEvaluatedValue('document.querySelector("' + selector + '").getAttribute("' + attributeName + '")');
};