mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-11 17:34:58 +00:00
Update chrome.js
This commit is contained in:
parent
297a116923
commit
2b5a4ad0ae
|
@ -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 + '")');
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user