Update chrome.js

This commit is contained in:
Namhyeon Go 2022-01-09 02:04:06 +09:00 committed by GitHub
parent da671ca7bc
commit 3d15aef7c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,7 @@ var ChromeObject = function() {
"port": 1080
};
this.inPrivate = false;
this.userAgent = null;
// dependencies
this.oAutoIt = null;
@ -169,6 +170,11 @@ var ChromeObject = function() {
return this;
};
this.setUserAgent = function(ua) {
this.userAgent = ua;
return this;
};
this.open = function(url) {
this.setProfile(this.profileName, this.installedDir);
@ -256,6 +262,9 @@ var ChromeObject = function() {
// set user data directory
cmd.push("--user-data-dir=\"" + this.userDataDir + "\"");
// set user agent
cmd.push("--user-agent=\"" + this.userAgent + "\"");
// set URL
cmd.push("\"" + url + "\"");
@ -476,8 +485,8 @@ var ChromeObject = function() {
}
}
// calling `onfocus` event
this.dispatchEvent(new STD.Event("focus"));
// calling `onfocus` event
this.dispatchEvent(new STD.Event("focus"));
return title;
};