This API provides information about security context used to access other APIs.
This is a built-in extension and does not require separate installation.
To disable the extension, remove
Boson\WebView\Api\Security\SecurityExtension
from the list of extensions.More information about extensions can be found on the relevant documentation page.
The API is available in the WebView::$security
property.
$app = new Boson\Application(); $app->webview->security; // Access to Security API
Your context will most likely be secure if you don't use the
data:
orabout:
protocol schemes
#Current Context
To get the current security status you can use the read-only
$isSecureContext
property.
$isSecure = $app->webview->security->isSecureContext; echo 'Context is ' . ($isSecure ? 'secure' : 'insecure'); // // Expects: Context is secure //