@capgo/capacitor-updater 8.50.2 → 8.51.0

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.
@@ -86,6 +86,10 @@ final class WebViewStatsReporter {
86
86
  }
87
87
  writeSession(true);
88
88
  setInterval(function(){writeSession(true);},15000);
89
+ function pageDuration(){
90
+ var started=Number(window.__capgoWebViewSessionStartedAt||Date.now());
91
+ return String(Math.max(0,Date.now()-started));
92
+ }
89
93
  function markClean(){writeSession(false);}
90
94
  window.addEventListener('pagehide',markClean,true);
91
95
  window.addEventListener('beforeunload',markClean,true);
@@ -120,6 +124,22 @@ final class WebViewStatsReporter {
120
124
  source:s(event&&event.blockedURI)
121
125
  });
122
126
  },true);
127
+ document.addEventListener('DOMContentLoaded',function(){
128
+ send({
129
+ type:'webview_dom_content_loaded',
130
+ message:'WebView DOM content loaded',
131
+ duration_ms:pageDuration(),
132
+ page_started_at:String(window.__capgoWebViewSessionStartedAt)
133
+ });
134
+ },true);
135
+ window.addEventListener('load',function(){
136
+ send({
137
+ type:'webview_page_loaded',
138
+ message:'WebView page loaded',
139
+ duration_ms:pageDuration(),
140
+ page_started_at:String(window.__capgoWebViewSessionStartedAt)
141
+ });
142
+ },true);
123
143
  document.addEventListener('deviceready',scheduleFlush,false);
124
144
  setTimeout(scheduleFlush,0);
125
145
  })();
@@ -164,6 +184,8 @@ final class WebViewStatsReporter {
164
184
  "href": call.getString("href"),
165
185
  "user_agent": call.getString("user_agent"),
166
186
  "session_id": call.getString("session_id"),
187
+ "duration_ms": call.getString("duration_ms"),
188
+ "page_started_at": call.getString("page_started_at"),
167
189
  "previous_session_id": call.getString("previous_session_id"),
168
190
  "previous_href": call.getString("previous_href"),
169
191
  "previous_started_at": call.getString("previous_started_at"),
@@ -187,6 +209,10 @@ final class WebViewStatsReporter {
187
209
  return "webview_render_process_gone"
188
210
  case "web_content_process_terminated":
189
211
  return "webview_content_process_terminated"
212
+ case "webview_dom_content_loaded":
213
+ return "webview_dom_content_loaded"
214
+ case "webview_page_loaded":
215
+ return "webview_page_loaded"
190
216
  case "javascript_error":
191
217
  return "webview_javascript_error"
192
218
  default:
@@ -206,6 +232,8 @@ final class WebViewStatsReporter {
206
232
  put(&metadata, key: "href", value: sanitizeUrl(payloadValue(values, "href")), maxLength: 512)
207
233
  put(&metadata, key: "user_agent", value: payloadValue(values, "user_agent"), maxLength: 256)
208
234
  put(&metadata, key: "session_id", value: payloadValue(values, "session_id"), maxLength: 128)
235
+ put(&metadata, key: "duration_ms", value: payloadValue(values, "duration_ms"), maxLength: 32)
236
+ put(&metadata, key: "page_started_at", value: payloadValue(values, "page_started_at"), maxLength: 64)
209
237
  put(&metadata, key: "previous_session_id", value: payloadValue(values, "previous_session_id"), maxLength: 128)
210
238
  put(&metadata, key: "previous_href", value: sanitizeUrl(payloadValue(values, "previous_href")), maxLength: 512)
211
239
  put(&metadata, key: "previous_started_at", value: payloadValue(values, "previous_started_at"), maxLength: 64)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "8.50.2",
3
+ "version": "8.51.0",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",
@@ -74,7 +74,11 @@
74
74
  "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
75
75
  "changelog:ai": "node scripts/generate-ai-changelog.mjs",
76
76
  "example:install": "cd example-app && bun install --frozen-lockfile",
77
- "example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build"
77
+ "example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",
78
+ "native:contract:crypto": "bun run native:contract:crypto:ios && bun run native:contract:crypto:android",
79
+ "native:contract:crypto:ios": "./scripts/test-ios.sh -only-testing:CapacitorUpdaterPluginTests/RsaContractTests",
80
+ "native:contract:crypto:android": "cd android && ./gradlew testDebugUnitTest --tests ee.forgr.capacitor_updater.RsaContractTest && cd ..",
81
+ "generate:rsa-contract": "bun scripts/generate-rsa-contract-fixtures.mjs"
78
82
  },
79
83
  "devDependencies": {
80
84
  "@capacitor/android": "^8.0.0",