mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-13 21:21:03 +00:00
Update chrome.js
This commit is contained in:
parent
d834349da5
commit
624742edf6
|
@ -28,7 +28,10 @@ var ChromeObject = function() {
|
||||||
"port": 1080
|
"port": 1080
|
||||||
};
|
};
|
||||||
this.inPrivate = false;
|
this.inPrivate = false;
|
||||||
|
|
||||||
|
// user agent
|
||||||
this.userAgent = null;
|
this.userAgent = null;
|
||||||
|
this.userAgents = [];
|
||||||
|
|
||||||
// dependencies
|
// dependencies
|
||||||
this.oAutoIt = null;
|
this.oAutoIt = null;
|
||||||
|
@ -175,6 +178,11 @@ var ChromeObject = function() {
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.addUserAgent = function(ua) {
|
||||||
|
this.userAgents.push(ua);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
this.open = function(url) {
|
this.open = function(url) {
|
||||||
this.setProfile(this.profileName, this.installedDir);
|
this.setProfile(this.profileName, this.installedDir);
|
||||||
|
|
||||||
|
@ -269,7 +277,12 @@ 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
|
// choice user agent
|
||||||
|
if (this.userAgents.length > 0) {
|
||||||
|
this.setUserAgent(RAND.one(this.userAgents));
|
||||||
|
}
|
||||||
|
|
||||||
|
// set user agent
|
||||||
if (this.userAgent != null) {
|
if (this.userAgent != null) {
|
||||||
cmd.push("--user-agent=\"" + this.userAgent + "\"");
|
cmd.push("--user-agent=\"" + this.userAgent + "\"");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user