You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[webview_flutter] Catch and handle all HTTP errors codes (eg 404) to redirect to a custom error page #39502
Based on your proposal for an onPageError property, it seems you're looking for a way to intercept HTTP status error codes. Considering the functionality of onWebResourceError, it appears that this property might already serve the purpose you're intending with onPageError.
The onWebResourceError property in the webview_flutter plugin provides a mechanism to handle web resource loading errors. When a web resource fails to load, it triggers this event with a WebResourceError object. This object includes details about the error, such as its description, raw code, and type, which can be used to understand and handle the error effectively. It also indicates whether the error originated from the main frame. It is particularly useful when you want to handle and recover from specific types of web resource errors, or when you need to communicate loading issues to the users.
Could you confirm if this meets your requirements? If not, could you please provide more details about the specific functionality you're seeking with onPageError?
The onWebResourceError property in the webview_flutter plugin does not catch 404 errors. Thus it seems that the need for an onPageError property is very relevant. Please consider implement the suggested feature in the near future, to the benefit of all that have chosen to utilize this otherwise fine plugin.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
paulobreim commentedon Mar 23, 2020
it is very important
sbd2015 commentedon Sep 14, 2021
Do we have any updates on this?
pushparajbhatta commentedon Dec 24, 2021
Is there any update on this ?
Stitch-Taotao commentedon Jan 20, 2022
This is very very important feauture!
andreisas06 commentedon Jun 7, 2023
Hey @majicomajico,
Based on your proposal for an onPageError property, it seems you're looking for a way to intercept HTTP status error codes. Considering the functionality of onWebResourceError, it appears that this property might already serve the purpose you're intending with onPageError.
The onWebResourceError property in the webview_flutter plugin provides a mechanism to handle web resource loading errors. When a web resource fails to load, it triggers this event with a WebResourceError object. This object includes details about the error, such as its description, raw code, and type, which can be used to understand and handle the error effectively. It also indicates whether the error originated from the main frame. It is particularly useful when you want to handle and recover from specific types of web resource errors, or when you need to communicate loading issues to the users.
Could you confirm if this meets your requirements? If not, could you please provide more details about the specific functionality you're seeking with onPageError?
dinbtechit commentedon Nov 20, 2023
This is a much need feature!!!!!
ClubAce commentedon Dec 8, 2023
The onWebResourceError property in the webview_flutter plugin does not catch 404 errors. Thus it seems that the need for an onPageError property is very relevant. Please consider implement the suggested feature in the near future, to the benefit of all that have chosen to utilize this otherwise fine plugin.
bakatsuyuki commentedon Dec 18, 2023
I have one solution to this problem.
We could use
http.getto check the status code like this:Of course, I also want to use a new property like
onPageError, but currently, we could solve it with this solution.[webview_flutter_android][webview_flutter_wkwebview] Adds platform im…
[webview_flutter] Adds onHttpError callback to NavigationDelegate to …
github-actions commentedon Jun 7, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[webview_flutter] Adds onHttpError callback to NavigationDelegate to …
[webview_flutter] Adds onHttpError callback to NavigationDelegate to …