In the configuration reference the comments on server.errorPath state that the errorPath html won't have access to Capacitor Plugins on Android:
|
* On Android the html file won't have access to Capacitor plugins. |
But looking through the code handling the error page it seems to me that it is loaded into the webView just like the actual app page and thus should have access to Capacitor and plugins.
And indeed a short test by setting server.errorPath to error.html (and android.minWebViewVersion too high to trigger the error page) accessing plugins works just fine with this error.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
Device Name: <span id="name"></span>
<script>
Capacitor.Plugins.Device.getInfo().then(info => {
document.querySelector('#name').textContent = info.name;
});
</script>
</body>
</html>
So is this comment deprecated and there are actually no restrictions in the error html?
Or in which conditions does it apply? Only certain error conditions, older devices/webViews, ...?
At least in this case accessing plugins actually does work.
In the configuration reference the comments on
server.errorPathstate that theerrorPathhtml won't have access to Capacitor Plugins on Android:capacitor-docs/docs/main/reference/config.md
Line 684 in 7eed09b
But looking through the code handling the error page it seems to me that it is loaded into the webView just like the actual app page and thus should have access to Capacitor and plugins.
And indeed a short test by setting
server.errorPathtoerror.html(andandroid.minWebViewVersiontoo high to trigger the error page) accessing plugins works just fine with thiserror.html:So is this comment deprecated and there are actually no restrictions in the error html?
Or in which conditions does it apply? Only certain error conditions, older devices/webViews, ...?
At least in this case accessing plugins actually does work.