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
da671ca7bc
commit
3d15aef7c9
|
@ -28,6 +28,7 @@ var ChromeObject = function() {
|
||||||
"port": 1080
|
"port": 1080
|
||||||
};
|
};
|
||||||
this.inPrivate = false;
|
this.inPrivate = false;
|
||||||
|
this.userAgent = null;
|
||||||
|
|
||||||
// dependencies
|
// dependencies
|
||||||
this.oAutoIt = null;
|
this.oAutoIt = null;
|
||||||
|
@ -169,6 +170,11 @@ var ChromeObject = function() {
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setUserAgent = function(ua) {
|
||||||
|
this.userAgent = ua;
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
this.open = function(url) {
|
this.open = function(url) {
|
||||||
this.setProfile(this.profileName, this.installedDir);
|
this.setProfile(this.profileName, this.installedDir);
|
||||||
|
|
||||||
|
@ -257,6 +263,9 @@ var ChromeObject = function() {
|
||||||
// set user data directory
|
// set user data directory
|
||||||
cmd.push("--user-data-dir=\"" + this.userDataDir + "\"");
|
cmd.push("--user-data-dir=\"" + this.userDataDir + "\"");
|
||||||
|
|
||||||
|
// set user agent
|
||||||
|
cmd.push("--user-agent=\"" + this.userAgent + "\"");
|
||||||
|
|
||||||
// set URL
|
// set URL
|
||||||
cmd.push("\"" + url + "\"");
|
cmd.push("\"" + url + "\"");
|
||||||
|
|
||||||
|
@ -476,8 +485,8 @@ var ChromeObject = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// calling `onfocus` event
|
// calling `onfocus` event
|
||||||
this.dispatchEvent(new STD.Event("focus"));
|
this.dispatchEvent(new STD.Event("focus"));
|
||||||
|
|
||||||
return title;
|
return title;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user