Cefsharp: Feature Request - Add ability to customise BrowserSubProcess

Created on 28 Jul 2015  路  4Comments  路  Source: cefsharp/CefSharp

So it should be possible for the user to implement their on BrowserSubProcess executable for which they can plugin some custom code.

  • Rename classes so they're standardized
  • Add some interfaces and default implementations with virtual methods so that users can override.

Should be relatively easy and potentially users can then plugin features that have previously been missing by simply contributing a basic wrapper for whatever class has yet to be exposed.

feature-request

Most helpful comment

For those struggling with this, the basic steps would be like

  • Create a console application that will be your sub process.
  • Install CefSharp.Common into your console application through Nuget.
  • Make sure the reference to CefSharp.dll is included
  • Manually Add reference to CefSharp.BrowserSubprocess.Core.dll (will be in the nuget packages folder), or add a reference from your bin folder.
  • Copy the body of the source code from the CefSharp.BrowserSubprocess.Program.cs from the matching file
  • If you are using an x86 version then you should make your console application large address aware, you can use https://github.com/KirillOsenkov/LargeAddressAware
  • Copy your sub process to your main application folder
  • change settings.BrowserSubProcessPath to point to your new exe.

This is a rough list of steps, I haven't tried it lately, you might have to fill in a few missing pieces.

All 4 comments

First steps towards this are complete, CefSharp.BrowserSubProcess.exe is now just a single c# class for which you can basically copy and paste into your own project.

https://github.com/cefsharp/CefSharp/blob/cefsharp/51/CefSharp.BrowserSubprocess/Program.cs#L14

For those of you obsessed with trying to rename CefSharp.BrowserSubProcess.exe, this is a much better way, copy and paste the code, add the references, create your own implementation! Don't forget to set the settings.BrowserSubProcessPath property to point to your new exe.

Will be available in 51.0.0-pre01 and newer

Hi @amaitland
I tried create subProcess follow your guide Program.cs.
But SubProcess does not exist,

For those struggling with this, the basic steps would be like

  • Create a console application that will be your sub process.
  • Install CefSharp.Common into your console application through Nuget.
  • Make sure the reference to CefSharp.dll is included
  • Manually Add reference to CefSharp.BrowserSubprocess.Core.dll (will be in the nuget packages folder), or add a reference from your bin folder.
  • Copy the body of the source code from the CefSharp.BrowserSubprocess.Program.cs from the matching file
  • If you are using an x86 version then you should make your console application large address aware, you can use https://github.com/KirillOsenkov/LargeAddressAware
  • Copy your sub process to your main application folder
  • change settings.BrowserSubProcessPath to point to your new exe.

This is a rough list of steps, I haven't tried it lately, you might have to fill in a few missing pieces.

At this stage there are no further plans to expand the customisation of the subprocess.

Was this page helpful?
0 / 5 - 0 ratings