by fddima » Fri Aug 05, 2016 3:47 am
Hello.
In short - no.
1. Only one CEF library should be loaded in process and initialized once. (Well, actually it maybe work if loaded different libcef versions/instances in sinle process, but i'm think this scenario is not tested at all.)
2. CefGlue: P/Invoke (DllImport parts) resolves module by name, so it should reuse same module handle. So - whack, it will not work.
3. CefGlue: I'm never test it with non-default domains. It should work from any single (non-default) domain.
4. CefGlue: (Not your case) Accessing to same CefGlue assembly from multiple different domains will lead to errors, because i'm hardly rely on static fields. This will lead to some logic errors at all levels (init flags, object marshalling - gc roots & ref counting).
So looks like there is no have chance to get it work with app domains with your requirements.
Possible solutions:
Depending from how deep plugins use browser, you may want unify control interfaces or counterwise left them unique.
1. Integrate CEF into host. Provide single CEF-based control hosted by plugin-host. Single version, classic design. Unified interfaces of course doesnt met your init reqs.
2. Implement out-of-process browser. I.e. plugin creates child process. Child process via IPC interact with plugin, and inserts native browser window by using window reparenting. Plugin simple wraps this. You can unify or leave unique each plugin. Hard way. But it guaranteed to work. There is how i'm make add-id for outlook. Additionally this can help break x86/x64 differences, while out of process browser can be simple x86 and able to run by x86 and x64 process. For outlook case this is also removes any process instability, so plugin does not conflict with anything, does not crash plugin host, and more important (with outlook case - no problems with stealed focus on new popup windows, no need to hook main hwnd (which finally almost impossible in outlook), something else...).
1-st way are easier as for me.
2-nd more reliable, but usually MUST be used if you not own host app.