mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-02-02 10:25:26 +02:00
SchemeRegistrationBrowser demo improvements
- Added a local JavaScript file to show an alert dialog - Added more comments to the demo.
This commit is contained in:
parent
59f3441b1e
commit
2173c94bf0
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html><head><script type="text/javascript" src="/test.js" charset="utf-8"></script></head>
|
||||
<body>
|
||||
|
||||
<p>
<img src='emoji.png'><br>Local image</p>
|
||||
@ -13,6 +13,9 @@ Local SWF file.<br>
|
||||
You need to install the Adobe Flash PPAPI plugin to view the SWF file.</p>
|
||||
|
||||
|
||||
<p><button onclick="myAlertFunction()">Click me</button>
|
||||
</p>
|
||||
|
||||
<p><img src='jupiter.png'><br>Bigger image</p>
|
||||
|
||||
</body>
|
||||
|
5
bin/test.js
Normal file
5
bin/test.js
Normal file
@ -0,0 +1,5 @@
|
||||
function myAlertFunction() {
|
||||
|
||||
alert('This alert dialog is declared in a local JS file.');
|
||||
|
||||
}
|
@ -119,6 +119,17 @@ implementation
|
||||
uses
|
||||
uCEFSchemeHandlerFactory, uCEFMiscFunctions, uHelloScheme;
|
||||
|
||||
// This demo shows how to register a custom 'hello' scheme.
|
||||
|
||||
// To register the scheme we use a resource handler in uHelloScheme.pas that inherits from TCefResourceHandlerOwn
|
||||
// You can register the scheme in TForm.OnCreate or later.
|
||||
|
||||
// IMPORTANT : If you notice that some functionality is missing in your application and the debug.log file shows
|
||||
// weird warnings then register the 'http' or 'https' schemes instead of creating a custom scheme.
|
||||
|
||||
// For more information about the resource handler read this page :
|
||||
// https://magpcss.org/ceforum/apidocs3/projects/(default)/CefResourceHandler.html
|
||||
|
||||
// Destruction steps
|
||||
// =================
|
||||
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
|
||||
@ -134,6 +145,9 @@ procedure CreateGlobalCEFApp;
|
||||
begin
|
||||
GlobalCEFApp := TCefApplication.Create;
|
||||
GlobalCEFApp.OnRegCustomSchemes := GlobalCEFApp_OnRegCustomSchemes;
|
||||
|
||||
// GlobalCEFApp.LogFile := 'debug.log';
|
||||
// GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
|
||||
end;
|
||||
|
||||
procedure TSchemeRegistrationBrowserFrm.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||
|
@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 8,
|
||||
"InternalVersion" : 9,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "74.1.16.0"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user