Update chrome.js

This commit is contained in:
Namhyeon Go 2025-06-07 18:10:29 +09:00
parent f911e34c16
commit bbc3aa9a6e

View File

@ -28,6 +28,7 @@ var ChromeObject = function() {
this.profileName = "Default"; this.profileName = "Default";
this.userDataDir = null; this.userDataDir = null;
this.defaultUserDataDir = null;
this.installedDir = "Chrome"; this.installedDir = "Chrome";
// proxy // proxy
@ -81,9 +82,7 @@ var ChromeObject = function() {
this.setProfile = function(profileName, installedDir) { this.setProfile = function(profileName, installedDir) {
this.profileName = (profileName == "Default" ? "Chrome" : profileName); this.profileName = (profileName == "Default" ? "Chrome" : profileName);
if (installedDir != null) { this.setInstalledDir(installedDir);
this.installedDir = installedDir;
}
this.workingDirectory = this.workingDirectory.replace(":installedDir", this.installedDir); this.workingDirectory = this.workingDirectory.replace(":installedDir", this.installedDir);
this.binPath = this.binPath.replace(":installedDir", this.installedDir); this.binPath = this.binPath.replace(":installedDir", this.installedDir);
return this; return this;
@ -114,6 +113,13 @@ var ChromeObject = function() {
return this; return this;
}; };
this.setInstalledDir = function(dirname) {
if (dirname != null) {
this.installedDir = dirname;
}
return this;
};
this.setProxy = function(obj) { this.setProxy = function(obj) {
this.proxy = obj; this.proxy = obj;
return this; return this;
@ -1263,42 +1269,50 @@ var ChromeObject = function() {
case "msedge": case "msedge":
this.workingDirectory = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Microsoft\\Edge\\Application"; this.workingDirectory = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Microsoft\\Edge\\Application";
this.binPath = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Microsoft\\Edge\\Application\\msedge.exe"; this.binPath = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Microsoft\\Edge\\Application\\msedge.exe";
this.defaultUserDataDir = SYS.getEnvString("LOCALAPPDATA") + "\\Microsoft\\Edge\\User Data";
break; break;
case "chrome": case "chrome":
this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\Google\\Chrome\\Application"; this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\Google\\Chrome\\Application";
this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application\\chrome.exe"; this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application\\chrome.exe";
this.defaultUserDataDir = SYS.getEnvString("LOCALAPPDATA") + "\\Google\\Chrome\\User Data";
break; break;
case "chrome.x86": case "chrome.x86":
this.workingDirectory = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Google\\Chrome\\Application"; this.workingDirectory = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Google\\Chrome\\Application";
this.binPath = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Google\\:installedDir\\Application\\chrome.exe"; this.binPath = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Google\\:installedDir\\Application\\chrome.exe";
this.defaultUserDataDir = SYS.getEnvString("LOCALAPPDATA") + "\\Google\\Chrome\\User Data";
break; break;
case "chromium": case "chromium":
this.workingDirectory = SYS.getEnvString("LOCALAPPDATA") + "\\Chromium\\Application"; this.workingDirectory = SYS.getEnvString("LOCALAPPDATA") + "\\Chromium\\Application";
this.binPath = SYS.getEnvString("LOCALAPPDATA") + "\\Chromium\\Application\\chrome.exe"; this.binPath = SYS.getEnvString("LOCALAPPDATA") + "\\Chromium\\Application\\chrome.exe";
this.defaultUserDataDir = null; // Edit here
break; break;
case "opera": case "opera":
this.workingDirectory = SYS.getEnvString("LOCALAPPDATA") + "\\Programs\\Opera"; this.workingDirectory = SYS.getEnvString("LOCALAPPDATA") + "\\Programs\\Opera";
this.binPath = SYS.getEnvString("LOCALAPPDATA") + "\\Programs\\Opera\\opera.exe"; this.binPath = SYS.getEnvString("LOCALAPPDATA") + "\\Programs\\Opera\\opera.exe";
this.defaultUserDataDir = SYS.getEnvString("LOCALAPPDATA") + "\\Opera Software\\Opera Stable\\Default";
break; break;
case "whale": case "whale":
this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\Naver\\Naver Whale\\Application"; this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\Naver\\Naver Whale\\Application";
this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Naver\\Naver Whale\\Application\\whale.exe"; this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Naver\\Naver Whale\\Application\\whale.exe";
this.defaultUserDataDir = SYS.getEnvString("LOCALAPPDATA") + "\\Naver\\Naver Whale\\User Data";
this.baseScreenY = 82; this.baseScreenY = 82;
break; break;
case "brave": case "brave":
this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\BraveSoftware\\Brave-Browser\\Application"; this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\BraveSoftware\\Brave-Browser\\Application";
this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"; this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\BraveSoftware\\Brave-Browser\\Application\\brave.exe";
this.defaultUserDataDir = SYS.getEnvString("LOCALAPPDATA") + "\\BraveSoftware\\Brave-Browser\\User Data";
break; break;
case "vivaldi": case "vivaldi":
this.workingDirectory = SYS.getEnvString("LOCALAPPDATA") + "\\Vivaldi\\Application"; this.workingDirectory = SYS.getEnvString("LOCALAPPDATA") + "\\Vivaldi\\Application";
this.binPath = SYS.getEnvString("LOCALAPPDATA") + "\\Vivaldi\\Application\\vivaldi.exe"; this.binPath = SYS.getEnvString("LOCALAPPDATA") + "\\Vivaldi\\Application\\vivaldi.exe";
this.defaultUserDataDir = SYS.getEnvString("LOCALAPPDATA") + "\\Vivaldi\\User Data";
break; break;
} }
@ -1428,7 +1442,9 @@ exports.startDebugInPrivate = function(url, proxy, profileName, debuggingPort, i
; ;
}; };
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.20"; exports.publisherName = publisherName;
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.21";
exports.AUTHOR = "abuse@catswords.net"; exports.AUTHOR = "abuse@catswords.net";
exports.global = global; exports.global = global;
exports.require = global.require; exports.require = global.require;