Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
Ref: https://github.com/salvadordf/CEF4Delphi/issues/461
The issue at hand is I've copied all the CEF related code into the MiniBrowser demo, and I can't reproduce the issue there.
I am at a loss as to what I could do on my end to cause the verbose logs to log:
[ERROR:CONSOLE(1)] "Uncaught (in promise) TypeError: Invalid resource type name "undefined"", source: devtools://devtools/panels/sources/sources.js (1)
On right click of the "i" icon. Also, why would this work if I enable the remote debugging port and launch a browser but not if I internally call ShowDevTools?
Currently using 111.0.5563.148.
Do you know where the dev tools sources are located? I ponder unpacking/repacking the resource, such that I could inject the non-minified versions so I could get a meaningful line number that might point me in a more productive direction.
The issue at hand is I've copied all the CEF related code into the MiniBrowser demo, and I can't reproduce the issue there.
I am at a loss as to what I could do on my end to cause the verbose logs to log:
[ERROR:CONSOLE(1)] "Uncaught (in promise) TypeError: Invalid resource type name "undefined"", source: devtools://devtools/panels/sources/sources.js (1)
On right click of the "i" icon. Also, why would this work if I enable the remote debugging port and launch a browser but not if I internally call ShowDevTools?
Currently using 111.0.5563.148.
Do you know where the dev tools sources are located? I ponder unpacking/repacking the resource, such that I could inject the non-minified versions so I could get a meaningful line number that might point me in a more productive direction.
- salvadordf
- Posts: 4304
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
Hi,
Perhaps some file from the CEF binaries is missing. Please, check that you see these files (except MiniBrowser.exe) :
The "locales" directory should have 55 PAK files with language codes as names.
If you use a custom directory for the CEF binaries then check that the application sets these properties correctly :
Perhaps some file from the CEF binaries is missing. Please, check that you see these files (except MiniBrowser.exe) :
The "locales" directory should have 55 PAK files with language codes as names.
If you use a custom directory for the CEF binaries then check that the application sets these properties correctly :
- GlobalCEFApp.FrameworkDirPath
- GlobalCEFApp.ResourcesDirPath
- GlobalCEFApp.LocalesDirPath
Re: DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
I've pushed CEF to a cef sub folder, and in this case it's an exact copy and paste of my applications cef folder. I've also limited the locales to just one, but I have accounted for all this in the initialization.
Re: DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
After further review, it isn't the right click on the Object that is broken, but rather the entire sources tab is dead. And every time one right clicks on an object in the console, something is trying to interact w/ the sources tab.
Re: DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
Now I fee like an idiot. There was something wrong w/ my cache directory that was causing the problem. I renamed it so CEF created a new one, and now all is well.
Re: DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
Ok, now for more feedback:
https://github.com/salvadordf/CEF4Delphi/issues/234
In the use case of
CEF doesn't call OleUnintialize before creating
in
Which exhibits the same error as https://magpcss.org/ceforum/viewtopic.php?f=6&t=15526
Since CEF4DelphiVCLRTL.bpl depends on the RTL, which uses Vcl.Controls, the VCL inheriently spins up a TApplication, which calls OleInitialize.
https://github.com/salvadordf/CEF4Delphi/issues/234
In the use case of
Code: Select all
GlobalCEFApp.SingleProcess := False;
GlobalCEFApp.BrowserSubprocessPath := 'SomeOther.exe';
Code: Select all
TempApp := TCustomCefApp.Create(self);
Code: Select all
function TCefApplicationCore.MultiExeProcessing : boolean;
Since CEF4DelphiVCLRTL.bpl depends on the RTL, which uses Vcl.Controls, the VCL inheriently spins up a TApplication, which calls OleInitialize.
- salvadordf
- Posts: 4304
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
Sorry for not answering all your issues sooner but I'm very busy these days.
I don't have much time right now to investigate your last message but it might be related to this old issue :
https://github.com/salvadordf/CEF4Delphi/issues/139
I don't have much time right now to investigate your last message but it might be related to this old issue :
https://github.com/salvadordf/CEF4Delphi/issues/139
Re: DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
The fix was to change the sub process to not reference uCEFApplication, and instead substitute uCEFApplicationCore / TCefApplicationCore.
No rush, I just went deep into the weeds and wanted to provide the feedback.
Would it be valid to ...
add this
That would allow for users who initialized a TCefApplication in the subprocess to presumeably inherit all the oter fixes that are in StartSubProcess.
No rush, I just went deep into the weeds and wanted to provide the feedback.
Would it be valid to ...
Code: Select all
function TCefApplicationCore.StartSubProcess : boolean;
var
TempApp : ICefApp;
begin
Result := False;
TempApp := nil;
try
try
if not(FSingleProcess) and
(ProcessType <> ptBrowser) and
LoadCEFlibrary then
begin
add this
Code: Select all
if (FProcessType <> ptBrowser) then
BeforeInitSubProcess;
Code: Select all
TempApp := TCustomCefApp.Create(self);
if (ExecuteProcess(TempApp) >= 0) then
Result := True
else
TempApp.RemoveReferences;
end;
except
on e : exception do
if CustomExceptionHandler('TCefApplicationCore.StartSubProcess', e) then raise;
end;
finally
TempApp := nil;
end;
end;
That would allow for users who initialized a TCefApplication in the subprocess to presumeably inherit all the oter fixes that are in StartSubProcess.
- salvadordf
- Posts: 4304
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: DevTools: Console Object Copy to Clipboard is disabled (due to unhandled exception)
The GlobalCEFApp.OnBrowserCreated event can be used to pass custom data from the main process to the render processes in the "extra_info" parameter.
You can also use a common unit to set the GlobalCEFApp properties between all the Chromium processes and you can send messages between the processes with custom information.
Additionally you can use databases, websockets or any other way to send information or IPC messages between the processes.
...or you can add your custom modifications to the CEF4Delphi code. This is an open source project!
You can also use a common unit to set the GlobalCEFApp properties between all the Chromium processes and you can send messages between the processes with custom information.
Additionally you can use databases, websockets or any other way to send information or IPC messages between the processes.
...or you can add your custom modifications to the CEF4Delphi code. This is an open source project!