breautek commented on PR #1574:
URL: https://github.com/apache/cordova-android/pull/1574#issuecomment-1517981134
Alright, had to do some tweaks in cordova-android to test it, but at the
core I think this is good.
I implemented the on hook in `CoreAndroid` and was able to do something like:
```java
@Override
public boolean onRenderProcessGone(final WebView view,
RenderProcessGoneDetail detail) {
if (webView.getEngine().getView() == view) {
// Is the crash view the cordova webview?
LOG.e(TAG, "CORDOVA WEBVIEW CRASHED!");
return true;
}
return false;
}
```
Naturally returning true prevents the app from crashing and actually yields
the webview still visible, but in an unsafe manner. Returning false will crash
the application, assuming nothing else actually handles the webview. To be
clear, I'm not suggesting to implement something like this into this PR, I'm
just using the PR to demonstrate what is possible.
> There may be some plugins that want to listen to every crash (e.g., a
crash report integration plugin of some sort),
I do agree with this sentiment. I see that PluginManager will still call
through all plugins hooks even if a plugin has already return true, so I think
that covers that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]