DataFlex Custom Components for Web APIs.
Contains DataFlex implementations of:
- Battery Status API
- Broadcast Channel API
- Clipboard API
- Contact Picker API
- Credential Management API
- EyeDropper API
- Fullscreen API
- MediaStream Image Capture API
- MediaStream Recording API
- Network Information API
- Notifications API
- Page Visibility API
- Screen Wake Lock API
- Sensor APIs
- Vibration API
- Web Share API
- Web Storage API
Requires a DataFlex 26 installation (which includes the df-cli package manager):
> df-cli package install <your-workspace>.sws Kruse-Net/WebAPIs
This adds the custom components to your workspace, copies the client-side JavaScript to your AppHtml/WebAPIs folder, and injects the required script includes into your Index.html automatically.
Download either the package (WebAPIs-<version>.zip) or the entire demo workspace with prebuilt components (WebAPIsDemo.zip) from the Releases page.
The demo workspace is self-contained: extract the zip and open Demo/WebAPIs Demo.sws.
Clone the source code from GitHub, install NodeJS, and build the client-side JavaScript with
> npm ci
> npm run build
The built bundle is created in AppHtml/WebAPIs. The component classes are the AppSrc/*API.pkg files.
If you use the package manager, the components are available in your workspace and the script includes are injected automatically.
Otherwise, copy AppHtml/WebAPIs and the AppSrc/*API.pkg files to your workspace, and include this line in your Index.html:
<script src="WebAPIs/index.js"></script>
NOTE that some of these APIs require a secure context, which basically means they only work when page is accessed using https, or from localhost! Those APIs are marked with a padlock icon in the demo application.