mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-19 16:11:03 +00:00
Update chrome.js
This commit is contained in:
parent
7239d3866d
commit
d5c2a0dd2c
|
@ -511,14 +511,25 @@ var ChromeObject = function() {
|
||||||
return this.sendPageRPC("Page.reload", {});
|
return this.sendPageRPC("Page.reload", {});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.hasClass = function(selector, className) {
|
this.hasClass = function(seletctor, className) {
|
||||||
|
try {
|
||||||
var result = this.getEvaluatedValue('document.querySelector(".html5-video-player").getAttribute("class")');
|
var result = this.getEvaluatedValue('document.querySelector(".html5-video-player").getAttribute("class")');
|
||||||
if (result) {
|
if (typeof(result) === "string") {
|
||||||
var classNames = result.split(' ');
|
return (result.split(' ').indexOf(className) > -1);
|
||||||
return (classNames.indexOf(className) > -1);
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error("ChromeObject.hasClass() -> " + e.message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getAttribute = function(selector, attributeName) {
|
||||||
|
return this.getEvaluatedValue('document.querySelector("' + selector + '").getAttribute("' + attributeName + '")');
|
||||||
|
};
|
||||||
|
|
||||||
|
this.sendSpaceKey = function() {
|
||||||
|
this.oAutoIt.Send("{SPACE}");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.create();
|
this.create();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user