Clarify limitations of Capacitor plugins in webView error html
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- android
- Domain
- documentation, mobile-dev
Research direction
Start with docs/main/reference/config.md at the server.errorPath comment and inspect the error-page handling code referenced by the issue. Reproduce the case using errorPath and a high android.minWebViewVersion, then check plugin access under the relevant error conditions. Done means the configuration comment accurately states when Capacitor plugins are or are not available.
Written by the indexing model from the issue text.
Description
In the configuration reference the comments on server.errorPath state that the errorPath html won't have access to Capacitor Plugins on Android:
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.
- Dominant language
- MDX
- Stars
- 48
- Forks
- 794
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ionic-team/capacitor-docs
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
ionic-team/capacitor-docs#551 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
ionic-team/capacitor-docs#550 ·
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ionic-team/capacitor-docs#544 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
ionic-team/capacitor-docs#403 ·
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 65/100
ionic-team/capacitor-docs#337 ·
All issues in ionic-team/capacitor-docs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BasedHardware/omi#15662 · 1 comment ·
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#167 ·
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·