Skip to content

Commit c8b977a

Browse files
author
Cong Liu
committed
Added --app-path for chromedriver
`--app-path` is used for specifying path of app for nw.js. It's added for chromedriver since chromedriver doesn't allow providing raw arguments to nw.
1 parent d6f18c1 commit c8b977a

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/common/shell_switches.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ const char kNoToolbar[] = "no-toolbar";
3434
// Open specified url
3535
const char kUrl[] = "url";
3636

37+
// Specified app location
38+
const char kAppPath[] = "app-path";
39+
3740
// Set current working directory.
3841
const char kWorkingDirectory[] = "working-directory";
3942

src/common/shell_switches.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ extern const char kContentShellDataPath[];
1818
extern const char kDeveloper[];
1919
extern const char kNoToolbar[];
2020
extern const char kUrl[];
21+
extern const char kAppPath[];
2122
extern const char kWorkingDirectory[];
2223
extern const char kNodeMain[];
2324
extern const char kSnapshot[];

src/nw_package.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,15 @@ Package::Package()
152152
return;
153153

154154
// Then see if we have arguments and extract it.
155-
CommandLine* command_line = CommandLine::ForCurrentProcess();
155+
// check --app-path first
156+
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
157+
if(command_line->HasSwitch(switches::kAppPath)) {
158+
path_ = command_line->GetSwitchValuePath(switches::kAppPath);
159+
}
160+
if (InitFromPath())
161+
return;
162+
163+
// then treat first argument as path
156164
const CommandLine::StringVector& args = command_line->GetArgs();
157165
if (args.size() > 0) {
158166
self_extract_ = false;

0 commit comments

Comments
 (0)