mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-21 17:11:05 +00:00
Update chrome.js
This commit is contained in:
parent
ef7f6fb0e1
commit
512f0b4cb9
|
@ -1181,6 +1181,10 @@ var ChromeObject = function(interfaces) {
|
||||||
return this.getEvaluatedValue('prompt("' + s + '")');
|
return this.getEvaluatedValue('prompt("' + s + '")');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.confirm = function(s) {
|
||||||
|
return this.getEvaluatedValue('(confirm("' + s + '") ? "true" : "false")');
|
||||||
|
};
|
||||||
|
|
||||||
this.setVendor = function(vendor) {
|
this.setVendor = function(vendor) {
|
||||||
var vendor = vendor.toLowerCase();
|
var vendor = vendor.toLowerCase();
|
||||||
|
|
||||||
|
@ -1225,6 +1229,18 @@ var ChromeObject = function(interfaces) {
|
||||||
return this.getEvaluatedValue("document.cookie");
|
return this.getEvaluatedValue("document.cookie");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.getNumberOfSelectorAll = function(selector) {
|
||||||
|
return parseInt(this.getEvaluatedValue('document.querySelectorAll("' + selector + '").length'));
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setValueOfInputs = function(type, s) {
|
||||||
|
this.evaluate('document.querySelectorAll("[type=' + type + ']").forEach(function(x){x.value = "' + s + '";})');
|
||||||
|
};
|
||||||
|
|
||||||
|
this.sendEnterKey = function() {
|
||||||
|
this.evaluate('var ev=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,keyCode:13});document.body.dispatchEvent(ev);');
|
||||||
|
};
|
||||||
|
|
||||||
this.create();
|
this.create();
|
||||||
};
|
};
|
||||||
ChromeObject.prototype = new STD.EventableObject();
|
ChromeObject.prototype = new STD.EventableObject();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user