LoadExtension always calls OnExtensionLoadFailed

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.

LoadExtension always calls OnExtensionLoadFailed

Postby ndesktop » Wed Jun 07, 2023 12:29 pm

Environment: cefclient with --enable-chrome-runtime and --load-extension=<path to disk to existing Chrome extension>
Code: Select all
void CefBrowserContext::LoadExtension(
    const CefString& root_directory,
    CefRefPtr<CefDictionaryValue> manifest,
    CefRefPtr<CefExtensionHandler> handler,
    CefRefPtr<CefRequestContext> loader_context) {
  NOTIMPLEMENTED();
  if (handler) {
    handler->OnExtensionLoadFailed(ERR_ABORTED);
  }
}

It starts with NOTIMPLEMENTED, then calls OnExtensionLoadFailed - although it succeeds.
Is this behavior intentional? Or it might be an artifact from Alloy times :)
ndesktop
Master
 
Posts: 750
Joined: Thu Dec 03, 2015 10:10 am

Re: LoadExtension always calls OnExtensionLoadFailed

Postby magreenblatt » Wed Jun 07, 2023 12:40 pm

The --load-extension flag is supported by Chrome, so the Alloy-specific implementation in cefclient should be disabled. You can add a new issue at https://github.com/chromiumembedded/cef/issues
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: LoadExtension always calls OnExtensionLoadFailed

Postby ndesktop » Wed Jun 07, 2023 12:47 pm

So CefExtensionHandler implementation is unnecessary when --enable-chrome-runtime and --load-extension are present?
Edit: I still see that OnrequestContextInitialized is handling --load-extension and calls extension_util::LoadExtension.
ndesktop
Master
 
Posts: 750
Joined: Thu Dec 03, 2015 10:10 am

Re: LoadExtension always calls OnExtensionLoadFailed

Postby ndesktop » Wed Jun 07, 2023 12:52 pm

magreenblatt wrote:The --load-extension flag is supported by Chrome, so the Alloy-specific implementation in cefclient should be disabled. You can add a new issue at https://github.com/chromiumembedded/cef/issues

So
Code: Select all
if (command_line->HasSwitch(switches::kLoadExtension)) {

changed in
Code: Select all
if (!command_line->HasSwitch(switches::kLoadExtension) && command_line->HasSwitch(switches::kLoadExtension)) {

or something like this would suffice?
ndesktop
Master
 
Posts: 750
Joined: Thu Dec 03, 2015 10:10 am

Re: LoadExtension always calls OnExtensionLoadFailed

Postby magreenblatt » Wed Jun 07, 2023 12:57 pm

Bypass all usage of switches::kLoadExtension in cefclient when UseChromeRuntime() returns true.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: LoadExtension always calls OnExtensionLoadFailed

Postby ndesktop » Mon Jun 12, 2023 3:25 am

Done, filed issue 3529.
ndesktop
Master
 
Posts: 750
Joined: Thu Dec 03, 2015 10:10 am

Re: LoadExtension always calls OnExtensionLoadFailed

Postby magreenblatt » Mon Jun 12, 2023 3:51 am

ndesktop wrote:Done, filed issue 3529.

Thanks.
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] and 31 guests