Skip to content

Commit

Permalink
CefApp.getInstance: Support switch values containing '=' (fixes chrom…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sander van den Berg authored and magreenblatt committed May 22, 2024
1 parent 214b072 commit 38becac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions java/org/cef/handler/CefAppHandlerAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ public void onBeforeCommandLineProcessing(String process_type, CefCommandLine co
case 1: {
// Switches can optionally have a value specified using the '=' delimiter
// (e.g. "-switch=value").
String[] switchVals = arg.substring(switchCnt).split("=");
if (switchVals.length == 2) {
command_line.appendSwitchWithValue(switchVals[0], switchVals[1]);
String switchStr = arg.substring(switchCnt);
int index = switchStr.indexOf('=');
if (index > 0) {
command_line.appendSwitchWithValue(
switchStr.substring(0, index), switchStr.substring(index + 1));
} else {
command_line.appendSwitch(switchVals[0]);
command_line.appendSwitch(switchStr);
}
break;
}
Expand Down

0 comments on commit 38becac

Please sign in to comment.