Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Add ability to customise BrowserSubProcess #1149

Closed
amaitland opened this issue Jul 28, 2015 · 6 comments
Closed

Feature Request - Add ability to customise BrowserSubProcess #1149

amaitland opened this issue Jul 28, 2015 · 6 comments
Milestone

Comments

@amaitland
Copy link
Member

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.

@amaitland amaitland added this to the 3000 milestone Jul 28, 2015
@amaitland amaitland changed the title Add ability to customise BrowserSubProcess Feature Request - Add ability to customise BrowserSubProcess Nov 19, 2015
@amaitland
Copy link
Member Author

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

@giangcoi48k
Copy link

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

@amaitland
Copy link
Member Author

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.

@amaitland
Copy link
Member Author

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

@SiriusED
Copy link

SiriusED commented Jan 15, 2022

Can't make it to work, something changed I assume or something... But when I put everything according this guide my console application just crashes or says "Could not load file or assembly 'CefSharp.BrowserSubprocess.Core"

Could someone share an example c# project with working code that renames and successfully runs CefSharp
BrowserSubprocess
?

@amaitland
Copy link
Member Author

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

No branches or pull requests

3 participants