You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-22 22:17:48 +02:00
bug fix #68
This commit is contained in:
demos
JavaScript
JSEval
JSExecutingFunctions
JSExtension
JSExtensionWithFunction
JSExtensionWithObjectParameter
JSExtensionWithObjectParameter.dprJSExtensionWithObjectParameter.dprojuJSExtensionWithObjectParameter.pas
JSSimpleExtension
JSSimpleWindowBinding
JSWindowBindingWithFunction
JSWindowBindingWithObject
MiniBrowser
source
CEF4Delphi.dpkCEF4Delphi.dprojCEF4Delphi_D7.dpkuCEFApp.pasuCEFApplication.pasuCEFBaseRefCounted.pasuCEFBrowserProcessHandler.pasuCEFDragHandler.pasuCEFFindHandler.pasuCEFInterfaces.pasuCEFMenuModelDelegate.pasuCEFNavigationEntryVisitor.pasuCEFPDFPrintCallback.pasuCEFRenderHandler.pasuCEFRenderProcessHandler.pasuCEFRequestContextHandler.pasuCEFResolveCallback.pasuCEFResourceBundleHandler.pasuCEFResponseFilter.pasuCEFTypes.pas
@ -74,16 +74,44 @@ type
|
||||
var
|
||||
JSExtensionWithFunctionFrm: TJSExtensionWithFunctionFrm;
|
||||
|
||||
procedure GlobalCEFApp_OnWebKitInitializedEvent;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
uses
|
||||
uCEFMiscFunctions, uMyV8Handler;
|
||||
|
||||
// The CEF3 document describing JavaScript integration is here :
|
||||
// https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md
|
||||
|
||||
// The HTML file in this demo has a button that shows the contents of 'test.myfunc()'
|
||||
// which was registered in the GlobalCEFApp.OnWebKitInitialized event.
|
||||
|
||||
procedure GlobalCEFApp_OnWebKitInitializedEvent;
|
||||
var
|
||||
TempExtensionCode : string;
|
||||
TempHandler : ICefv8Handler;
|
||||
begin
|
||||
// This is the JS extension example with a function in the "JavaScript Integration" wiki page at
|
||||
// https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md
|
||||
|
||||
TempExtensionCode := 'var test;' +
|
||||
'if (!test)' +
|
||||
' test = {};' +
|
||||
'(function() {' +
|
||||
' test.myfunc = function() {' +
|
||||
' native function myfunc();' +
|
||||
' return myfunc();' +
|
||||
' };' +
|
||||
'})();';
|
||||
|
||||
TempHandler := TMyV8Handler.Create;
|
||||
|
||||
CefRegisterExtension('v8/test', TempExtensionCode, TempHandler);
|
||||
end;
|
||||
|
||||
procedure TJSExtensionWithFunctionFrm.GoBtnClick(Sender: TObject);
|
||||
begin
|
||||
Chromium1.LoadURL(Edit1.Text);
|
||||
|
Reference in New Issue
Block a user