Skip to content

developer question: How can I pass a new command line switch from electron to libchromiumcontent? #2026

Closed

Description

@frankhale

I've patched libchromiumcontent and added a new command line switch to trigger my custom code. I've also added this command line switch to Electron and have tried to pass it along using command_line->AppendSwitchASCII within Electron's native_window.cc AppendExtraCommandLineSwitches function. However, libchromiumcontent isn't seeing this switch when I call base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII().

Am I on the right track? I'll keep digging...

Activity

  1. frankhale commented on Jun 21, 2015

    @frankhale
    ContributorAuthor

    One issue I just noticed is that I don't seem to have to add my new option to option_switches.h / .cc in Electron if I've already added it to libchromiumcontent.

  2. frankhale commented on Jun 22, 2015

    @frankhale
    ContributorAuthor

    Actually what I am doing is kind of working. LOL! It looks like when I call base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII() in libchromiumcontent I don't always get the value. I sometimes get it. Process related? I need to dig in and see what other functions base::CommandLine offers for getting command line switches.

  3. frankhale commented on Jun 22, 2015

    @frankhale
    ContributorAuthor

    command_line->AppendSwitchBLAH and base::CommandLine::ForCurrentProcess()->GetSwitchBLAH is how you are supposed to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions