cefclient - overwrite commandline

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

cefclient - overwrite commandline

Postby TaurusPrime » Wed Sep 28, 2022 4:28 am

Hi,

I need to overwrite the full commandline with own arguments. Can you give me an example?

if i change this (original provided sample cefclient_win.cc)
Code: Select all
  // Parse command-line arguments.
  CefRefPtr<CefCommandLine> command_line = CefCommandLine::CreateCommandLine();
  command_line->InitFromString(::GetCommandLineW());

to

command_line->InitFromString("--user-agent=test");

its not working. If i do it per shortcut, its working.

Thanks!
C++ Beginner, but experienced web dev (PHP, JS). I managed to do a lot of stuff with cef, but still need help.

Win 10 x64, Latest CMake + Visual Studio 2022 C++, modding cefsimple, using latest cef x64 Release
TaurusPrime
Techie
 
Posts: 23
Joined: Mon Jul 11, 2022 8:00 am

Re: cefclient - overwrite commandline

Postby magreenblatt » Wed Sep 28, 2022 9:36 am

magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot], yutou15 and 43 guests