private void Button_Click_1(object sender, RoutedEventArgs e) { var debuggerPort = 9876; var args = " --start-debugger-server " + debuggerPort; var processJob = new ProcessWithJobObject(); process = processJob.StartProc(FirefoxProfilesWorker.FirefoxBinaryFileName, args); }
public static ProcessWithJobObject OpenFirefoxProfileWithJobObject(string key, string addArgs = null) { var args = $@"-marionette -no-remote" + (string.IsNullOrWhiteSpace(key) ? "" : $@" -P ""{key}"""); if (!string.IsNullOrWhiteSpace(addArgs)) { args += " " + addArgs.Trim(); } var processJob = new ProcessWithJobObject(); var process = processJob.StartProc(FirefoxBinaryFileName, args); Thread.Sleep(1000); //// wait for closing previos Firefox //if (process.MainWindowTitle != "" && process.MainWindowTitle != "Mozilla Firefox") //{ // var reader = process.StandardOutput; // var v = reader.ReadToEnd(); //} return(processJob); }