@capgo/capacitor-webview-crash 8.1.6 → 8.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,6 +21,7 @@ public class WebViewCrashPlugin extends Plugin {
|
|
|
21
21
|
private final Set<String> dispatchedPendingEvents = new HashSet<>();
|
|
22
22
|
private WebViewCrash.RestartOptions restartOptions = new WebViewCrash.RestartOptions(true, 0, null, 0);
|
|
23
23
|
private Handler mainHandler;
|
|
24
|
+
private boolean webViewListenerRegistered;
|
|
24
25
|
|
|
25
26
|
private final Runnable periodicRestartRunnable = () -> {
|
|
26
27
|
WebView webView = bridge != null ? bridge.getWebView() : null;
|
|
@@ -57,13 +58,22 @@ public class WebViewCrashPlugin extends Plugin {
|
|
|
57
58
|
@Override
|
|
58
59
|
public void load() {
|
|
59
60
|
restartOptions = implementation.readRestartOptions(getConfig());
|
|
60
|
-
bridge.addWebViewListener(webViewListener);
|
|
61
61
|
schedulePeriodicRestart();
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
@Override
|
|
65
|
+
protected void handleOnStart() {
|
|
66
|
+
super.handleOnStart();
|
|
67
|
+
if (!webViewListenerRegistered) {
|
|
68
|
+
bridge.addWebViewListener(webViewListener);
|
|
69
|
+
webViewListenerRegistered = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
64
73
|
@Override
|
|
65
74
|
protected void handleOnDestroy() {
|
|
66
75
|
bridge.removeWebViewListener(webViewListener);
|
|
76
|
+
webViewListenerRegistered = false;
|
|
67
77
|
cancelPeriodicRestart();
|
|
68
78
|
}
|
|
69
79
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-webview-crash",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.8",
|
|
4
4
|
"description": "Capacitor plugin for detecting WebView crash recovery and restarting long-running WebViews natively.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
"prepublishOnly": "bun run build",
|
|
55
55
|
"check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
|
|
56
56
|
"example:install": "cd example-app && bun install --frozen-lockfile",
|
|
57
|
-
"example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build"
|
|
57
|
+
"example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",
|
|
58
|
+
"changelog:ai": "node scripts/generate-ai-changelog.mjs"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@capacitor/android": "^8.0.0",
|