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
ac6c568682
commit
af267cf268
|
@ -13,6 +13,7 @@ var ChromeObject = function() {
|
||||||
this.profileName = "Default";
|
this.profileName = "Default";
|
||||||
this.userDataDir = null;
|
this.userDataDir = null;
|
||||||
this.proxyPort = 1080;
|
this.proxyPort = 1080;
|
||||||
|
this.inPrivate = false;
|
||||||
this.processList = [];
|
this.processList = [];
|
||||||
|
|
||||||
this.setBinPath = function(path) {
|
this.setBinPath = function(path) {
|
||||||
|
@ -53,6 +54,7 @@ var ChromeObject = function() {
|
||||||
this.userDataDir = SHELL.getPathOfMyDocuments() + "\\UserData_Chrome_" + this.profileName;
|
this.userDataDir = SHELL.getPathOfMyDocuments() + "\\UserData_Chrome_" + this.profileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.inPrivate) {
|
||||||
SHELL.createDesktopIcon("Chrome Prototype (" + this.installedDir + ")", [
|
SHELL.createDesktopIcon("Chrome Prototype (" + this.installedDir + ")", [
|
||||||
"cscript",
|
"cscript",
|
||||||
"app.js",
|
"app.js",
|
||||||
|
@ -63,6 +65,24 @@ var ChromeObject = function() {
|
||||||
"--user-data-dir=\"" + this.userDataDir + "\"",
|
"--user-data-dir=\"" + this.userDataDir + "\"",
|
||||||
url
|
url
|
||||||
].join(' '), SYS.getCurrentScriptDirectory());
|
].join(' '), SYS.getCurrentScriptDirectory());
|
||||||
|
} else {
|
||||||
|
SHELL.createDesktopIcon("Chrome Prototype (" + this.installedDir + ")", [
|
||||||
|
"cscript",
|
||||||
|
"app.js",
|
||||||
|
"shoutcut",
|
||||||
|
"chrome",
|
||||||
|
this.installedDir,
|
||||||
|
"--incognito",
|
||||||
|
"--profile-directory=\"" + this.profileName + "\"",
|
||||||
|
"--user-data-dir=\"" + this.userDataDir + "\"",
|
||||||
|
url
|
||||||
|
].join(' '), SYS.getCurrentScriptDirectory());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setInPrivate = function(flag) {
|
||||||
|
this.inPrivate = flag;
|
||||||
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.open = function(url) {
|
this.open = function(url) {
|
||||||
|
@ -118,12 +138,24 @@ var ChromeObject = function() {
|
||||||
|
|
||||||
var shell = SHELL.create();
|
var shell = SHELL.create();
|
||||||
shell.setWorkingDirectory(this.workingDirectory);
|
shell.setWorkingDirectory(this.workingDirectory);
|
||||||
|
|
||||||
|
if (!this.inPrivate) {
|
||||||
shell.runAs(this.binPath, [
|
shell.runAs(this.binPath, [
|
||||||
"--profile-directory=\"" + this.profileName + "\"",
|
"--profile-directory=\"" + this.profileName + "\"",
|
||||||
"--proxy-server=\"socks5://127.0.0.1:" + this.proxyPort + "\"",
|
"--proxy-server=\"socks5://127.0.0.1:" + this.proxyPort + "\"",
|
||||||
"--user-data-dir=\"" + this.userDataDir + "\"",
|
"--user-data-dir=\"" + this.userDataDir + "\"",
|
||||||
"\"" + url + "\""
|
"\"" + url + "\""
|
||||||
]);
|
]);
|
||||||
|
} else {
|
||||||
|
shell.runAs(this.binPath, [
|
||||||
|
"--incognito",
|
||||||
|
"--profile-directory=\"" + this.profileName + "\"",
|
||||||
|
"--proxy-server=\"socks5://127.0.0.1:" + this.proxyPort + "\"",
|
||||||
|
"--user-data-dir=\"" + this.userDataDir + "\"",
|
||||||
|
"\"" + url + "\""
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
sleep(3000);
|
sleep(3000);
|
||||||
shell.release();
|
shell.release();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user