mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-14 13:41:05 +00:00
Update chrome.js
This commit is contained in:
parent
85fbab4d3a
commit
77ff042249
|
@ -320,9 +320,10 @@ var ChromeObject = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.terminate = function() {
|
this.terminate = function() {
|
||||||
var pageList = this.pageList;
|
try {
|
||||||
for (var i = 0; i < pageList.length; i++) {
|
this.oAutoIt.WinKill(this.pageId);
|
||||||
this.oAutoIt.WinKill(pageList[i].title);
|
} catch (e) {
|
||||||
|
console.error("ChromeObject.terminate() -> " + e.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -338,7 +339,7 @@ var ChromeObject = function() {
|
||||||
// change webpage title to original
|
// change webpage title to original
|
||||||
this.setTitle(_title);
|
this.setTitle(_title);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("ChromeObject.focus() -> " + e.message);
|
console.error("ChromeObject._focus() -> " + e.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -509,8 +510,12 @@ var ChromeObject = function() {
|
||||||
|
|
||||||
this.hasClass = function(selector, className) {
|
this.hasClass = function(selector, className) {
|
||||||
var result = this.getEvaluatedValue('document.querySelector(".html5-video-player").getAttribute("class")');
|
var result = this.getEvaluatedValue('document.querySelector(".html5-video-player").getAttribute("class")');
|
||||||
var classNames = result.split(' ');
|
if (result) {
|
||||||
return (classNames.indexOf(className) > -1);
|
var classNames = result.split(' ');
|
||||||
|
return (classNames.indexOf(className) > -1);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.create();
|
this.create();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user