I am having toubles registering the Extention.
when the page loads it does not find the extention.
i am working with subprocess, and declared the Extention as such:
Code: Select all
procedure GlobalCEFApp_OnWebKitInitialized;
begin
{$IFDEF DELPHI14_UP}
// Registering the extension. Read this document for more details :
// https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md
TCefRTTIExtension.Register(EXTENTION_NAME, TTestExtension);
// if TCefRTTIExtension.Register(EXTENTION_NAME, TTestExtension) then
{$IFDEF DEBUG}CefDebugLog('JavaScript extension registered successfully!'){$ENDIF}
else
{$IFDEF DEBUG}CefDebugLog('compile with Delphi 14 and up.!'){$ENDIF};
{$ENDIF}
end;
procedure CreateGlobalCEFApp;
begin
// In case you prefer to call CreateGlobalCEFApp and DestroyGlobalCEFApp manually
// you have to remember that GlobalCEFApp can only be initialized *ONCE* per process.
// This is a CEF requirement and there's no workaround.
if (GlobalCEFApp <> nil) then
exit;
{$IFDEF CEFSUBPROCESS}
GlobalCEFApp := TCefApplicationCore.Create;
{$ELSE}
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.BrowserSubprocessPath := 'SubProcess.exe';
GlobalCEFApp.OnWebKitInitialized := GlobalCEFApp_OnWebKitInitialized;
{$ENDIF}
GlobalCEFApp.StartMainProcess;
end;
the application is defined as such:
Code: Select all
procedure CreateGlobalCEFApp;
var
flag:boolean;
begin
if Assigned(GlobalCEFApp) then
exit;
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.BrowserSubprocessPath := 'SubProcess.exe';
if GlobalCEFApp.StartMainProcess then begin
GlobalCEFApp.OnWebKitInitialized := GlobalCEFApp_OnWebKitInitialized;
GlobalCEFApp.LogFile := 'debug.log';
GlobalCEFApp.LogSeverity := LOGSEVERITY_WARNING{LOGSEVERITY_VERBOSE};
end;
end;