EdgeZipServer
Library for Delphi to serve static files in Edge (WebView2) browser from files in a zip archive
- Quiet · last change 11-14-2022
- ★ 17 on GitHub
README
EdgeZipServer
What's this
PoC of my way of storing and organizing a static html files in zip archive and displaying it in Delphi application by using the special wrapper TEdgeZipServer over the control TEdgeBrowser.
How it works
Library handles TCustomEdgeBrowser.OnWebResourceRequested request and loads files from ZIP archive you specified.
What's next?
Nothing, it's just proof-of-concept. For building really amazing and advanced html-based UI use the great HTML Component Library.
How to use
- (optional) Make sure your dev environment is ready to use Chromium-based Edge WebView2 browser. Use Embarcadero guide Using TEdgeBrowser Component and Changes to the TWebBrowser Component as a start point.
- Write html-based help and add it to ZIP file. You can use any program like 7-Zip or WinRar. You also can use helper PowerShell script make-archive.ps1 to zip any folder:
PS C:\Projects\EdgeZipServer> .\Tools\make-archive.ps1 -SourceFolder '.\Demos\Docs\Variant 1\' -OutputFileName '.\Demos\Docs\Varian 1.zip'- Link UEdgeBrowserZipServer.pas file in your project and assign class
TEdgeZipServerto anyTEdgeBrowsercontrol:
var zipFile := TZipFile.Create;
zipFile.Open('..\..\..\Docs\Variant 1.zip', TZipMode.zmRead);
edgeServer := TEdgeZipServer.Create(zipFile, EdgeBrowser1, '*://contoso.com/*');
EdgeBrowser1.Navigate('http://contoso.com/');- Copy file WebView2Loader.dll to your exe output folder.
Demos
Check out Demos folder for examples of usage.
Basic Demo
Loading file from zip archive basic example.
Advanced Demo
More advanced example of using TEdgeZipServer class.
LoadFromResource
Example of storing ZIP archive as exe resource and loading data from it.
Used templates
Demo 1.zip
iDocs - one page documentation html template.
Demo 2.zip
Doctemplate - A simple HTML/CSS documentation template.
Demo 3.zip
HelpNDoc - modern help authoring tool with an intuitive user interface.
Demo 4.zip
ReadTheDocs - Downloadable Documentation of online version of ReadTheDocs.
Demo 5.zip
chm-html - Python CHM compiler that outputs an HTML5 powered CHM browser packaged with the CHM's data. Documentation of kbengine as example of CHM help project.
Demo 6.zip
itinerary-html-template - Itinerary HTML template. Example of loading custom data into static HTML content.
Sneak peek


