Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
Remove DeflectorSettings references inside getBrowserArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
spikespaz committed Jul 6, 2020
1 parent 27e5569 commit 5a60da6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/common.d
Original file line number Diff line number Diff line change
Expand Up @@ -330,18 +330,18 @@ string escapeShellArgs(const string[] arguments) {
return commandLine;
}

/// Constructs all browser arguments from a DeflectorSettings object.
string getBrowserArgs() {
/// Constructs browser arguments based on executable name and options provided
string getBrowserArgs(const string browserPath, const bool useProfile, const string profileName) {
string[] browserArgs;

const bool isChrome = DeflectorSettings.browserPath.endsWith("chrome.exe");
const bool isFirefox = DeflectorSettings.browserPath.endsWith("firefox.exe");
const bool isChrome = browserPath.endsWith("chrome.exe");
const bool isFirefox = browserPath.endsWith("firefox.exe");

if (DeflectorSettings.useProfile) {
if (useProfile) {
if (isChrome)
browserArgs ~= "--profile-directory=" ~ escapeShellArg(DeflectorSettings.profileName, false);
browserArgs ~= "--profile-directory=" ~ escapeShellArg(profileName, false);
else if (isFirefox)
browserArgs ~= ["-P", escapeShellArg(DeflectorSettings.profileName, false)];
browserArgs ~= ["-P", escapeShellArg(profileName, false)];
}

return browserArgs.join(' ');
Expand Down

0 comments on commit 5a60da6

Please sign in to comment.