mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-12 04:31:04 +00:00
Update chrome.js
This commit is contained in:
parent
7239d3866d
commit
d5c2a0dd2c
|
@ -511,15 +511,26 @@ var ChromeObject = function() {
|
|||
return this.sendPageRPC("Page.reload", {});
|
||||
};
|
||||
|
||||
this.hasClass = function(selector, className) {
|
||||
var result = this.getEvaluatedValue('document.querySelector(".html5-video-player").getAttribute("class")');
|
||||
if (result) {
|
||||
var classNames = result.split(' ');
|
||||
return (classNames.indexOf(className) > -1);
|
||||
} else {
|
||||
return false;
|
||||
this.hasClass = function(seletctor, className) {
|
||||
try {
|
||||
var result = this.getEvaluatedValue('document.querySelector(".html5-video-player").getAttribute("class")');
|
||||
if (typeof(result) === "string") {
|
||||
return (result.split(' ').indexOf(className) > -1);
|
||||
} else {
|
||||
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();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user