@capgo/capacitor-webview-version-checker 8.2.8 → 8.2.10

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.
@@ -4,9 +4,9 @@ import org.json.JSONObject;
4
4
 
5
5
  final class GeneratedVersionShareData {
6
6
 
7
- private static final String GENERATED_AT = "2026-07-02T13:02:16.965Z";
7
+ private static final String GENERATED_AT = "2026-08-16T12:08:18.255Z";
8
8
  private static final String DATA_SOURCE = "generatedVersionShareByMajor";
9
- private static final String JSON_DATA = "{\"4\":0.000031,\"39\":0.08685,\"40\":0.08685,\"41\":0.08685,\"42\":0.08685,\"43\":0.08685,\"44\":0.08685,\"45\":0.091675,\"46\":0.08685,\"47\":0.08685,\"48\":0.091675,\"49\":0.091675,\"50\":0.08685,\"51\":0.08685,\"52\":0.091675,\"53\":0.08685,\"54\":0.08685,\"55\":0.08685,\"56\":0.08685,\"57\":0.08685,\"58\":0.08685,\"59\":0.08685,\"60\":0.08685,\"66\":0.004825,\"69\":0.004825,\"70\":0.024125,\"79\":0.02895,\"86\":0.004825,\"87\":0.014475,\"91\":0.00965,\"93\":0.014475,\"96\":0.004825,\"97\":0.004825,\"98\":0.02895,\"99\":0.014475,\"100\":0.00965,\"101\":0.00965,\"102\":0.004825,\"103\":0.303975,\"104\":0.2509,\"105\":0.236425,\"106\":0.236425,\"107\":0.236425,\"108\":0.246075,\"109\":0.7334,\"110\":0.24125,\"111\":0.2895,\"112\":0.902275,\"114\":0.024125,\"115\":0.00965,\"116\":0.516275,\"117\":0.284675,\"118\":1.1773,\"119\":0.02895,\"120\":0.294325,\"121\":0.024125,\"122\":0.033775,\"123\":0.033775,\"124\":0.27985,\"125\":0.5211,\"126\":0.0386,\"127\":0.0193,\"128\":0.053075,\"129\":0.0193,\"130\":0.062725,\"131\":0.564525,\"132\":0.04825,\"133\":0.516275,\"134\":0.04825,\"135\":0.0386,\"136\":0.043425,\"137\":0.082025,\"138\":0.159225,\"139\":0.101325,\"140\":0.0772,\"141\":0.0579,\"142\":0.902275,\"143\":0.110975,\"144\":0.29915,\"145\":0.863675,\"146\":0.583825,\"147\":6.10362,\"148\":8.41963,\"149\":42.196,\"150\":0.00965}";
9
+ private static final String JSON_DATA = "{\"4\":0.000003,\"39\":0.02296,\"40\":0.02296,\"41\":0.02296,\"42\":0.02296,\"43\":0.02296,\"44\":0.02296,\"45\":0.02296,\"46\":0.02296,\"47\":0.02296,\"48\":0.027552,\"49\":0.027552,\"50\":0.02296,\"51\":0.02296,\"52\":0.027552,\"53\":0.02296,\"54\":0.02296,\"55\":0.02296,\"56\":0.02296,\"57\":0.02296,\"58\":0.02296,\"59\":0.02296,\"60\":0.02296,\"69\":0.009184,\"70\":0.06888,\"79\":0.018368,\"86\":0.004592,\"87\":0.02296,\"91\":0.009184,\"93\":0.009184,\"97\":0.004592,\"98\":0.02296,\"99\":0.004592,\"101\":0.009184,\"102\":0.009184,\"103\":0.146944,\"104\":0.087248,\"105\":0.087248,\"106\":0.09184,\"107\":0.09184,\"108\":0.096432,\"109\":0.583184,\"110\":0.09184,\"111\":0.101024,\"112\":0.09184,\"114\":0.018368,\"115\":0.009184,\"116\":0.20664,\"117\":0.09184,\"118\":0.211232,\"119\":0.36736,\"120\":0.509712,\"121\":0.013776,\"122\":0.036736,\"123\":0.018368,\"124\":0.174496,\"125\":0.087248,\"126\":0.036736,\"127\":0.013776,\"128\":0.064288,\"129\":0.013776,\"130\":0.027552,\"131\":0.270928,\"132\":0.073472,\"133\":0.211232,\"134\":0.04592,\"135\":0.036736,\"136\":0.247968,\"137\":0.073472,\"138\":0.123984,\"139\":0.188272,\"140\":0.036736,\"141\":0.04592,\"142\":0.257152,\"143\":0.073472,\"144\":0.101024,\"145\":0.904624,\"146\":0.110208,\"147\":0.220416,\"148\":0.716352,\"149\":5.04202,\"150\":9.15645,\"151\":46.3251,\"152\":0.009184}";
10
10
 
11
11
  private GeneratedVersionShareData() {}
12
12
 
@@ -6,6 +6,90 @@ import java.util.List;
6
6
 
7
7
  final class WebviewVersionChecker {
8
8
 
9
+ static final class CompatibilityEvaluation {
10
+
11
+ final String state;
12
+ final boolean isLatest;
13
+ final String reason;
14
+
15
+ CompatibilityEvaluation(String state, boolean isLatest, String reason) {
16
+ this.state = state;
17
+ this.isLatest = isLatest;
18
+ this.reason = reason;
19
+ }
20
+ }
21
+
22
+ @Nullable
23
+ CompatibilityEvaluation evaluateCompatibility(
24
+ @Nullable String currentVersionName,
25
+ @Nullable Integer currentMajorVersion,
26
+ @Nullable String latestVersion,
27
+ @Nullable Integer minimumMajorVersion,
28
+ @Nullable Double minimumDeviceSharePercent,
29
+ @Nullable Double currentVersionSharePercent
30
+ ) {
31
+ if (minimumMajorVersion != null && currentMajorVersion != null && currentMajorVersion < minimumMajorVersion) {
32
+ return new CompatibilityEvaluation(
33
+ "outdated",
34
+ false,
35
+ "Installed WebView major version is below the configured minimum major version."
36
+ );
37
+ }
38
+
39
+ if (minimumDeviceSharePercent != null && currentMajorVersion != null && currentVersionSharePercent != null) {
40
+ boolean isLatest = currentVersionSharePercent >= minimumDeviceSharePercent;
41
+ return new CompatibilityEvaluation(
42
+ isLatest ? "latest" : "outdated",
43
+ isLatest,
44
+ isLatest
45
+ ? "Installed WebView major version satisfies the configured minimum device-share threshold."
46
+ : "Installed WebView major version is below the configured minimum device-share threshold."
47
+ );
48
+ }
49
+
50
+ if (currentVersionName != null && !currentVersionName.isEmpty() && latestVersion != null && !latestVersion.isEmpty()) {
51
+ int cmp = compareVersions(currentVersionName, latestVersion);
52
+ boolean isLatest = cmp >= 0;
53
+ return new CompatibilityEvaluation(
54
+ isLatest ? "latest" : "outdated",
55
+ isLatest,
56
+ isLatest
57
+ ? "Installed WebView version is at or above the latest resolved version."
58
+ : "Installed WebView version is behind the latest resolved version."
59
+ );
60
+ }
61
+
62
+ if (minimumMajorVersion != null && currentMajorVersion != null) {
63
+ boolean isLatest = currentMajorVersion >= minimumMajorVersion;
64
+ return new CompatibilityEvaluation(
65
+ isLatest ? "latest" : "outdated",
66
+ isLatest,
67
+ isLatest
68
+ ? "Installed WebView major version satisfies the minimum configured major version."
69
+ : "Installed WebView major version is below the configured minimum major version."
70
+ );
71
+ }
72
+
73
+ return null;
74
+ }
75
+
76
+ boolean shouldResolveLatestVersion(
77
+ @Nullable Integer currentMajorVersion,
78
+ @Nullable Integer minimumMajorVersion,
79
+ @Nullable Double minimumDeviceSharePercent,
80
+ @Nullable Double currentVersionSharePercent
81
+ ) {
82
+ if (minimumMajorVersion != null && currentMajorVersion != null && currentMajorVersion < minimumMajorVersion) {
83
+ return false;
84
+ }
85
+
86
+ if (minimumDeviceSharePercent != null && currentMajorVersion != null && currentVersionSharePercent != null) {
87
+ return false;
88
+ }
89
+
90
+ return true;
91
+ }
92
+
9
93
  @Nullable
10
94
  Integer parseMajorVersion(@Nullable String version) {
11
95
  if (version == null || version.isEmpty()) {
@@ -208,6 +208,7 @@ public class WebviewVersionCheckerPlugin extends Plugin {
208
208
  }
209
209
 
210
210
  String deviceShareErrorMessage = null;
211
+ Double currentVersionSharePercent = null;
211
212
  if (options.minimumDeviceSharePercent != null) {
212
213
  status.put("minimumDeviceSharePercent", options.minimumDeviceSharePercent);
213
214
  if (currentMajorVersion == null) {
@@ -219,22 +220,10 @@ public class WebviewVersionCheckerPlugin extends Plugin {
219
220
  status.put("versionShareSource", versionShareResolution.source);
220
221
  }
221
222
 
222
- Double currentVersionSharePercent = readShareForMajor(versionShareResolution.shareByMajor, currentMajorVersion);
223
+ currentVersionSharePercent = readShareForMajor(versionShareResolution.shareByMajor, currentMajorVersion);
223
224
  if (currentVersionSharePercent != null) {
224
225
  status.put("currentVersionSharePercent", currentVersionSharePercent);
225
- boolean isLatest = currentVersionSharePercent >= options.minimumDeviceSharePercent;
226
- status.put("state", isLatest ? "latest" : "outdated");
227
- status.put("isLatest", isLatest);
228
- status.put(
229
- "reason",
230
- isLatest
231
- ? "Installed WebView major version satisfies the configured minimum device-share threshold."
232
- : "Installed WebView major version is below the configured minimum device-share threshold."
233
- );
234
- return status;
235
- }
236
-
237
- if (!isBlank(versionShareResolution.errorMessage)) {
226
+ } else if (!isBlank(versionShareResolution.errorMessage)) {
238
227
  deviceShareErrorMessage = versionShareResolution.errorMessage;
239
228
  } else {
240
229
  deviceShareErrorMessage =
@@ -246,41 +235,45 @@ public class WebviewVersionCheckerPlugin extends Plugin {
246
235
  }
247
236
  }
248
237
 
249
- LatestVersionResolution latestResolution = resolveLatestVersion(options);
250
- String latestVersion = latestResolution.version;
238
+ LatestVersionResolution latestResolution = new LatestVersionResolution(null, null);
239
+ String latestVersion = isBlank(options.latestVersion) ? null : options.latestVersion;
251
240
  if (!isBlank(latestVersion)) {
252
241
  status.put("latestVersion", latestVersion);
253
242
  Integer latestMajorVersion = versionChecker.parseMajorVersion(latestVersion);
254
243
  if (latestMajorVersion != null) {
255
244
  status.put("latestMajorVersion", latestMajorVersion);
256
245
  }
246
+ } else if (
247
+ versionChecker.shouldResolveLatestVersion(
248
+ currentMajorVersion,
249
+ options.minimumMajorVersion,
250
+ options.minimumDeviceSharePercent,
251
+ currentVersionSharePercent
252
+ )
253
+ ) {
254
+ latestResolution = resolveLatestVersion(options);
255
+ latestVersion = latestResolution.version;
256
+ if (!isBlank(latestVersion)) {
257
+ status.put("latestVersion", latestVersion);
258
+ Integer latestMajorVersion = versionChecker.parseMajorVersion(latestVersion);
259
+ if (latestMajorVersion != null) {
260
+ status.put("latestMajorVersion", latestMajorVersion);
261
+ }
262
+ }
257
263
  }
258
264
 
259
- if (!isBlank(latestVersion)) {
260
- int cmp = versionChecker.compareVersions(current.versionName, latestVersion);
261
- boolean isLatest = cmp >= 0;
262
- status.put("state", isLatest ? "latest" : "outdated");
263
- status.put("isLatest", isLatest);
264
- status.put(
265
- "reason",
266
- isLatest
267
- ? "Installed WebView version is at or above the latest resolved version."
268
- : "Installed WebView version is behind the latest resolved version."
269
- );
270
- return status;
271
- }
272
-
273
- Integer minimumMajorVersion = options.minimumMajorVersion;
274
- if (minimumMajorVersion != null && currentMajorVersion != null) {
275
- boolean isLatest = currentMajorVersion >= minimumMajorVersion;
276
- status.put("state", isLatest ? "latest" : "outdated");
277
- status.put("isLatest", isLatest);
278
- status.put(
279
- "reason",
280
- isLatest
281
- ? "Installed WebView major version satisfies the minimum configured major version."
282
- : "Installed WebView major version is below the configured minimum major version."
283
- );
265
+ WebviewVersionChecker.CompatibilityEvaluation evaluation = versionChecker.evaluateCompatibility(
266
+ current.versionName,
267
+ currentMajorVersion,
268
+ latestVersion,
269
+ options.minimumMajorVersion,
270
+ options.minimumDeviceSharePercent,
271
+ currentVersionSharePercent
272
+ );
273
+ if (evaluation != null) {
274
+ status.put("state", evaluation.state);
275
+ status.put("isLatest", evaluation.isLatest);
276
+ status.put("reason", evaluation.reason);
284
277
  return status;
285
278
  }
286
279
 
@@ -69,8 +69,17 @@ export interface WebviewVersionCheckerConfig {
69
69
  */
70
70
  latestVersion?: string;
71
71
  /**
72
- * Fallback minimum allowed major version for Android WebView checks.
73
- * Used when `latestVersion` cannot be resolved.
72
+ * Minimum allowed major version for Android WebView and web checks.
73
+ *
74
+ * On the web, this applies to the browser-engine major version detected from
75
+ * the user agent and enforces the same strict lower bound.
76
+ *
77
+ * When set, this is always enforced as a strict lower bound: an installed major version
78
+ * below this value is reported as `outdated`, even when device-share or `latestVersion`
79
+ * checks would otherwise pass.
80
+ *
81
+ * When `latestVersion` cannot be resolved and device-share data is unavailable, this value
82
+ * is also used as the sole compatibility policy.
74
83
  *
75
84
  * Ignored on iOS because it refers to Chromium/WebView majors, not the installed iOS version.
76
85
  * Use `latestVersion` on iOS when you need an explicit policy.
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport type WebViewVersionState = 'latest' | 'outdated' | 'unknown';\n\nexport type WebViewPlatform = 'android' | 'ios' | 'web';\n\n/**\n * Capacitor config shape for `plugins.WebviewVersionChecker`.\n *\n * Main use case (default, no plugin config required):\n * Browserslist-style compatibility checks with a built-in version-share dataset\n * generated from caniuse at plugin build time.\n *\n * ```ts\n * plugins: {\n * WebviewVersionChecker: {}\n * }\n * ```\n *\n * Simple setup with automatic prompt:\n *\n * ```ts\n * plugins: {\n * WebviewVersionChecker: {\n * autoPromptOnOutdated: true,\n * }\n * }\n * ```\n *\n * Advanced setup with custom dataset and threshold:\n *\n * ```ts\n * plugins: {\n * WebviewVersionChecker: {\n * minimumDeviceSharePercent: 3,\n * versionShareByMajor: { '137': 58.2, '136': 21.3, '135': 4.6 },\n * }\n * }\n * ```\n */\nexport interface WebviewVersionCheckerConfig {\n /**\n * Automatically run a version check once when the plugin loads.\n *\n * @default true\n */\n autoCheckOnLoad?: boolean;\n\n /**\n * Automatically run a version check each time the app returns to foreground.\n *\n * @default true\n */\n autoCheckOnResume?: boolean;\n\n /**\n * Automatically show a native update prompt whenever an outdated WebView is detected.\n *\n * @default false\n */\n autoPromptOnOutdated?: boolean;\n\n /**\n * Controls whether the automatic modal can be dismissed.\n *\n * When set to false, users cannot dismiss the automatic modal manually.\n * They can only exit by opening the update action and reopening the app after updating.\n *\n * @default true\n */\n autoPromptDismissible?: boolean;\n\n /**\n * Explicit latest version to compare with.\n * If provided, this value is used before any API lookup.\n */\n latestVersion?: string;\n\n /**\n * Fallback minimum allowed major version for Android WebView checks.\n * Used when `latestVersion` cannot be resolved.\n *\n * Ignored on iOS because it refers to Chromium/WebView majors, not the installed iOS version.\n * Use `latestVersion` on iOS when you need an explicit policy.\n */\n minimumMajorVersion?: number;\n\n /**\n * Browserslist-style compatibility threshold in percentage points.\n *\n * Example: `3` means the installed WebView major version must represent at least 3%\n * of devices in the selected version-share dataset.\n *\n * Data source priority:\n * - `versionShareByMajor` (inline dataset) if provided\n * - else `versionShareApiUrl` if provided\n * - else built-in generated dataset (`generatedVersionShareByMajor`)\n *\n * If the threshold cannot be evaluated (missing dataset or missing major entry),\n * the plugin falls back to normal version checks (`latestVersion` / `latestVersionApiUrl`,\n * then `minimumMajorVersion`).\n *\n * @default 3\n */\n minimumDeviceSharePercent?: number;\n\n /**\n * Optional inline dataset for major-version device share.\n *\n * Keys are major versions (string or number-like), values are percentages (`0..100`).\n *\n * Example:\n * `{ \"137\": 54.2, \"136\": 23.8, \"135\": 7.1, \"134\": 2.4 }`\n *\n * Used when `minimumDeviceSharePercent` is set.\n * If both `versionShareByMajor` and `versionShareApiUrl` are provided,\n * this inline map is used first.\n */\n versionShareByMajor?: Record<string, number>;\n\n /**\n * Optional endpoint returning a version-share dataset.\n *\n * Used when `minimumDeviceSharePercent` is set and no inline `versionShareByMajor`\n * is provided. If omitted, the plugin uses its built-in generated dataset.\n *\n * Supported response shapes:\n * - `{ \"versionShareByMajor\": { \"137\": 54.2, \"136\": 23.8 } }`\n * - `{ \"shareByMajor\": { \"137\": 54.2, \"136\": 23.8 } }`\n * - `{ \"versions\": [{ \"major\": 137, \"share\": 54.2 }, { \"version\": \"136.0.0.0\", \"percent\": 23.8 }] }`\n * - Caniuse full dataset shape (`agents.*.usage_global`)\n */\n versionShareApiUrl?: string;\n\n /**\n * Optional endpoint returning a JSON payload with the latest version.\n *\n * Supported response shapes:\n * - `{ \"version\": \"137.0.7151.44\" }`\n * - `{ \"latestVersion\": \"137.0.7151.44\" }`\n * - Google version history format: `{ \"versions\": [{ \"version\": \"137.0.7151.44\" }] }`\n */\n latestVersionApiUrl?: string;\n\n /**\n * Optional URL opened when users tap update in the native prompt.\n *\n * Android default: Play Store listing of the active WebView package.\n * iOS default: Apple iOS update help page.\n */\n updateUrl?: string;\n\n /**\n * Native prompt title.\n */\n promptTitle?: string;\n\n /**\n * Native prompt message.\n */\n promptMessage?: string;\n\n /**\n * Native prompt update button text.\n */\n promptUpdateButtonText?: string;\n\n /**\n * Native prompt cancel button text.\n */\n promptCancelButtonText?: string;\n}\n\n/**\n * Options for running a WebView version check.\n */\nexport interface CheckWebViewOptions extends WebviewVersionCheckerConfig {\n /**\n * Force showing a native prompt if an outdated WebView is detected.\n *\n * @default false\n */\n showPromptOnOutdated?: boolean;\n\n /**\n * Optional tag included in the status payload so you can identify the check origin.\n *\n * @default \"manual\"\n */\n source?: string;\n}\n\n/**\n * Options for starting monitor mode.\n */\nexport interface StartMonitoringOptions extends CheckWebViewOptions {\n /**\n * Run a check immediately when monitoring starts.\n *\n * @default true\n */\n checkOnStart?: boolean;\n\n /**\n * Whether foreground checks should run while monitoring is enabled.\n *\n * @default true\n */\n checkOnResume?: boolean;\n}\n\n/**\n * Options for showing the native update prompt.\n */\nexport interface ShowUpdatePromptOptions {\n /**\n * Prompt title.\n */\n title?: string;\n\n /**\n * Prompt message.\n */\n message?: string;\n\n /**\n * Update CTA label.\n */\n updateButtonText?: string;\n\n /**\n * Cancel CTA label.\n */\n cancelButtonText?: string;\n\n /**\n * Optional URL to open if the update action is selected.\n */\n updateUrl?: string;\n}\n\n/**\n * Options for opening the update page directly.\n */\nexport interface OpenUpdatePageOptions {\n /**\n * Optional URL override.\n */\n updateUrl?: string;\n}\n\n/**\n * Snapshot of the currently detected WebView status.\n */\nexport interface WebViewVersionStatus {\n /**\n * Native platform that generated the status.\n */\n platform: WebViewPlatform;\n\n /**\n * Resolved version state.\n */\n state: WebViewVersionState;\n\n /**\n * Convenience boolean equivalent to `state === 'latest'`.\n */\n isLatest: boolean;\n\n /**\n * ISO-8601 timestamp of the check.\n */\n checkedAt: string;\n\n /**\n * Human-readable explanation for the reported state.\n */\n reason: string;\n\n /**\n * Current WebView (or iOS system WebKit) version string.\n */\n currentVersion: string;\n\n /**\n * Current detected major version (if parseable).\n */\n currentMajorVersion?: number;\n\n /**\n * Resolved latest version used for comparison.\n */\n latestVersion?: string;\n\n /**\n * Resolved latest major version (if parseable).\n */\n latestMajorVersion?: number;\n\n /**\n * Device-share percentage for the installed WebView major version.\n *\n * Present only when a version-share dataset is available and includes the current major version.\n */\n currentVersionSharePercent?: number;\n\n /**\n * Configured threshold used by compatibility-threshold mode.\n *\n * Present only when `minimumDeviceSharePercent` was requested for that check.\n */\n minimumDeviceSharePercent?: number;\n\n /**\n * Source used for version-share data.\n *\n * Values:\n * - `versionShareByMajor` (inline dataset)\n * - `versionShareApiUrl` (remote dataset)\n * - `generatedVersionShareByMajor` (built-in dataset generated at build time)\n */\n versionShareSource?: string;\n\n /**\n * Diagnostic message for compatibility-threshold mode.\n *\n * Present when `minimumDeviceSharePercent` was requested but the threshold check\n * could not be fully evaluated.\n */\n deviceShareError?: string;\n\n /**\n * Android package name of the active WebView provider.\n */\n providerPackage?: string;\n\n /**\n * URL that should be opened to update when outdated.\n */\n updateUrl?: string;\n\n /**\n * Internal source identifier for the check implementation.\n */\n source: string;\n}\n\n/**\n * Result payload for monitor controls.\n */\nexport interface MonitoringStateResult {\n /**\n * Whether monitoring is currently active.\n */\n monitoring: boolean;\n\n /**\n * Whether checks run on app resume while monitoring is active.\n */\n checkOnResume: boolean;\n\n /**\n * Whether outdated checks auto-trigger the native prompt.\n */\n autoPromptOnOutdated: boolean;\n}\n\n/**\n * Last known check snapshot.\n */\nexport interface LastStatusResult {\n /**\n * Null until the first check completes.\n */\n status: WebViewVersionStatus | null;\n}\n\n/**\n * Result payload for `showUpdatePrompt()`.\n */\nexport interface ShowUpdatePromptResult {\n /**\n * Whether a native prompt was actually shown.\n */\n shown: boolean;\n\n /**\n * Whether the update page was opened from the prompt action.\n */\n openedUpdatePage: boolean;\n}\n\n/**\n * Result payload for `openUpdatePage()`.\n */\nexport interface OpenUpdatePageResult {\n /**\n * Whether opening the update URL succeeded.\n */\n opened: boolean;\n\n /**\n * URL that was attempted.\n */\n url: string;\n}\n\n/**\n * Public API for checking WebView freshness and guiding users to updates.\n */\nexport interface WebviewVersionCheckerPlugin {\n /**\n * Runs a version check and returns the latest known status.\n */\n check(options?: CheckWebViewOptions): Promise<WebViewVersionStatus>;\n\n /**\n * Enables background monitoring (typically on app resume).\n */\n startMonitoring(options?: StartMonitoringOptions): Promise<MonitoringStateResult>;\n\n /**\n * Disables monitoring.\n */\n stopMonitoring(): Promise<MonitoringStateResult>;\n\n /**\n * Returns the last resolved status, or `null` if no check was run yet.\n */\n getLastStatus(): Promise<LastStatusResult>;\n\n /**\n * Shows a native prompt asking the user to update the WebView.\n */\n showUpdatePrompt(options?: ShowUpdatePromptOptions): Promise<ShowUpdatePromptResult>;\n\n /**\n * Opens the configured update page directly.\n */\n openUpdatePage(options?: OpenUpdatePageOptions): Promise<OpenUpdatePageResult>;\n\n /**\n * Fired for every successful status evaluation.\n */\n addListener(\n eventName: 'statusChanged',\n listenerFunc: (status: WebViewVersionStatus) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Fired when the state resolves to `latest`.\n */\n addListener(\n eventName: 'webViewLatest',\n listenerFunc: (status: WebViewVersionStatus) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Fired when the state resolves to `outdated`.\n */\n addListener(\n eventName: 'webViewOutdated',\n listenerFunc: (status: WebViewVersionStatus) => void,\n ): Promise<PluginListenerHandle>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport type WebViewVersionState = 'latest' | 'outdated' | 'unknown';\n\nexport type WebViewPlatform = 'android' | 'ios' | 'web';\n\n/**\n * Capacitor config shape for `plugins.WebviewVersionChecker`.\n *\n * Main use case (default, no plugin config required):\n * Browserslist-style compatibility checks with a built-in version-share dataset\n * generated from caniuse at plugin build time.\n *\n * ```ts\n * plugins: {\n * WebviewVersionChecker: {}\n * }\n * ```\n *\n * Simple setup with automatic prompt:\n *\n * ```ts\n * plugins: {\n * WebviewVersionChecker: {\n * autoPromptOnOutdated: true,\n * }\n * }\n * ```\n *\n * Advanced setup with custom dataset and threshold:\n *\n * ```ts\n * plugins: {\n * WebviewVersionChecker: {\n * minimumDeviceSharePercent: 3,\n * versionShareByMajor: { '137': 58.2, '136': 21.3, '135': 4.6 },\n * }\n * }\n * ```\n */\nexport interface WebviewVersionCheckerConfig {\n /**\n * Automatically run a version check once when the plugin loads.\n *\n * @default true\n */\n autoCheckOnLoad?: boolean;\n\n /**\n * Automatically run a version check each time the app returns to foreground.\n *\n * @default true\n */\n autoCheckOnResume?: boolean;\n\n /**\n * Automatically show a native update prompt whenever an outdated WebView is detected.\n *\n * @default false\n */\n autoPromptOnOutdated?: boolean;\n\n /**\n * Controls whether the automatic modal can be dismissed.\n *\n * When set to false, users cannot dismiss the automatic modal manually.\n * They can only exit by opening the update action and reopening the app after updating.\n *\n * @default true\n */\n autoPromptDismissible?: boolean;\n\n /**\n * Explicit latest version to compare with.\n * If provided, this value is used before any API lookup.\n */\n latestVersion?: string;\n\n /**\n * Minimum allowed major version for Android WebView and web checks.\n *\n * On the web, this applies to the browser-engine major version detected from\n * the user agent and enforces the same strict lower bound.\n *\n * When set, this is always enforced as a strict lower bound: an installed major version\n * below this value is reported as `outdated`, even when device-share or `latestVersion`\n * checks would otherwise pass.\n *\n * When `latestVersion` cannot be resolved and device-share data is unavailable, this value\n * is also used as the sole compatibility policy.\n *\n * Ignored on iOS because it refers to Chromium/WebView majors, not the installed iOS version.\n * Use `latestVersion` on iOS when you need an explicit policy.\n */\n minimumMajorVersion?: number;\n\n /**\n * Browserslist-style compatibility threshold in percentage points.\n *\n * Example: `3` means the installed WebView major version must represent at least 3%\n * of devices in the selected version-share dataset.\n *\n * Data source priority:\n * - `versionShareByMajor` (inline dataset) if provided\n * - else `versionShareApiUrl` if provided\n * - else built-in generated dataset (`generatedVersionShareByMajor`)\n *\n * If the threshold cannot be evaluated (missing dataset or missing major entry),\n * the plugin falls back to normal version checks (`latestVersion` / `latestVersionApiUrl`,\n * then `minimumMajorVersion`).\n *\n * @default 3\n */\n minimumDeviceSharePercent?: number;\n\n /**\n * Optional inline dataset for major-version device share.\n *\n * Keys are major versions (string or number-like), values are percentages (`0..100`).\n *\n * Example:\n * `{ \"137\": 54.2, \"136\": 23.8, \"135\": 7.1, \"134\": 2.4 }`\n *\n * Used when `minimumDeviceSharePercent` is set.\n * If both `versionShareByMajor` and `versionShareApiUrl` are provided,\n * this inline map is used first.\n */\n versionShareByMajor?: Record<string, number>;\n\n /**\n * Optional endpoint returning a version-share dataset.\n *\n * Used when `minimumDeviceSharePercent` is set and no inline `versionShareByMajor`\n * is provided. If omitted, the plugin uses its built-in generated dataset.\n *\n * Supported response shapes:\n * - `{ \"versionShareByMajor\": { \"137\": 54.2, \"136\": 23.8 } }`\n * - `{ \"shareByMajor\": { \"137\": 54.2, \"136\": 23.8 } }`\n * - `{ \"versions\": [{ \"major\": 137, \"share\": 54.2 }, { \"version\": \"136.0.0.0\", \"percent\": 23.8 }] }`\n * - Caniuse full dataset shape (`agents.*.usage_global`)\n */\n versionShareApiUrl?: string;\n\n /**\n * Optional endpoint returning a JSON payload with the latest version.\n *\n * Supported response shapes:\n * - `{ \"version\": \"137.0.7151.44\" }`\n * - `{ \"latestVersion\": \"137.0.7151.44\" }`\n * - Google version history format: `{ \"versions\": [{ \"version\": \"137.0.7151.44\" }] }`\n */\n latestVersionApiUrl?: string;\n\n /**\n * Optional URL opened when users tap update in the native prompt.\n *\n * Android default: Play Store listing of the active WebView package.\n * iOS default: Apple iOS update help page.\n */\n updateUrl?: string;\n\n /**\n * Native prompt title.\n */\n promptTitle?: string;\n\n /**\n * Native prompt message.\n */\n promptMessage?: string;\n\n /**\n * Native prompt update button text.\n */\n promptUpdateButtonText?: string;\n\n /**\n * Native prompt cancel button text.\n */\n promptCancelButtonText?: string;\n}\n\n/**\n * Options for running a WebView version check.\n */\nexport interface CheckWebViewOptions extends WebviewVersionCheckerConfig {\n /**\n * Force showing a native prompt if an outdated WebView is detected.\n *\n * @default false\n */\n showPromptOnOutdated?: boolean;\n\n /**\n * Optional tag included in the status payload so you can identify the check origin.\n *\n * @default \"manual\"\n */\n source?: string;\n}\n\n/**\n * Options for starting monitor mode.\n */\nexport interface StartMonitoringOptions extends CheckWebViewOptions {\n /**\n * Run a check immediately when monitoring starts.\n *\n * @default true\n */\n checkOnStart?: boolean;\n\n /**\n * Whether foreground checks should run while monitoring is enabled.\n *\n * @default true\n */\n checkOnResume?: boolean;\n}\n\n/**\n * Options for showing the native update prompt.\n */\nexport interface ShowUpdatePromptOptions {\n /**\n * Prompt title.\n */\n title?: string;\n\n /**\n * Prompt message.\n */\n message?: string;\n\n /**\n * Update CTA label.\n */\n updateButtonText?: string;\n\n /**\n * Cancel CTA label.\n */\n cancelButtonText?: string;\n\n /**\n * Optional URL to open if the update action is selected.\n */\n updateUrl?: string;\n}\n\n/**\n * Options for opening the update page directly.\n */\nexport interface OpenUpdatePageOptions {\n /**\n * Optional URL override.\n */\n updateUrl?: string;\n}\n\n/**\n * Snapshot of the currently detected WebView status.\n */\nexport interface WebViewVersionStatus {\n /**\n * Native platform that generated the status.\n */\n platform: WebViewPlatform;\n\n /**\n * Resolved version state.\n */\n state: WebViewVersionState;\n\n /**\n * Convenience boolean equivalent to `state === 'latest'`.\n */\n isLatest: boolean;\n\n /**\n * ISO-8601 timestamp of the check.\n */\n checkedAt: string;\n\n /**\n * Human-readable explanation for the reported state.\n */\n reason: string;\n\n /**\n * Current WebView (or iOS system WebKit) version string.\n */\n currentVersion: string;\n\n /**\n * Current detected major version (if parseable).\n */\n currentMajorVersion?: number;\n\n /**\n * Resolved latest version used for comparison.\n */\n latestVersion?: string;\n\n /**\n * Resolved latest major version (if parseable).\n */\n latestMajorVersion?: number;\n\n /**\n * Device-share percentage for the installed WebView major version.\n *\n * Present only when a version-share dataset is available and includes the current major version.\n */\n currentVersionSharePercent?: number;\n\n /**\n * Configured threshold used by compatibility-threshold mode.\n *\n * Present only when `minimumDeviceSharePercent` was requested for that check.\n */\n minimumDeviceSharePercent?: number;\n\n /**\n * Source used for version-share data.\n *\n * Values:\n * - `versionShareByMajor` (inline dataset)\n * - `versionShareApiUrl` (remote dataset)\n * - `generatedVersionShareByMajor` (built-in dataset generated at build time)\n */\n versionShareSource?: string;\n\n /**\n * Diagnostic message for compatibility-threshold mode.\n *\n * Present when `minimumDeviceSharePercent` was requested but the threshold check\n * could not be fully evaluated.\n */\n deviceShareError?: string;\n\n /**\n * Android package name of the active WebView provider.\n */\n providerPackage?: string;\n\n /**\n * URL that should be opened to update when outdated.\n */\n updateUrl?: string;\n\n /**\n * Internal source identifier for the check implementation.\n */\n source: string;\n}\n\n/**\n * Result payload for monitor controls.\n */\nexport interface MonitoringStateResult {\n /**\n * Whether monitoring is currently active.\n */\n monitoring: boolean;\n\n /**\n * Whether checks run on app resume while monitoring is active.\n */\n checkOnResume: boolean;\n\n /**\n * Whether outdated checks auto-trigger the native prompt.\n */\n autoPromptOnOutdated: boolean;\n}\n\n/**\n * Last known check snapshot.\n */\nexport interface LastStatusResult {\n /**\n * Null until the first check completes.\n */\n status: WebViewVersionStatus | null;\n}\n\n/**\n * Result payload for `showUpdatePrompt()`.\n */\nexport interface ShowUpdatePromptResult {\n /**\n * Whether a native prompt was actually shown.\n */\n shown: boolean;\n\n /**\n * Whether the update page was opened from the prompt action.\n */\n openedUpdatePage: boolean;\n}\n\n/**\n * Result payload for `openUpdatePage()`.\n */\nexport interface OpenUpdatePageResult {\n /**\n * Whether opening the update URL succeeded.\n */\n opened: boolean;\n\n /**\n * URL that was attempted.\n */\n url: string;\n}\n\n/**\n * Public API for checking WebView freshness and guiding users to updates.\n */\nexport interface WebviewVersionCheckerPlugin {\n /**\n * Runs a version check and returns the latest known status.\n */\n check(options?: CheckWebViewOptions): Promise<WebViewVersionStatus>;\n\n /**\n * Enables background monitoring (typically on app resume).\n */\n startMonitoring(options?: StartMonitoringOptions): Promise<MonitoringStateResult>;\n\n /**\n * Disables monitoring.\n */\n stopMonitoring(): Promise<MonitoringStateResult>;\n\n /**\n * Returns the last resolved status, or `null` if no check was run yet.\n */\n getLastStatus(): Promise<LastStatusResult>;\n\n /**\n * Shows a native prompt asking the user to update the WebView.\n */\n showUpdatePrompt(options?: ShowUpdatePromptOptions): Promise<ShowUpdatePromptResult>;\n\n /**\n * Opens the configured update page directly.\n */\n openUpdatePage(options?: OpenUpdatePageOptions): Promise<OpenUpdatePageResult>;\n\n /**\n * Fired for every successful status evaluation.\n */\n addListener(\n eventName: 'statusChanged',\n listenerFunc: (status: WebViewVersionStatus) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Fired when the state resolves to `latest`.\n */\n addListener(\n eventName: 'webViewLatest',\n listenerFunc: (status: WebViewVersionStatus) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Fired when the state resolves to `outdated`.\n */\n addListener(\n eventName: 'webViewOutdated',\n listenerFunc: (status: WebViewVersionStatus) => void,\n ): Promise<PluginListenerHandle>;\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * AUTO-GENERATED FILE. DO NOT EDIT.
3
3
  * Generated by: scripts/generate-version-share-data.mjs
4
4
  * Source: https://raw.githubusercontent.com/Fyrd/caniuse/main/data.json
5
- * Generated at: 2026-07-02T13:02:16.965Z
5
+ * Generated at: 2026-08-16T12:08:18.255Z
6
6
  */
7
7
  export declare const DEFAULT_VERSION_SHARE_DATA_SOURCE = "generatedVersionShareByMajor";
8
- export declare const DEFAULT_VERSION_SHARE_GENERATED_AT = "2026-07-02T13:02:16.965Z";
8
+ export declare const DEFAULT_VERSION_SHARE_GENERATED_AT = "2026-08-16T12:08:18.255Z";
9
9
  export declare const DEFAULT_VERSION_SHARE_BY_MAJOR: Record<string, number>;
@@ -3,95 +3,94 @@
3
3
  * AUTO-GENERATED FILE. DO NOT EDIT.
4
4
  * Generated by: scripts/generate-version-share-data.mjs
5
5
  * Source: https://raw.githubusercontent.com/Fyrd/caniuse/main/data.json
6
- * Generated at: 2026-07-02T13:02:16.965Z
6
+ * Generated at: 2026-08-16T12:08:18.255Z
7
7
  */
8
8
  export const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';
9
- export const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-07-02T13:02:16.965Z';
9
+ export const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-08-16T12:08:18.255Z';
10
10
  export const DEFAULT_VERSION_SHARE_BY_MAJOR = {
11
- "4": 0.000031,
12
- "39": 0.08685,
13
- "40": 0.08685,
14
- "41": 0.08685,
15
- "42": 0.08685,
16
- "43": 0.08685,
17
- "44": 0.08685,
18
- "45": 0.091675,
19
- "46": 0.08685,
20
- "47": 0.08685,
21
- "48": 0.091675,
22
- "49": 0.091675,
23
- "50": 0.08685,
24
- "51": 0.08685,
25
- "52": 0.091675,
26
- "53": 0.08685,
27
- "54": 0.08685,
28
- "55": 0.08685,
29
- "56": 0.08685,
30
- "57": 0.08685,
31
- "58": 0.08685,
32
- "59": 0.08685,
33
- "60": 0.08685,
34
- "66": 0.004825,
35
- "69": 0.004825,
36
- "70": 0.024125,
37
- "79": 0.02895,
38
- "86": 0.004825,
39
- "87": 0.014475,
40
- "91": 0.00965,
41
- "93": 0.014475,
42
- "96": 0.004825,
43
- "97": 0.004825,
44
- "98": 0.02895,
45
- "99": 0.014475,
46
- "100": 0.00965,
47
- "101": 0.00965,
48
- "102": 0.004825,
49
- "103": 0.303975,
50
- "104": 0.2509,
51
- "105": 0.236425,
52
- "106": 0.236425,
53
- "107": 0.236425,
54
- "108": 0.246075,
55
- "109": 0.7334,
56
- "110": 0.24125,
57
- "111": 0.2895,
58
- "112": 0.902275,
59
- "114": 0.024125,
60
- "115": 0.00965,
61
- "116": 0.516275,
62
- "117": 0.284675,
63
- "118": 1.1773,
64
- "119": 0.02895,
65
- "120": 0.294325,
66
- "121": 0.024125,
67
- "122": 0.033775,
68
- "123": 0.033775,
69
- "124": 0.27985,
70
- "125": 0.5211,
71
- "126": 0.0386,
72
- "127": 0.0193,
73
- "128": 0.053075,
74
- "129": 0.0193,
75
- "130": 0.062725,
76
- "131": 0.564525,
77
- "132": 0.04825,
78
- "133": 0.516275,
79
- "134": 0.04825,
80
- "135": 0.0386,
81
- "136": 0.043425,
82
- "137": 0.082025,
83
- "138": 0.159225,
84
- "139": 0.101325,
85
- "140": 0.0772,
86
- "141": 0.0579,
87
- "142": 0.902275,
88
- "143": 0.110975,
89
- "144": 0.29915,
90
- "145": 0.863675,
91
- "146": 0.583825,
92
- "147": 6.10362,
93
- "148": 8.41963,
94
- "149": 42.196,
95
- "150": 0.00965
11
+ "4": 0.000003,
12
+ "39": 0.02296,
13
+ "40": 0.02296,
14
+ "41": 0.02296,
15
+ "42": 0.02296,
16
+ "43": 0.02296,
17
+ "44": 0.02296,
18
+ "45": 0.02296,
19
+ "46": 0.02296,
20
+ "47": 0.02296,
21
+ "48": 0.027552,
22
+ "49": 0.027552,
23
+ "50": 0.02296,
24
+ "51": 0.02296,
25
+ "52": 0.027552,
26
+ "53": 0.02296,
27
+ "54": 0.02296,
28
+ "55": 0.02296,
29
+ "56": 0.02296,
30
+ "57": 0.02296,
31
+ "58": 0.02296,
32
+ "59": 0.02296,
33
+ "60": 0.02296,
34
+ "69": 0.009184,
35
+ "70": 0.06888,
36
+ "79": 0.018368,
37
+ "86": 0.004592,
38
+ "87": 0.02296,
39
+ "91": 0.009184,
40
+ "93": 0.009184,
41
+ "97": 0.004592,
42
+ "98": 0.02296,
43
+ "99": 0.004592,
44
+ "101": 0.009184,
45
+ "102": 0.009184,
46
+ "103": 0.146944,
47
+ "104": 0.087248,
48
+ "105": 0.087248,
49
+ "106": 0.09184,
50
+ "107": 0.09184,
51
+ "108": 0.096432,
52
+ "109": 0.583184,
53
+ "110": 0.09184,
54
+ "111": 0.101024,
55
+ "112": 0.09184,
56
+ "114": 0.018368,
57
+ "115": 0.009184,
58
+ "116": 0.20664,
59
+ "117": 0.09184,
60
+ "118": 0.211232,
61
+ "119": 0.36736,
62
+ "120": 0.509712,
63
+ "121": 0.013776,
64
+ "122": 0.036736,
65
+ "123": 0.018368,
66
+ "124": 0.174496,
67
+ "125": 0.087248,
68
+ "126": 0.036736,
69
+ "127": 0.013776,
70
+ "128": 0.064288,
71
+ "129": 0.013776,
72
+ "130": 0.027552,
73
+ "131": 0.270928,
74
+ "132": 0.073472,
75
+ "133": 0.211232,
76
+ "134": 0.04592,
77
+ "135": 0.036736,
78
+ "136": 0.247968,
79
+ "137": 0.073472,
80
+ "138": 0.123984,
81
+ "139": 0.188272,
82
+ "140": 0.036736,
83
+ "141": 0.04592,
84
+ "142": 0.257152,
85
+ "143": 0.073472,
86
+ "144": 0.101024,
87
+ "145": 0.904624,
88
+ "146": 0.110208,
89
+ "147": 0.220416,
90
+ "148": 0.716352,
91
+ "149": 5.04202,
92
+ "150": 9.15645,
93
+ "151": 46.3251,
94
+ "152": 0.009184
96
95
  };
97
96
  //# sourceMappingURL=generated-version-share.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generated-version-share.js","sourceRoot":"","sources":["../../src/generated-version-share.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAG,8BAA8B,CAAC;AAChF,MAAM,CAAC,MAAM,kCAAkC,GAAG,0BAA0B,CAAC;AAC7E,MAAM,CAAC,MAAM,8BAA8B,GAA2B;IACpE,GAAG,EAAE,QAAQ;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,OAAO;CACf,CAAC","sourcesContent":["/* eslint-disable */\n/**\n * AUTO-GENERATED FILE. DO NOT EDIT.\n * Generated by: scripts/generate-version-share-data.mjs\n * Source: https://raw.githubusercontent.com/Fyrd/caniuse/main/data.json\n * Generated at: 2026-07-02T13:02:16.965Z\n */\n\nexport const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';\nexport const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-07-02T13:02:16.965Z';\nexport const DEFAULT_VERSION_SHARE_BY_MAJOR: Record<string, number> = {\n \"4\": 0.000031,\n \"39\": 0.08685,\n \"40\": 0.08685,\n \"41\": 0.08685,\n \"42\": 0.08685,\n \"43\": 0.08685,\n \"44\": 0.08685,\n \"45\": 0.091675,\n \"46\": 0.08685,\n \"47\": 0.08685,\n \"48\": 0.091675,\n \"49\": 0.091675,\n \"50\": 0.08685,\n \"51\": 0.08685,\n \"52\": 0.091675,\n \"53\": 0.08685,\n \"54\": 0.08685,\n \"55\": 0.08685,\n \"56\": 0.08685,\n \"57\": 0.08685,\n \"58\": 0.08685,\n \"59\": 0.08685,\n \"60\": 0.08685,\n \"66\": 0.004825,\n \"69\": 0.004825,\n \"70\": 0.024125,\n \"79\": 0.02895,\n \"86\": 0.004825,\n \"87\": 0.014475,\n \"91\": 0.00965,\n \"93\": 0.014475,\n \"96\": 0.004825,\n \"97\": 0.004825,\n \"98\": 0.02895,\n \"99\": 0.014475,\n \"100\": 0.00965,\n \"101\": 0.00965,\n \"102\": 0.004825,\n \"103\": 0.303975,\n \"104\": 0.2509,\n \"105\": 0.236425,\n \"106\": 0.236425,\n \"107\": 0.236425,\n \"108\": 0.246075,\n \"109\": 0.7334,\n \"110\": 0.24125,\n \"111\": 0.2895,\n \"112\": 0.902275,\n \"114\": 0.024125,\n \"115\": 0.00965,\n \"116\": 0.516275,\n \"117\": 0.284675,\n \"118\": 1.1773,\n \"119\": 0.02895,\n \"120\": 0.294325,\n \"121\": 0.024125,\n \"122\": 0.033775,\n \"123\": 0.033775,\n \"124\": 0.27985,\n \"125\": 0.5211,\n \"126\": 0.0386,\n \"127\": 0.0193,\n \"128\": 0.053075,\n \"129\": 0.0193,\n \"130\": 0.062725,\n \"131\": 0.564525,\n \"132\": 0.04825,\n \"133\": 0.516275,\n \"134\": 0.04825,\n \"135\": 0.0386,\n \"136\": 0.043425,\n \"137\": 0.082025,\n \"138\": 0.159225,\n \"139\": 0.101325,\n \"140\": 0.0772,\n \"141\": 0.0579,\n \"142\": 0.902275,\n \"143\": 0.110975,\n \"144\": 0.29915,\n \"145\": 0.863675,\n \"146\": 0.583825,\n \"147\": 6.10362,\n \"148\": 8.41963,\n \"149\": 42.196,\n \"150\": 0.00965\n};\n"]}
1
+ {"version":3,"file":"generated-version-share.js","sourceRoot":"","sources":["../../src/generated-version-share.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAG,8BAA8B,CAAC;AAChF,MAAM,CAAC,MAAM,kCAAkC,GAAG,0BAA0B,CAAC;AAC7E,MAAM,CAAC,MAAM,8BAA8B,GAA2B;IACpE,GAAG,EAAE,QAAQ;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;CAChB,CAAC","sourcesContent":["/* eslint-disable */\n/**\n * AUTO-GENERATED FILE. DO NOT EDIT.\n * Generated by: scripts/generate-version-share-data.mjs\n * Source: https://raw.githubusercontent.com/Fyrd/caniuse/main/data.json\n * Generated at: 2026-08-16T12:08:18.255Z\n */\n\nexport const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';\nexport const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-08-16T12:08:18.255Z';\nexport const DEFAULT_VERSION_SHARE_BY_MAJOR: Record<string, number> = {\n \"4\": 0.000003,\n \"39\": 0.02296,\n \"40\": 0.02296,\n \"41\": 0.02296,\n \"42\": 0.02296,\n \"43\": 0.02296,\n \"44\": 0.02296,\n \"45\": 0.02296,\n \"46\": 0.02296,\n \"47\": 0.02296,\n \"48\": 0.027552,\n \"49\": 0.027552,\n \"50\": 0.02296,\n \"51\": 0.02296,\n \"52\": 0.027552,\n \"53\": 0.02296,\n \"54\": 0.02296,\n \"55\": 0.02296,\n \"56\": 0.02296,\n \"57\": 0.02296,\n \"58\": 0.02296,\n \"59\": 0.02296,\n \"60\": 0.02296,\n \"69\": 0.009184,\n \"70\": 0.06888,\n \"79\": 0.018368,\n \"86\": 0.004592,\n \"87\": 0.02296,\n \"91\": 0.009184,\n \"93\": 0.009184,\n \"97\": 0.004592,\n \"98\": 0.02296,\n \"99\": 0.004592,\n \"101\": 0.009184,\n \"102\": 0.009184,\n \"103\": 0.146944,\n \"104\": 0.087248,\n \"105\": 0.087248,\n \"106\": 0.09184,\n \"107\": 0.09184,\n \"108\": 0.096432,\n \"109\": 0.583184,\n \"110\": 0.09184,\n \"111\": 0.101024,\n \"112\": 0.09184,\n \"114\": 0.018368,\n \"115\": 0.009184,\n \"116\": 0.20664,\n \"117\": 0.09184,\n \"118\": 0.211232,\n \"119\": 0.36736,\n \"120\": 0.509712,\n \"121\": 0.013776,\n \"122\": 0.036736,\n \"123\": 0.018368,\n \"124\": 0.174496,\n \"125\": 0.087248,\n \"126\": 0.036736,\n \"127\": 0.013776,\n \"128\": 0.064288,\n \"129\": 0.013776,\n \"130\": 0.027552,\n \"131\": 0.270928,\n \"132\": 0.073472,\n \"133\": 0.211232,\n \"134\": 0.04592,\n \"135\": 0.036736,\n \"136\": 0.247968,\n \"137\": 0.073472,\n \"138\": 0.123984,\n \"139\": 0.188272,\n \"140\": 0.036736,\n \"141\": 0.04592,\n \"142\": 0.257152,\n \"143\": 0.073472,\n \"144\": 0.101024,\n \"145\": 0.904624,\n \"146\": 0.110208,\n \"147\": 0.220416,\n \"148\": 0.716352,\n \"149\": 5.04202,\n \"150\": 9.15645,\n \"151\": 46.3251,\n \"152\": 0.009184\n};\n"]}
package/dist/esm/web.js CHANGED
@@ -65,6 +65,12 @@ export class WebviewVersionCheckerWeb extends WebPlugin {
65
65
  else if (state === 'unknown' && deviceShareError) {
66
66
  reason = deviceShareError;
67
67
  }
68
+ if (typeof options.minimumMajorVersion === 'number' &&
69
+ typeof currentMajorVersion === 'number' &&
70
+ currentMajorVersion < options.minimumMajorVersion) {
71
+ state = 'outdated';
72
+ reason = 'Current browser engine major version is below the minimum requirement.';
73
+ }
68
74
  const status = {
69
75
  platform: 'web',
70
76
  state,