@capgo/capacitor-webview-version-checker 8.2.1 → 8.2.3
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.
- package/README.md +1 -1
- package/android/src/main/java/app/capgo/webviewversionchecker/GeneratedVersionShareData.java +2 -2
- package/dist/esm/generated-version-share.d.ts +2 -2
- package/dist/esm/generated-version-share.js +87 -84
- package/dist/esm/generated-version-share.js.map +1 -1
- package/dist/plugin.cjs.js +86 -83
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +86 -83
- package/dist/plugin.js.map +1 -1
- package/package.json +8 -3
- package/scripts/generate-version-share-data.mjs +196 -0
- package/src/generated-version-share.ts +97 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# @capgo/capacitor-webview-version-checker
|
|
2
|
-
|
|
2
|
+
<a href="https://capgo.app/"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-webview-version-checker" alt="Capgo - Instant updates for Capacitor" /></a>
|
|
3
3
|
|
|
4
4
|
<div align="center">
|
|
5
5
|
<h2><a href="https://capgo.app/?ref=plugin_webview_version_checker"> ➡️ Get Instant updates for your App with Capgo</a></h2>
|
package/android/src/main/java/app/capgo/webviewversionchecker/GeneratedVersionShareData.java
CHANGED
|
@@ -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-
|
|
7
|
+
private static final String GENERATED_AT = "2026-06-16T03:32:51.778Z";
|
|
8
8
|
private static final String DATA_SOURCE = "generatedVersionShareByMajor";
|
|
9
|
-
private static final String JSON_DATA = "{\"4\":0.
|
|
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}";
|
|
10
10
|
|
|
11
11
|
private GeneratedVersionShareData() {}
|
|
12
12
|
|
|
@@ -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-
|
|
5
|
+
* Generated at: 2026-06-16T03:32:51.778Z
|
|
6
6
|
*/
|
|
7
7
|
export declare const DEFAULT_VERSION_SHARE_DATA_SOURCE = "generatedVersionShareByMajor";
|
|
8
|
-
export declare const DEFAULT_VERSION_SHARE_GENERATED_AT = "2026-
|
|
8
|
+
export declare const DEFAULT_VERSION_SHARE_GENERATED_AT = "2026-06-16T03:32:51.778Z";
|
|
9
9
|
export declare const DEFAULT_VERSION_SHARE_BY_MAJOR: Record<string, number>;
|
|
@@ -3,92 +3,95 @@
|
|
|
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-
|
|
6
|
+
* Generated at: 2026-06-16T03:32:51.778Z
|
|
7
7
|
*/
|
|
8
8
|
export const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';
|
|
9
|
-
export const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-
|
|
9
|
+
export const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-06-16T03:32:51.778Z';
|
|
10
10
|
export const DEFAULT_VERSION_SHARE_BY_MAJOR = {
|
|
11
|
-
"4": 0.
|
|
12
|
-
"39": 0.
|
|
13
|
-
"40": 0.
|
|
14
|
-
"41": 0.
|
|
15
|
-
"42": 0.
|
|
16
|
-
"43": 0.
|
|
17
|
-
"44": 0.
|
|
18
|
-
"45": 0.
|
|
19
|
-
"46": 0.
|
|
20
|
-
"47": 0.
|
|
21
|
-
"48": 0.
|
|
22
|
-
"49": 0.
|
|
23
|
-
"50": 0.
|
|
24
|
-
"51": 0.
|
|
25
|
-
"52": 0.
|
|
26
|
-
"53": 0.
|
|
27
|
-
"54": 0.
|
|
28
|
-
"55": 0.
|
|
29
|
-
"56": 0.
|
|
30
|
-
"57": 0.
|
|
31
|
-
"58": 0.
|
|
32
|
-
"59": 0.
|
|
33
|
-
"60": 0.
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"86": 0.
|
|
39
|
-
"87": 0.
|
|
40
|
-
"91": 0.
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"97": 0.
|
|
44
|
-
"98": 0.
|
|
45
|
-
"99": 0.
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
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
|
|
93
96
|
};
|
|
94
97
|
//# 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,
|
|
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,IAA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M;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-06-16T03:32:51.778Z\n */\n\nexport const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';\nexport const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-06-16T03:32:51.778Z';\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"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -11,92 +11,95 @@ const WebviewVersionChecker = core.registerPlugin('WebviewVersionChecker', {
|
|
|
11
11
|
* AUTO-GENERATED FILE. DO NOT EDIT.
|
|
12
12
|
* Generated by: scripts/generate-version-share-data.mjs
|
|
13
13
|
* Source: https://raw.githubusercontent.com/Fyrd/caniuse/main/data.json
|
|
14
|
-
* Generated at: 2026-
|
|
14
|
+
* Generated at: 2026-06-16T03:32:51.778Z
|
|
15
15
|
*/
|
|
16
16
|
const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';
|
|
17
17
|
const DEFAULT_VERSION_SHARE_BY_MAJOR = {
|
|
18
|
-
"4": 0.
|
|
19
|
-
"39": 0.
|
|
20
|
-
"40": 0.
|
|
21
|
-
"41": 0.
|
|
22
|
-
"42": 0.
|
|
23
|
-
"43": 0.
|
|
24
|
-
"44": 0.
|
|
25
|
-
"45": 0.
|
|
26
|
-
"46": 0.
|
|
27
|
-
"47": 0.
|
|
28
|
-
"48": 0.
|
|
29
|
-
"49": 0.
|
|
30
|
-
"50": 0.
|
|
31
|
-
"51": 0.
|
|
32
|
-
"52": 0.
|
|
33
|
-
"53": 0.
|
|
34
|
-
"54": 0.
|
|
35
|
-
"55": 0.
|
|
36
|
-
"56": 0.
|
|
37
|
-
"57": 0.
|
|
38
|
-
"58": 0.
|
|
39
|
-
"59": 0.
|
|
40
|
-
"60": 0.
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"86": 0.
|
|
46
|
-
"87": 0.
|
|
47
|
-
"91": 0.
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"97": 0.
|
|
51
|
-
"98": 0.
|
|
52
|
-
"99": 0.
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
18
|
+
"4": 0.000031,
|
|
19
|
+
"39": 0.08685,
|
|
20
|
+
"40": 0.08685,
|
|
21
|
+
"41": 0.08685,
|
|
22
|
+
"42": 0.08685,
|
|
23
|
+
"43": 0.08685,
|
|
24
|
+
"44": 0.08685,
|
|
25
|
+
"45": 0.091675,
|
|
26
|
+
"46": 0.08685,
|
|
27
|
+
"47": 0.08685,
|
|
28
|
+
"48": 0.091675,
|
|
29
|
+
"49": 0.091675,
|
|
30
|
+
"50": 0.08685,
|
|
31
|
+
"51": 0.08685,
|
|
32
|
+
"52": 0.091675,
|
|
33
|
+
"53": 0.08685,
|
|
34
|
+
"54": 0.08685,
|
|
35
|
+
"55": 0.08685,
|
|
36
|
+
"56": 0.08685,
|
|
37
|
+
"57": 0.08685,
|
|
38
|
+
"58": 0.08685,
|
|
39
|
+
"59": 0.08685,
|
|
40
|
+
"60": 0.08685,
|
|
41
|
+
"66": 0.004825,
|
|
42
|
+
"69": 0.004825,
|
|
43
|
+
"70": 0.024125,
|
|
44
|
+
"79": 0.02895,
|
|
45
|
+
"86": 0.004825,
|
|
46
|
+
"87": 0.014475,
|
|
47
|
+
"91": 0.00965,
|
|
48
|
+
"93": 0.014475,
|
|
49
|
+
"96": 0.004825,
|
|
50
|
+
"97": 0.004825,
|
|
51
|
+
"98": 0.02895,
|
|
52
|
+
"99": 0.014475,
|
|
53
|
+
"100": 0.00965,
|
|
54
|
+
"101": 0.00965,
|
|
55
|
+
"102": 0.004825,
|
|
56
|
+
"103": 0.303975,
|
|
57
|
+
"104": 0.2509,
|
|
58
|
+
"105": 0.236425,
|
|
59
|
+
"106": 0.236425,
|
|
60
|
+
"107": 0.236425,
|
|
61
|
+
"108": 0.246075,
|
|
62
|
+
"109": 0.7334,
|
|
63
|
+
"110": 0.24125,
|
|
64
|
+
"111": 0.2895,
|
|
65
|
+
"112": 0.902275,
|
|
66
|
+
"114": 0.024125,
|
|
67
|
+
"115": 0.00965,
|
|
68
|
+
"116": 0.516275,
|
|
69
|
+
"117": 0.284675,
|
|
70
|
+
"118": 1.1773,
|
|
71
|
+
"119": 0.02895,
|
|
72
|
+
"120": 0.294325,
|
|
73
|
+
"121": 0.024125,
|
|
74
|
+
"122": 0.033775,
|
|
75
|
+
"123": 0.033775,
|
|
76
|
+
"124": 0.27985,
|
|
77
|
+
"125": 0.5211,
|
|
78
|
+
"126": 0.0386,
|
|
79
|
+
"127": 0.0193,
|
|
80
|
+
"128": 0.053075,
|
|
81
|
+
"129": 0.0193,
|
|
82
|
+
"130": 0.062725,
|
|
83
|
+
"131": 0.564525,
|
|
84
|
+
"132": 0.04825,
|
|
85
|
+
"133": 0.516275,
|
|
86
|
+
"134": 0.04825,
|
|
87
|
+
"135": 0.0386,
|
|
88
|
+
"136": 0.043425,
|
|
89
|
+
"137": 0.082025,
|
|
90
|
+
"138": 0.159225,
|
|
91
|
+
"139": 0.101325,
|
|
92
|
+
"140": 0.0772,
|
|
93
|
+
"141": 0.0579,
|
|
94
|
+
"142": 0.902275,
|
|
95
|
+
"143": 0.110975,
|
|
96
|
+
"144": 0.29915,
|
|
97
|
+
"145": 0.863675,
|
|
98
|
+
"146": 0.583825,
|
|
99
|
+
"147": 6.10362,
|
|
100
|
+
"148": 8.41963,
|
|
101
|
+
"149": 42.196,
|
|
102
|
+
"150": 0.00965
|
|
100
103
|
};
|
|
101
104
|
|
|
102
105
|
const UNKNOWN_REASON = 'Web implementation is a compatibility shim. Native Android/iOS implementations provide full WebView checks.';
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/generated-version-share.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst WebviewVersionChecker = registerPlugin('WebviewVersionChecker', {\n web: () => import('./web').then((m) => new m.WebviewVersionCheckerWeb()),\n});\nexport * from './definitions';\nexport { WebviewVersionChecker };\n//# sourceMappingURL=index.js.map","/* 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-04-08T12:26:06.910Z\n */\nexport const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';\nexport const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-04-08T12:26:06.910Z';\nexport const DEFAULT_VERSION_SHARE_BY_MAJOR = {\n \"4\": 0.000026,\n \"39\": 0.034656,\n \"40\": 0.034656,\n \"41\": 0.034656,\n \"42\": 0.034656,\n \"43\": 0.034656,\n \"44\": 0.034656,\n \"45\": 0.034656,\n \"46\": 0.034656,\n \"47\": 0.034656,\n \"48\": 0.038988,\n \"49\": 0.04332,\n \"50\": 0.034656,\n \"51\": 0.034656,\n \"52\": 0.034656,\n \"53\": 0.034656,\n \"54\": 0.034656,\n \"55\": 0.034656,\n \"56\": 0.034656,\n \"57\": 0.034656,\n \"58\": 0.034656,\n \"59\": 0.034656,\n \"60\": 0.034656,\n \"69\": 0.004332,\n \"77\": 0.034656,\n \"79\": 0.008664,\n \"80\": 0.004332,\n \"86\": 0.008664,\n \"87\": 0.008664,\n \"91\": 0.004332,\n \"92\": 0.004332,\n \"93\": 0.008664,\n \"97\": 0.008664,\n \"98\": 0.004332,\n \"99\": 0.004332,\n \"101\": 0.008664,\n \"102\": 0.004332,\n \"103\": 0.121296,\n \"104\": 0.06498,\n \"105\": 0.06498,\n \"106\": 0.06498,\n \"107\": 0.06498,\n \"108\": 0.069312,\n \"109\": 0.645468,\n \"110\": 0.06498,\n \"111\": 0.06498,\n \"112\": 0.142956,\n \"114\": 0.025992,\n \"115\": 0.008664,\n \"116\": 0.17328,\n \"117\": 0.069312,\n \"118\": 0.008664,\n \"119\": 0.017328,\n \"120\": 0.08664,\n \"121\": 0.017328,\n \"122\": 0.038988,\n \"123\": 0.012996,\n \"124\": 0.082308,\n \"125\": 0.02166,\n \"126\": 0.038988,\n \"127\": 0.012996,\n \"128\": 0.056316,\n \"129\": 0.012996,\n \"130\": 0.060648,\n \"131\": 0.229596,\n \"132\": 0.034656,\n \"133\": 0.147288,\n \"134\": 0.047652,\n \"135\": 0.051984,\n \"136\": 0.04332,\n \"137\": 0.047652,\n \"138\": 0.212268,\n \"139\": 0.34656,\n \"140\": 0.073644,\n \"141\": 0.082308,\n \"142\": 0.207936,\n \"143\": 0.320568,\n \"144\": 0.940044,\n \"145\": 9.30947,\n \"146\": 6.96152,\n \"147\": 44.7569,\n \"148\": 0.004332\n};\n//# sourceMappingURL=generated-version-share.js.map","import { WebPlugin } from '@capacitor/core';\nimport { DEFAULT_VERSION_SHARE_BY_MAJOR, DEFAULT_VERSION_SHARE_DATA_SOURCE } from './generated-version-share';\nconst UNKNOWN_REASON = 'Web implementation is a compatibility shim. Native Android/iOS implementations provide full WebView checks.';\nexport class WebviewVersionCheckerWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.monitoring = false;\n this.checkOnResume = true;\n this.autoPromptOnOutdated = false;\n this.lastStatus = null;\n }\n async check(options = {}) {\n var _a, _b;\n const currentVersion = this.detectCurrentVersion();\n const currentMajorVersion = this.parseMajorVersion(currentVersion);\n const latestVersion = options.latestVersion;\n const latestMajorVersion = this.parseMajorVersion(latestVersion);\n const minimumDeviceSharePercent = this.normalizePercent((_a = options.minimumDeviceSharePercent) !== null && _a !== void 0 ? _a : 3);\n const normalizedInlineVersionShareByMajor = this.normalizeVersionShareByMajor(options.versionShareByMajor);\n const normalizedGeneratedVersionShareByMajor = this.normalizeVersionShareByMajor(DEFAULT_VERSION_SHARE_BY_MAJOR);\n const normalizedVersionShareByMajor = normalizedInlineVersionShareByMajor !== null && normalizedInlineVersionShareByMajor !== void 0 ? normalizedInlineVersionShareByMajor : normalizedGeneratedVersionShareByMajor;\n const versionShareSource = normalizedInlineVersionShareByMajor\n ? 'versionShareByMajor'\n : DEFAULT_VERSION_SHARE_DATA_SOURCE;\n const currentVersionSharePercent = this.resolveCurrentVersionSharePercent(currentMajorVersion, normalizedVersionShareByMajor);\n let deviceShareError;\n let state = 'unknown';\n let reason = UNKNOWN_REASON;\n if (typeof minimumDeviceSharePercent === 'number') {\n if (typeof currentVersionSharePercent === 'number') {\n state = currentVersionSharePercent >= minimumDeviceSharePercent ? 'latest' : 'outdated';\n reason =\n state === 'latest'\n ? 'Current browser engine major version meets the configured device-share threshold.'\n : 'Current browser engine major version is below the configured device-share threshold.';\n }\n else if (!normalizedVersionShareByMajor && options.versionShareApiUrl) {\n deviceShareError =\n 'Web shim does not fetch version-share API data. Provide versionShareByMajor to evaluate minimumDeviceSharePercent.';\n }\n else if (!normalizedVersionShareByMajor) {\n deviceShareError = 'minimumDeviceSharePercent is set, but no versionShareByMajor dataset was provided.';\n }\n else {\n deviceShareError = 'No device-share entry was found for the current browser engine major version.';\n }\n }\n if (state === 'unknown' && latestVersion && currentVersion) {\n const cmp = this.compareVersions(currentVersion, latestVersion);\n state = cmp >= 0 ? 'latest' : 'outdated';\n reason =\n cmp >= 0\n ? 'Current browser engine is at or above the requested latest version.'\n : 'Current browser engine is below the requested latest version.';\n }\n else if (state === 'unknown' &&\n typeof options.minimumMajorVersion === 'number' &&\n typeof currentMajorVersion === 'number') {\n state = currentMajorVersion >= options.minimumMajorVersion ? 'latest' : 'outdated';\n reason =\n state === 'latest'\n ? 'Current browser engine major version meets the minimum requirement.'\n : 'Current browser engine major version is below the minimum requirement.';\n }\n else if (state === 'unknown' && deviceShareError) {\n reason = deviceShareError;\n }\n const status = {\n platform: 'web',\n state,\n isLatest: state === 'latest',\n checkedAt: new Date().toISOString(),\n reason,\n currentVersion,\n currentMajorVersion,\n latestVersion,\n latestMajorVersion,\n currentVersionSharePercent,\n minimumDeviceSharePercent,\n versionShareSource: normalizedVersionShareByMajor ? versionShareSource : undefined,\n deviceShareError,\n updateUrl: options.updateUrl,\n source: (_b = options.source) !== null && _b !== void 0 ? _b : 'web-shim',\n };\n this.lastStatus = status;\n this.notifyListeners('statusChanged', status);\n if (state === 'latest') {\n this.notifyListeners('webViewLatest', status);\n }\n else if (state === 'outdated') {\n this.notifyListeners('webViewOutdated', status);\n if (options.showPromptOnOutdated || this.autoPromptOnOutdated) {\n await this.showUpdatePrompt({ updateUrl: status.updateUrl });\n }\n }\n return status;\n }\n async startMonitoring(options = {}) {\n var _a, _b, _c, _d;\n this.monitoring = true;\n this.checkOnResume = (_a = options.checkOnResume) !== null && _a !== void 0 ? _a : true;\n this.autoPromptOnOutdated = (_b = options.autoPromptOnOutdated) !== null && _b !== void 0 ? _b : false;\n if ((_c = options.checkOnStart) !== null && _c !== void 0 ? _c : true) {\n await this.check(Object.assign(Object.assign({}, options), { source: (_d = options.source) !== null && _d !== void 0 ? _d : 'startMonitoring' }));\n }\n return {\n monitoring: this.monitoring,\n checkOnResume: this.checkOnResume,\n autoPromptOnOutdated: this.autoPromptOnOutdated,\n };\n }\n async stopMonitoring() {\n this.monitoring = false;\n return {\n monitoring: this.monitoring,\n checkOnResume: this.checkOnResume,\n autoPromptOnOutdated: this.autoPromptOnOutdated,\n };\n }\n async getLastStatus() {\n return {\n status: this.lastStatus,\n };\n }\n async showUpdatePrompt(options = {}) {\n var _a, _b;\n const url = (_a = options.updateUrl) !== null && _a !== void 0 ? _a : (_b = this.lastStatus) === null || _b === void 0 ? void 0 : _b.updateUrl;\n if (!url) {\n return {\n shown: false,\n openedUpdatePage: false,\n };\n }\n const opened = this.openUrl(url);\n return {\n shown: true,\n openedUpdatePage: opened,\n };\n }\n async openUpdatePage(options = {}) {\n var _a, _b, _c;\n const url = (_c = (_a = options.updateUrl) !== null && _a !== void 0 ? _a : (_b = this.lastStatus) === null || _b === void 0 ? void 0 : _b.updateUrl) !== null && _c !== void 0 ? _c : '';\n if (!url) {\n return {\n opened: false,\n url,\n };\n }\n return {\n opened: this.openUrl(url),\n url,\n };\n }\n detectCurrentVersion() {\n const chromiumMatch = navigator.userAgent.match(/Chrome\\/([\\d.]+)/i);\n if (chromiumMatch === null || chromiumMatch === void 0 ? void 0 : chromiumMatch[1]) {\n return chromiumMatch[1];\n }\n const appleWebKitMatch = navigator.userAgent.match(/AppleWebKit\\/([\\d.]+)/i);\n if (appleWebKitMatch === null || appleWebKitMatch === void 0 ? void 0 : appleWebKitMatch[1]) {\n return appleWebKitMatch[1];\n }\n return navigator.userAgent;\n }\n openUrl(url) {\n try {\n window.open(url, '_blank', 'noopener,noreferrer');\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n parseMajorVersion(version) {\n if (!version) {\n return undefined;\n }\n const match = version.match(/(\\d+)/);\n if (!match) {\n return undefined;\n }\n const major = Number.parseInt(match[1], 10);\n return Number.isFinite(major) ? major : undefined;\n }\n compareVersions(left, right) {\n var _a, _b;\n const leftParts = left\n .split(/[^0-9]+/)\n .filter(Boolean)\n .map((part) => Number.parseInt(part, 10));\n const rightParts = right\n .split(/[^0-9]+/)\n .filter(Boolean)\n .map((part) => Number.parseInt(part, 10));\n const maxLength = Math.max(leftParts.length, rightParts.length);\n for (let i = 0; i < maxLength; i += 1) {\n const a = (_a = leftParts[i]) !== null && _a !== void 0 ? _a : 0;\n const b = (_b = rightParts[i]) !== null && _b !== void 0 ? _b : 0;\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n }\n return 0;\n }\n normalizePercent(value) {\n if (typeof value !== 'number' || Number.isNaN(value) || !Number.isFinite(value)) {\n return undefined;\n }\n return Math.min(100, Math.max(0, value));\n }\n normalizeVersionShareByMajor(shareByMajor) {\n if (!shareByMajor) {\n return undefined;\n }\n const normalized = {};\n for (const [rawKey, rawShare] of Object.entries(shareByMajor)) {\n const major = this.parseMajorVersion(rawKey);\n const share = this.normalizePercent(rawShare);\n if (typeof major === 'number' && typeof share === 'number') {\n normalized[major] = share;\n }\n }\n return Object.keys(normalized).length > 0 ? normalized : undefined;\n }\n resolveCurrentVersionSharePercent(currentMajorVersion, normalizedShareByMajor) {\n if (typeof currentMajorVersion !== 'number' || !normalizedShareByMajor) {\n return undefined;\n }\n return normalizedShareByMajor[currentMajorVersion];\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,qBAAqB,GAAGA,mBAAc,CAAC,uBAAuB,EAAE;AACtE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,wBAAwB,EAAE,CAAC;AAC5E,CAAC;;ACHD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iCAAiC,GAAG,8BAA8B;AAExE,MAAM,8BAA8B,GAAG;AAC9C,IAAI,GAAG,EAAE,QAAQ;AACjB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AACl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,CAAC,KAAK,CAAC,EAAE;AACzF,YAAY,OAAO,SAAS;AAC5B,QAAQ;AACR,QAAQ,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAChD,IAAI;AACJ,IAAI,4BAA4B,CAAC,YAAY,EAAE;AAC/C,QAAQ,IAAI,CAAC,YAAY,EAAE;AAC3B,YAAY,OAAO,SAAS;AAC5B,QAAQ;AACR,QAAQ,MAAM,UAAU,GAAG,EAAE;AAC7B,QAAQ,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AACvE,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC;AACxD,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;AACzD,YAAY,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACxE,gBAAgB,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK;AACzC,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,GAAG,SAAS;AAC1E,IAAI;AACJ,IAAI,iCAAiC,CAAC,mBAAmB,EAAE,sBAAsB,EAAE;AACnF,QAAQ,IAAI,OAAO,mBAAmB,KAAK,QAAQ,IAAI,CAAC,sBAAsB,EAAE;AAChF,YAAY,OAAO,SAAS;AAC5B,QAAQ;AACR,QAAQ,OAAO,sBAAsB,CAAC,mBAAmB,CAAC;AAC1D,IAAI;AACJ;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/generated-version-share.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst WebviewVersionChecker = registerPlugin('WebviewVersionChecker', {\n web: () => import('./web').then((m) => new m.WebviewVersionCheckerWeb()),\n});\nexport * from './definitions';\nexport { WebviewVersionChecker };\n//# sourceMappingURL=index.js.map","/* 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-06-16T03:32:51.778Z\n */\nexport const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';\nexport const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-06-16T03:32:51.778Z';\nexport const DEFAULT_VERSION_SHARE_BY_MAJOR = {\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//# sourceMappingURL=generated-version-share.js.map","import { WebPlugin } from '@capacitor/core';\nimport { DEFAULT_VERSION_SHARE_BY_MAJOR, DEFAULT_VERSION_SHARE_DATA_SOURCE } from './generated-version-share';\nconst UNKNOWN_REASON = 'Web implementation is a compatibility shim. Native Android/iOS implementations provide full WebView checks.';\nexport class WebviewVersionCheckerWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.monitoring = false;\n this.checkOnResume = true;\n this.autoPromptOnOutdated = false;\n this.lastStatus = null;\n }\n async check(options = {}) {\n var _a, _b;\n const currentVersion = this.detectCurrentVersion();\n const currentMajorVersion = this.parseMajorVersion(currentVersion);\n const latestVersion = options.latestVersion;\n const latestMajorVersion = this.parseMajorVersion(latestVersion);\n const minimumDeviceSharePercent = this.normalizePercent((_a = options.minimumDeviceSharePercent) !== null && _a !== void 0 ? _a : 3);\n const normalizedInlineVersionShareByMajor = this.normalizeVersionShareByMajor(options.versionShareByMajor);\n const normalizedGeneratedVersionShareByMajor = this.normalizeVersionShareByMajor(DEFAULT_VERSION_SHARE_BY_MAJOR);\n const normalizedVersionShareByMajor = normalizedInlineVersionShareByMajor !== null && normalizedInlineVersionShareByMajor !== void 0 ? normalizedInlineVersionShareByMajor : normalizedGeneratedVersionShareByMajor;\n const versionShareSource = normalizedInlineVersionShareByMajor\n ? 'versionShareByMajor'\n : DEFAULT_VERSION_SHARE_DATA_SOURCE;\n const currentVersionSharePercent = this.resolveCurrentVersionSharePercent(currentMajorVersion, normalizedVersionShareByMajor);\n let deviceShareError;\n let state = 'unknown';\n let reason = UNKNOWN_REASON;\n if (typeof minimumDeviceSharePercent === 'number') {\n if (typeof currentVersionSharePercent === 'number') {\n state = currentVersionSharePercent >= minimumDeviceSharePercent ? 'latest' : 'outdated';\n reason =\n state === 'latest'\n ? 'Current browser engine major version meets the configured device-share threshold.'\n : 'Current browser engine major version is below the configured device-share threshold.';\n }\n else if (!normalizedVersionShareByMajor && options.versionShareApiUrl) {\n deviceShareError =\n 'Web shim does not fetch version-share API data. Provide versionShareByMajor to evaluate minimumDeviceSharePercent.';\n }\n else if (!normalizedVersionShareByMajor) {\n deviceShareError = 'minimumDeviceSharePercent is set, but no versionShareByMajor dataset was provided.';\n }\n else {\n deviceShareError = 'No device-share entry was found for the current browser engine major version.';\n }\n }\n if (state === 'unknown' && latestVersion && currentVersion) {\n const cmp = this.compareVersions(currentVersion, latestVersion);\n state = cmp >= 0 ? 'latest' : 'outdated';\n reason =\n cmp >= 0\n ? 'Current browser engine is at or above the requested latest version.'\n : 'Current browser engine is below the requested latest version.';\n }\n else if (state === 'unknown' &&\n typeof options.minimumMajorVersion === 'number' &&\n typeof currentMajorVersion === 'number') {\n state = currentMajorVersion >= options.minimumMajorVersion ? 'latest' : 'outdated';\n reason =\n state === 'latest'\n ? 'Current browser engine major version meets the minimum requirement.'\n : 'Current browser engine major version is below the minimum requirement.';\n }\n else if (state === 'unknown' && deviceShareError) {\n reason = deviceShareError;\n }\n const status = {\n platform: 'web',\n state,\n isLatest: state === 'latest',\n checkedAt: new Date().toISOString(),\n reason,\n currentVersion,\n currentMajorVersion,\n latestVersion,\n latestMajorVersion,\n currentVersionSharePercent,\n minimumDeviceSharePercent,\n versionShareSource: normalizedVersionShareByMajor ? versionShareSource : undefined,\n deviceShareError,\n updateUrl: options.updateUrl,\n source: (_b = options.source) !== null && _b !== void 0 ? _b : 'web-shim',\n };\n this.lastStatus = status;\n this.notifyListeners('statusChanged', status);\n if (state === 'latest') {\n this.notifyListeners('webViewLatest', status);\n }\n else if (state === 'outdated') {\n this.notifyListeners('webViewOutdated', status);\n if (options.showPromptOnOutdated || this.autoPromptOnOutdated) {\n await this.showUpdatePrompt({ updateUrl: status.updateUrl });\n }\n }\n return status;\n }\n async startMonitoring(options = {}) {\n var _a, _b, _c, _d;\n this.monitoring = true;\n this.checkOnResume = (_a = options.checkOnResume) !== null && _a !== void 0 ? _a : true;\n this.autoPromptOnOutdated = (_b = options.autoPromptOnOutdated) !== null && _b !== void 0 ? _b : false;\n if ((_c = options.checkOnStart) !== null && _c !== void 0 ? _c : true) {\n await this.check(Object.assign(Object.assign({}, options), { source: (_d = options.source) !== null && _d !== void 0 ? _d : 'startMonitoring' }));\n }\n return {\n monitoring: this.monitoring,\n checkOnResume: this.checkOnResume,\n autoPromptOnOutdated: this.autoPromptOnOutdated,\n };\n }\n async stopMonitoring() {\n this.monitoring = false;\n return {\n monitoring: this.monitoring,\n checkOnResume: this.checkOnResume,\n autoPromptOnOutdated: this.autoPromptOnOutdated,\n };\n }\n async getLastStatus() {\n return {\n status: this.lastStatus,\n };\n }\n async showUpdatePrompt(options = {}) {\n var _a, _b;\n const url = (_a = options.updateUrl) !== null && _a !== void 0 ? _a : (_b = this.lastStatus) === null || _b === void 0 ? void 0 : _b.updateUrl;\n if (!url) {\n return {\n shown: false,\n openedUpdatePage: false,\n };\n }\n const opened = this.openUrl(url);\n return {\n shown: true,\n openedUpdatePage: opened,\n };\n }\n async openUpdatePage(options = {}) {\n var _a, _b, _c;\n const url = (_c = (_a = options.updateUrl) !== null && _a !== void 0 ? _a : (_b = this.lastStatus) === null || _b === void 0 ? void 0 : _b.updateUrl) !== null && _c !== void 0 ? _c : '';\n if (!url) {\n return {\n opened: false,\n url,\n };\n }\n return {\n opened: this.openUrl(url),\n url,\n };\n }\n detectCurrentVersion() {\n const chromiumMatch = navigator.userAgent.match(/Chrome\\/([\\d.]+)/i);\n if (chromiumMatch === null || chromiumMatch === void 0 ? void 0 : chromiumMatch[1]) {\n return chromiumMatch[1];\n }\n const appleWebKitMatch = navigator.userAgent.match(/AppleWebKit\\/([\\d.]+)/i);\n if (appleWebKitMatch === null || appleWebKitMatch === void 0 ? void 0 : appleWebKitMatch[1]) {\n return appleWebKitMatch[1];\n }\n return navigator.userAgent;\n }\n openUrl(url) {\n try {\n window.open(url, '_blank', 'noopener,noreferrer');\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n parseMajorVersion(version) {\n if (!version) {\n return undefined;\n }\n const match = version.match(/(\\d+)/);\n if (!match) {\n return undefined;\n }\n const major = Number.parseInt(match[1], 10);\n return Number.isFinite(major) ? major : undefined;\n }\n compareVersions(left, right) {\n var _a, _b;\n const leftParts = left\n .split(/[^0-9]+/)\n .filter(Boolean)\n .map((part) => Number.parseInt(part, 10));\n const rightParts = right\n .split(/[^0-9]+/)\n .filter(Boolean)\n .map((part) => Number.parseInt(part, 10));\n const maxLength = Math.max(leftParts.length, rightParts.length);\n for (let i = 0; i < maxLength; i += 1) {\n const a = (_a = leftParts[i]) !== null && _a !== void 0 ? _a : 0;\n const b = (_b = rightParts[i]) !== null && _b !== void 0 ? _b : 0;\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n }\n return 0;\n }\n normalizePercent(value) {\n if (typeof value !== 'number' || Number.isNaN(value) || !Number.isFinite(value)) {\n return undefined;\n }\n return Math.min(100, Math.max(0, value));\n }\n normalizeVersionShareByMajor(shareByMajor) {\n if (!shareByMajor) {\n return undefined;\n }\n const normalized = {};\n for (const [rawKey, rawShare] of Object.entries(shareByMajor)) {\n const major = this.parseMajorVersion(rawKey);\n const share = this.normalizePercent(rawShare);\n if (typeof major === 'number' && typeof share === 'number') {\n normalized[major] = share;\n }\n }\n return Object.keys(normalized).length > 0 ? normalized : undefined;\n }\n resolveCurrentVersionSharePercent(currentMajorVersion, normalizedShareByMajor) {\n if (typeof currentMajorVersion !== 'number' || !normalizedShareByMajor) {\n return undefined;\n }\n return normalizedShareByMajor[currentMajorVersion];\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,qBAAqB,GAAGA,mBAAc,CAAC,uBAAuB,EAAE;AACtE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,wBAAwB,EAAE,CAAC;AAC5E,CAAC;;ACHD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iCAAiC,GAAG,8BAA8B;AAExE,MAAM,8BAA8B,GAAG;AAC9C,IAAI,GAAG,EAAE,QAAQ;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI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I,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAChD,IAAI;AACJ,IAAI,4BAA4B,CAAC,YAAY,EAAE;AAC/C,QAAQ,IAAI,CAAC,YAAY,EAAE;AAC3B,YAAY,OAAO,SAAS;AAC5B,QAAQ;AACR,QAAQ,MAAM,UAAU,GAAG,EAAE;AAC7B,QAAQ,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AACvE,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC;AACxD,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;AACzD,YAAY,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACxE,gBAAgB,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK;AACzC,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,GAAG,SAAS;AAC1E,IAAI;AACJ,IAAI,iCAAiC,CAAC,mBAAmB,EAAE,sBAAsB,EAAE;AACnF,QAAQ,IAAI,OAAO,mBAAmB,KAAK,QAAQ,IAAI,CAAC,sBAAsB,EAAE;AAChF,YAAY,OAAO,SAAS;AAC5B,QAAQ;AACR,QAAQ,OAAO,sBAAsB,CAAC,mBAAmB,CAAC;AAC1D,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -10,92 +10,95 @@ var capacitorWebviewVersionChecker = (function (exports, core) {
|
|
|
10
10
|
* AUTO-GENERATED FILE. DO NOT EDIT.
|
|
11
11
|
* Generated by: scripts/generate-version-share-data.mjs
|
|
12
12
|
* Source: https://raw.githubusercontent.com/Fyrd/caniuse/main/data.json
|
|
13
|
-
* Generated at: 2026-
|
|
13
|
+
* Generated at: 2026-06-16T03:32:51.778Z
|
|
14
14
|
*/
|
|
15
15
|
const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';
|
|
16
16
|
const DEFAULT_VERSION_SHARE_BY_MAJOR = {
|
|
17
|
-
"4": 0.
|
|
18
|
-
"39": 0.
|
|
19
|
-
"40": 0.
|
|
20
|
-
"41": 0.
|
|
21
|
-
"42": 0.
|
|
22
|
-
"43": 0.
|
|
23
|
-
"44": 0.
|
|
24
|
-
"45": 0.
|
|
25
|
-
"46": 0.
|
|
26
|
-
"47": 0.
|
|
27
|
-
"48": 0.
|
|
28
|
-
"49": 0.
|
|
29
|
-
"50": 0.
|
|
30
|
-
"51": 0.
|
|
31
|
-
"52": 0.
|
|
32
|
-
"53": 0.
|
|
33
|
-
"54": 0.
|
|
34
|
-
"55": 0.
|
|
35
|
-
"56": 0.
|
|
36
|
-
"57": 0.
|
|
37
|
-
"58": 0.
|
|
38
|
-
"59": 0.
|
|
39
|
-
"60": 0.
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"86": 0.
|
|
45
|
-
"87": 0.
|
|
46
|
-
"91": 0.
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"97": 0.
|
|
50
|
-
"98": 0.
|
|
51
|
-
"99": 0.
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
17
|
+
"4": 0.000031,
|
|
18
|
+
"39": 0.08685,
|
|
19
|
+
"40": 0.08685,
|
|
20
|
+
"41": 0.08685,
|
|
21
|
+
"42": 0.08685,
|
|
22
|
+
"43": 0.08685,
|
|
23
|
+
"44": 0.08685,
|
|
24
|
+
"45": 0.091675,
|
|
25
|
+
"46": 0.08685,
|
|
26
|
+
"47": 0.08685,
|
|
27
|
+
"48": 0.091675,
|
|
28
|
+
"49": 0.091675,
|
|
29
|
+
"50": 0.08685,
|
|
30
|
+
"51": 0.08685,
|
|
31
|
+
"52": 0.091675,
|
|
32
|
+
"53": 0.08685,
|
|
33
|
+
"54": 0.08685,
|
|
34
|
+
"55": 0.08685,
|
|
35
|
+
"56": 0.08685,
|
|
36
|
+
"57": 0.08685,
|
|
37
|
+
"58": 0.08685,
|
|
38
|
+
"59": 0.08685,
|
|
39
|
+
"60": 0.08685,
|
|
40
|
+
"66": 0.004825,
|
|
41
|
+
"69": 0.004825,
|
|
42
|
+
"70": 0.024125,
|
|
43
|
+
"79": 0.02895,
|
|
44
|
+
"86": 0.004825,
|
|
45
|
+
"87": 0.014475,
|
|
46
|
+
"91": 0.00965,
|
|
47
|
+
"93": 0.014475,
|
|
48
|
+
"96": 0.004825,
|
|
49
|
+
"97": 0.004825,
|
|
50
|
+
"98": 0.02895,
|
|
51
|
+
"99": 0.014475,
|
|
52
|
+
"100": 0.00965,
|
|
53
|
+
"101": 0.00965,
|
|
54
|
+
"102": 0.004825,
|
|
55
|
+
"103": 0.303975,
|
|
56
|
+
"104": 0.2509,
|
|
57
|
+
"105": 0.236425,
|
|
58
|
+
"106": 0.236425,
|
|
59
|
+
"107": 0.236425,
|
|
60
|
+
"108": 0.246075,
|
|
61
|
+
"109": 0.7334,
|
|
62
|
+
"110": 0.24125,
|
|
63
|
+
"111": 0.2895,
|
|
64
|
+
"112": 0.902275,
|
|
65
|
+
"114": 0.024125,
|
|
66
|
+
"115": 0.00965,
|
|
67
|
+
"116": 0.516275,
|
|
68
|
+
"117": 0.284675,
|
|
69
|
+
"118": 1.1773,
|
|
70
|
+
"119": 0.02895,
|
|
71
|
+
"120": 0.294325,
|
|
72
|
+
"121": 0.024125,
|
|
73
|
+
"122": 0.033775,
|
|
74
|
+
"123": 0.033775,
|
|
75
|
+
"124": 0.27985,
|
|
76
|
+
"125": 0.5211,
|
|
77
|
+
"126": 0.0386,
|
|
78
|
+
"127": 0.0193,
|
|
79
|
+
"128": 0.053075,
|
|
80
|
+
"129": 0.0193,
|
|
81
|
+
"130": 0.062725,
|
|
82
|
+
"131": 0.564525,
|
|
83
|
+
"132": 0.04825,
|
|
84
|
+
"133": 0.516275,
|
|
85
|
+
"134": 0.04825,
|
|
86
|
+
"135": 0.0386,
|
|
87
|
+
"136": 0.043425,
|
|
88
|
+
"137": 0.082025,
|
|
89
|
+
"138": 0.159225,
|
|
90
|
+
"139": 0.101325,
|
|
91
|
+
"140": 0.0772,
|
|
92
|
+
"141": 0.0579,
|
|
93
|
+
"142": 0.902275,
|
|
94
|
+
"143": 0.110975,
|
|
95
|
+
"144": 0.29915,
|
|
96
|
+
"145": 0.863675,
|
|
97
|
+
"146": 0.583825,
|
|
98
|
+
"147": 6.10362,
|
|
99
|
+
"148": 8.41963,
|
|
100
|
+
"149": 42.196,
|
|
101
|
+
"150": 0.00965
|
|
99
102
|
};
|
|
100
103
|
|
|
101
104
|
const UNKNOWN_REASON = 'Web implementation is a compatibility shim. Native Android/iOS implementations provide full WebView checks.';
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/generated-version-share.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst WebviewVersionChecker = registerPlugin('WebviewVersionChecker', {\n web: () => import('./web').then((m) => new m.WebviewVersionCheckerWeb()),\n});\nexport * from './definitions';\nexport { WebviewVersionChecker };\n//# sourceMappingURL=index.js.map","/* 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-04-08T12:26:06.910Z\n */\nexport const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';\nexport const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-04-08T12:26:06.910Z';\nexport const DEFAULT_VERSION_SHARE_BY_MAJOR = {\n \"4\": 0.000026,\n \"39\": 0.034656,\n \"40\": 0.034656,\n \"41\": 0.034656,\n \"42\": 0.034656,\n \"43\": 0.034656,\n \"44\": 0.034656,\n \"45\": 0.034656,\n \"46\": 0.034656,\n \"47\": 0.034656,\n \"48\": 0.038988,\n \"49\": 0.04332,\n \"50\": 0.034656,\n \"51\": 0.034656,\n \"52\": 0.034656,\n \"53\": 0.034656,\n \"54\": 0.034656,\n \"55\": 0.034656,\n \"56\": 0.034656,\n \"57\": 0.034656,\n \"58\": 0.034656,\n \"59\": 0.034656,\n \"60\": 0.034656,\n \"69\": 0.004332,\n \"77\": 0.034656,\n \"79\": 0.008664,\n \"80\": 0.004332,\n \"86\": 0.008664,\n \"87\": 0.008664,\n \"91\": 0.004332,\n \"92\": 0.004332,\n \"93\": 0.008664,\n \"97\": 0.008664,\n \"98\": 0.004332,\n \"99\": 0.004332,\n \"101\": 0.008664,\n \"102\": 0.004332,\n \"103\": 0.121296,\n \"104\": 0.06498,\n \"105\": 0.06498,\n \"106\": 0.06498,\n \"107\": 0.06498,\n \"108\": 0.069312,\n \"109\": 0.645468,\n \"110\": 0.06498,\n \"111\": 0.06498,\n \"112\": 0.142956,\n \"114\": 0.025992,\n \"115\": 0.008664,\n \"116\": 0.17328,\n \"117\": 0.069312,\n \"118\": 0.008664,\n \"119\": 0.017328,\n \"120\": 0.08664,\n \"121\": 0.017328,\n \"122\": 0.038988,\n \"123\": 0.012996,\n \"124\": 0.082308,\n \"125\": 0.02166,\n \"126\": 0.038988,\n \"127\": 0.012996,\n \"128\": 0.056316,\n \"129\": 0.012996,\n \"130\": 0.060648,\n \"131\": 0.229596,\n \"132\": 0.034656,\n \"133\": 0.147288,\n \"134\": 0.047652,\n \"135\": 0.051984,\n \"136\": 0.04332,\n \"137\": 0.047652,\n \"138\": 0.212268,\n \"139\": 0.34656,\n \"140\": 0.073644,\n \"141\": 0.082308,\n \"142\": 0.207936,\n \"143\": 0.320568,\n \"144\": 0.940044,\n \"145\": 9.30947,\n \"146\": 6.96152,\n \"147\": 44.7569,\n \"148\": 0.004332\n};\n//# sourceMappingURL=generated-version-share.js.map","import { WebPlugin } from '@capacitor/core';\nimport { DEFAULT_VERSION_SHARE_BY_MAJOR, DEFAULT_VERSION_SHARE_DATA_SOURCE } from './generated-version-share';\nconst UNKNOWN_REASON = 'Web implementation is a compatibility shim. Native Android/iOS implementations provide full WebView checks.';\nexport class WebviewVersionCheckerWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.monitoring = false;\n this.checkOnResume = true;\n this.autoPromptOnOutdated = false;\n this.lastStatus = null;\n }\n async check(options = {}) {\n var _a, _b;\n const currentVersion = this.detectCurrentVersion();\n const currentMajorVersion = this.parseMajorVersion(currentVersion);\n const latestVersion = options.latestVersion;\n const latestMajorVersion = this.parseMajorVersion(latestVersion);\n const minimumDeviceSharePercent = this.normalizePercent((_a = options.minimumDeviceSharePercent) !== null && _a !== void 0 ? _a : 3);\n const normalizedInlineVersionShareByMajor = this.normalizeVersionShareByMajor(options.versionShareByMajor);\n const normalizedGeneratedVersionShareByMajor = this.normalizeVersionShareByMajor(DEFAULT_VERSION_SHARE_BY_MAJOR);\n const normalizedVersionShareByMajor = normalizedInlineVersionShareByMajor !== null && normalizedInlineVersionShareByMajor !== void 0 ? normalizedInlineVersionShareByMajor : normalizedGeneratedVersionShareByMajor;\n const versionShareSource = normalizedInlineVersionShareByMajor\n ? 'versionShareByMajor'\n : DEFAULT_VERSION_SHARE_DATA_SOURCE;\n const currentVersionSharePercent = this.resolveCurrentVersionSharePercent(currentMajorVersion, normalizedVersionShareByMajor);\n let deviceShareError;\n let state = 'unknown';\n let reason = UNKNOWN_REASON;\n if (typeof minimumDeviceSharePercent === 'number') {\n if (typeof currentVersionSharePercent === 'number') {\n state = currentVersionSharePercent >= minimumDeviceSharePercent ? 'latest' : 'outdated';\n reason =\n state === 'latest'\n ? 'Current browser engine major version meets the configured device-share threshold.'\n : 'Current browser engine major version is below the configured device-share threshold.';\n }\n else if (!normalizedVersionShareByMajor && options.versionShareApiUrl) {\n deviceShareError =\n 'Web shim does not fetch version-share API data. Provide versionShareByMajor to evaluate minimumDeviceSharePercent.';\n }\n else if (!normalizedVersionShareByMajor) {\n deviceShareError = 'minimumDeviceSharePercent is set, but no versionShareByMajor dataset was provided.';\n }\n else {\n deviceShareError = 'No device-share entry was found for the current browser engine major version.';\n }\n }\n if (state === 'unknown' && latestVersion && currentVersion) {\n const cmp = this.compareVersions(currentVersion, latestVersion);\n state = cmp >= 0 ? 'latest' : 'outdated';\n reason =\n cmp >= 0\n ? 'Current browser engine is at or above the requested latest version.'\n : 'Current browser engine is below the requested latest version.';\n }\n else if (state === 'unknown' &&\n typeof options.minimumMajorVersion === 'number' &&\n typeof currentMajorVersion === 'number') {\n state = currentMajorVersion >= options.minimumMajorVersion ? 'latest' : 'outdated';\n reason =\n state === 'latest'\n ? 'Current browser engine major version meets the minimum requirement.'\n : 'Current browser engine major version is below the minimum requirement.';\n }\n else if (state === 'unknown' && deviceShareError) {\n reason = deviceShareError;\n }\n const status = {\n platform: 'web',\n state,\n isLatest: state === 'latest',\n checkedAt: new Date().toISOString(),\n reason,\n currentVersion,\n currentMajorVersion,\n latestVersion,\n latestMajorVersion,\n currentVersionSharePercent,\n minimumDeviceSharePercent,\n versionShareSource: normalizedVersionShareByMajor ? versionShareSource : undefined,\n deviceShareError,\n updateUrl: options.updateUrl,\n source: (_b = options.source) !== null && _b !== void 0 ? _b : 'web-shim',\n };\n this.lastStatus = status;\n this.notifyListeners('statusChanged', status);\n if (state === 'latest') {\n this.notifyListeners('webViewLatest', status);\n }\n else if (state === 'outdated') {\n this.notifyListeners('webViewOutdated', status);\n if (options.showPromptOnOutdated || this.autoPromptOnOutdated) {\n await this.showUpdatePrompt({ updateUrl: status.updateUrl });\n }\n }\n return status;\n }\n async startMonitoring(options = {}) {\n var _a, _b, _c, _d;\n this.monitoring = true;\n this.checkOnResume = (_a = options.checkOnResume) !== null && _a !== void 0 ? _a : true;\n this.autoPromptOnOutdated = (_b = options.autoPromptOnOutdated) !== null && _b !== void 0 ? _b : false;\n if ((_c = options.checkOnStart) !== null && _c !== void 0 ? _c : true) {\n await this.check(Object.assign(Object.assign({}, options), { source: (_d = options.source) !== null && _d !== void 0 ? _d : 'startMonitoring' }));\n }\n return {\n monitoring: this.monitoring,\n checkOnResume: this.checkOnResume,\n autoPromptOnOutdated: this.autoPromptOnOutdated,\n };\n }\n async stopMonitoring() {\n this.monitoring = false;\n return {\n monitoring: this.monitoring,\n checkOnResume: this.checkOnResume,\n autoPromptOnOutdated: this.autoPromptOnOutdated,\n };\n }\n async getLastStatus() {\n return {\n status: this.lastStatus,\n };\n }\n async showUpdatePrompt(options = {}) {\n var _a, _b;\n const url = (_a = options.updateUrl) !== null && _a !== void 0 ? _a : (_b = this.lastStatus) === null || _b === void 0 ? void 0 : _b.updateUrl;\n if (!url) {\n return {\n shown: false,\n openedUpdatePage: false,\n };\n }\n const opened = this.openUrl(url);\n return {\n shown: true,\n openedUpdatePage: opened,\n };\n }\n async openUpdatePage(options = {}) {\n var _a, _b, _c;\n const url = (_c = (_a = options.updateUrl) !== null && _a !== void 0 ? _a : (_b = this.lastStatus) === null || _b === void 0 ? void 0 : _b.updateUrl) !== null && _c !== void 0 ? _c : '';\n if (!url) {\n return {\n opened: false,\n url,\n };\n }\n return {\n opened: this.openUrl(url),\n url,\n };\n }\n detectCurrentVersion() {\n const chromiumMatch = navigator.userAgent.match(/Chrome\\/([\\d.]+)/i);\n if (chromiumMatch === null || chromiumMatch === void 0 ? void 0 : chromiumMatch[1]) {\n return chromiumMatch[1];\n }\n const appleWebKitMatch = navigator.userAgent.match(/AppleWebKit\\/([\\d.]+)/i);\n if (appleWebKitMatch === null || appleWebKitMatch === void 0 ? void 0 : appleWebKitMatch[1]) {\n return appleWebKitMatch[1];\n }\n return navigator.userAgent;\n }\n openUrl(url) {\n try {\n window.open(url, '_blank', 'noopener,noreferrer');\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n parseMajorVersion(version) {\n if (!version) {\n return undefined;\n }\n const match = version.match(/(\\d+)/);\n if (!match) {\n return undefined;\n }\n const major = Number.parseInt(match[1], 10);\n return Number.isFinite(major) ? major : undefined;\n }\n compareVersions(left, right) {\n var _a, _b;\n const leftParts = left\n .split(/[^0-9]+/)\n .filter(Boolean)\n .map((part) => Number.parseInt(part, 10));\n const rightParts = right\n .split(/[^0-9]+/)\n .filter(Boolean)\n .map((part) => Number.parseInt(part, 10));\n const maxLength = Math.max(leftParts.length, rightParts.length);\n for (let i = 0; i < maxLength; i += 1) {\n const a = (_a = leftParts[i]) !== null && _a !== void 0 ? _a : 0;\n const b = (_b = rightParts[i]) !== null && _b !== void 0 ? _b : 0;\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n }\n return 0;\n }\n normalizePercent(value) {\n if (typeof value !== 'number' || Number.isNaN(value) || !Number.isFinite(value)) {\n return undefined;\n }\n return Math.min(100, Math.max(0, value));\n }\n normalizeVersionShareByMajor(shareByMajor) {\n if (!shareByMajor) {\n return undefined;\n }\n const normalized = {};\n for (const [rawKey, rawShare] of Object.entries(shareByMajor)) {\n const major = this.parseMajorVersion(rawKey);\n const share = this.normalizePercent(rawShare);\n if (typeof major === 'number' && typeof share === 'number') {\n normalized[major] = share;\n }\n }\n return Object.keys(normalized).length > 0 ? normalized : undefined;\n }\n resolveCurrentVersionSharePercent(currentMajorVersion, normalizedShareByMajor) {\n if (typeof currentMajorVersion !== 'number' || !normalizedShareByMajor) {\n return undefined;\n }\n return normalizedShareByMajor[currentMajorVersion];\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,qBAAqB,GAAGA,mBAAc,CAAC,uBAAuB,EAAE;IACtE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,wBAAwB,EAAE,CAAC;IAC5E,CAAC;;ICHD;IACA;IACA;IACA;IACA;IACA;IACA;IACO,MAAM,iCAAiC,GAAG,8BAA8B;IAExE,MAAM,8BAA8B,GAAG;IAC9C,IAAI,GAAG,EAAE,QAAQ;IACjB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QA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E;IACzF,YAAY,OAAO,SAAS;IAC5B,QAAQ;IACR,QAAQ,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAChD,IAAI;IACJ,IAAI,4BAA4B,CAAC,YAAY,EAAE;IAC/C,QAAQ,IAAI,CAAC,YAAY,EAAE;IAC3B,YAAY,OAAO,SAAS;IAC5B,QAAQ;IACR,QAAQ,MAAM,UAAU,GAAG,EAAE;IAC7B,QAAQ,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;IACvE,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC;IACxD,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;IACzD,YAAY,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IACxE,gBAAgB,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK;IACzC,YAAY;IACZ,QAAQ;IACR,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,GAAG,SAAS;IAC1E,IAAI;IACJ,IAAI,iCAAiC,CAAC,mBAAmB,EAAE,sBAAsB,EAAE;IACnF,QAAQ,IAAI,OAAO,mBAAmB,KAAK,QAAQ,IAAI,CAAC,sBAAsB,EAAE;IAChF,YAAY,OAAO,SAAS;IAC5B,QAAQ;IACR,QAAQ,OAAO,sBAAsB,CAAC,mBAAmB,CAAC;IAC1D,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/generated-version-share.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst WebviewVersionChecker = registerPlugin('WebviewVersionChecker', {\n web: () => import('./web').then((m) => new m.WebviewVersionCheckerWeb()),\n});\nexport * from './definitions';\nexport { WebviewVersionChecker };\n//# sourceMappingURL=index.js.map","/* 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-06-16T03:32:51.778Z\n */\nexport const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';\nexport const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-06-16T03:32:51.778Z';\nexport const DEFAULT_VERSION_SHARE_BY_MAJOR = {\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//# sourceMappingURL=generated-version-share.js.map","import { WebPlugin } from '@capacitor/core';\nimport { DEFAULT_VERSION_SHARE_BY_MAJOR, DEFAULT_VERSION_SHARE_DATA_SOURCE } from './generated-version-share';\nconst UNKNOWN_REASON = 'Web implementation is a compatibility shim. Native Android/iOS implementations provide full WebView checks.';\nexport class WebviewVersionCheckerWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.monitoring = false;\n this.checkOnResume = true;\n this.autoPromptOnOutdated = false;\n this.lastStatus = null;\n }\n async check(options = {}) {\n var _a, _b;\n const currentVersion = this.detectCurrentVersion();\n const currentMajorVersion = this.parseMajorVersion(currentVersion);\n const latestVersion = options.latestVersion;\n const latestMajorVersion = this.parseMajorVersion(latestVersion);\n const minimumDeviceSharePercent = this.normalizePercent((_a = options.minimumDeviceSharePercent) !== null && _a !== void 0 ? _a : 3);\n const normalizedInlineVersionShareByMajor = this.normalizeVersionShareByMajor(options.versionShareByMajor);\n const normalizedGeneratedVersionShareByMajor = this.normalizeVersionShareByMajor(DEFAULT_VERSION_SHARE_BY_MAJOR);\n const normalizedVersionShareByMajor = normalizedInlineVersionShareByMajor !== null && normalizedInlineVersionShareByMajor !== void 0 ? normalizedInlineVersionShareByMajor : normalizedGeneratedVersionShareByMajor;\n const versionShareSource = normalizedInlineVersionShareByMajor\n ? 'versionShareByMajor'\n : DEFAULT_VERSION_SHARE_DATA_SOURCE;\n const currentVersionSharePercent = this.resolveCurrentVersionSharePercent(currentMajorVersion, normalizedVersionShareByMajor);\n let deviceShareError;\n let state = 'unknown';\n let reason = UNKNOWN_REASON;\n if (typeof minimumDeviceSharePercent === 'number') {\n if (typeof currentVersionSharePercent === 'number') {\n state = currentVersionSharePercent >= minimumDeviceSharePercent ? 'latest' : 'outdated';\n reason =\n state === 'latest'\n ? 'Current browser engine major version meets the configured device-share threshold.'\n : 'Current browser engine major version is below the configured device-share threshold.';\n }\n else if (!normalizedVersionShareByMajor && options.versionShareApiUrl) {\n deviceShareError =\n 'Web shim does not fetch version-share API data. Provide versionShareByMajor to evaluate minimumDeviceSharePercent.';\n }\n else if (!normalizedVersionShareByMajor) {\n deviceShareError = 'minimumDeviceSharePercent is set, but no versionShareByMajor dataset was provided.';\n }\n else {\n deviceShareError = 'No device-share entry was found for the current browser engine major version.';\n }\n }\n if (state === 'unknown' && latestVersion && currentVersion) {\n const cmp = this.compareVersions(currentVersion, latestVersion);\n state = cmp >= 0 ? 'latest' : 'outdated';\n reason =\n cmp >= 0\n ? 'Current browser engine is at or above the requested latest version.'\n : 'Current browser engine is below the requested latest version.';\n }\n else if (state === 'unknown' &&\n typeof options.minimumMajorVersion === 'number' &&\n typeof currentMajorVersion === 'number') {\n state = currentMajorVersion >= options.minimumMajorVersion ? 'latest' : 'outdated';\n reason =\n state === 'latest'\n ? 'Current browser engine major version meets the minimum requirement.'\n : 'Current browser engine major version is below the minimum requirement.';\n }\n else if (state === 'unknown' && deviceShareError) {\n reason = deviceShareError;\n }\n const status = {\n platform: 'web',\n state,\n isLatest: state === 'latest',\n checkedAt: new Date().toISOString(),\n reason,\n currentVersion,\n currentMajorVersion,\n latestVersion,\n latestMajorVersion,\n currentVersionSharePercent,\n minimumDeviceSharePercent,\n versionShareSource: normalizedVersionShareByMajor ? versionShareSource : undefined,\n deviceShareError,\n updateUrl: options.updateUrl,\n source: (_b = options.source) !== null && _b !== void 0 ? _b : 'web-shim',\n };\n this.lastStatus = status;\n this.notifyListeners('statusChanged', status);\n if (state === 'latest') {\n this.notifyListeners('webViewLatest', status);\n }\n else if (state === 'outdated') {\n this.notifyListeners('webViewOutdated', status);\n if (options.showPromptOnOutdated || this.autoPromptOnOutdated) {\n await this.showUpdatePrompt({ updateUrl: status.updateUrl });\n }\n }\n return status;\n }\n async startMonitoring(options = {}) {\n var _a, _b, _c, _d;\n this.monitoring = true;\n this.checkOnResume = (_a = options.checkOnResume) !== null && _a !== void 0 ? _a : true;\n this.autoPromptOnOutdated = (_b = options.autoPromptOnOutdated) !== null && _b !== void 0 ? _b : false;\n if ((_c = options.checkOnStart) !== null && _c !== void 0 ? _c : true) {\n await this.check(Object.assign(Object.assign({}, options), { source: (_d = options.source) !== null && _d !== void 0 ? _d : 'startMonitoring' }));\n }\n return {\n monitoring: this.monitoring,\n checkOnResume: this.checkOnResume,\n autoPromptOnOutdated: this.autoPromptOnOutdated,\n };\n }\n async stopMonitoring() {\n this.monitoring = false;\n return {\n monitoring: this.monitoring,\n checkOnResume: this.checkOnResume,\n autoPromptOnOutdated: this.autoPromptOnOutdated,\n };\n }\n async getLastStatus() {\n return {\n status: this.lastStatus,\n };\n }\n async showUpdatePrompt(options = {}) {\n var _a, _b;\n const url = (_a = options.updateUrl) !== null && _a !== void 0 ? _a : (_b = this.lastStatus) === null || _b === void 0 ? void 0 : _b.updateUrl;\n if (!url) {\n return {\n shown: false,\n openedUpdatePage: false,\n };\n }\n const opened = this.openUrl(url);\n return {\n shown: true,\n openedUpdatePage: opened,\n };\n }\n async openUpdatePage(options = {}) {\n var _a, _b, _c;\n const url = (_c = (_a = options.updateUrl) !== null && _a !== void 0 ? _a : (_b = this.lastStatus) === null || _b === void 0 ? void 0 : _b.updateUrl) !== null && _c !== void 0 ? _c : '';\n if (!url) {\n return {\n opened: false,\n url,\n };\n }\n return {\n opened: this.openUrl(url),\n url,\n };\n }\n detectCurrentVersion() {\n const chromiumMatch = navigator.userAgent.match(/Chrome\\/([\\d.]+)/i);\n if (chromiumMatch === null || chromiumMatch === void 0 ? void 0 : chromiumMatch[1]) {\n return chromiumMatch[1];\n }\n const appleWebKitMatch = navigator.userAgent.match(/AppleWebKit\\/([\\d.]+)/i);\n if (appleWebKitMatch === null || appleWebKitMatch === void 0 ? void 0 : appleWebKitMatch[1]) {\n return appleWebKitMatch[1];\n }\n return navigator.userAgent;\n }\n openUrl(url) {\n try {\n window.open(url, '_blank', 'noopener,noreferrer');\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n parseMajorVersion(version) {\n if (!version) {\n return undefined;\n }\n const match = version.match(/(\\d+)/);\n if (!match) {\n return undefined;\n }\n const major = Number.parseInt(match[1], 10);\n return Number.isFinite(major) ? major : undefined;\n }\n compareVersions(left, right) {\n var _a, _b;\n const leftParts = left\n .split(/[^0-9]+/)\n .filter(Boolean)\n .map((part) => Number.parseInt(part, 10));\n const rightParts = right\n .split(/[^0-9]+/)\n .filter(Boolean)\n .map((part) => Number.parseInt(part, 10));\n const maxLength = Math.max(leftParts.length, rightParts.length);\n for (let i = 0; i < maxLength; i += 1) {\n const a = (_a = leftParts[i]) !== null && _a !== void 0 ? _a : 0;\n const b = (_b = rightParts[i]) !== null && _b !== void 0 ? _b : 0;\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n }\n return 0;\n }\n normalizePercent(value) {\n if (typeof value !== 'number' || Number.isNaN(value) || !Number.isFinite(value)) {\n return undefined;\n }\n return Math.min(100, Math.max(0, value));\n }\n normalizeVersionShareByMajor(shareByMajor) {\n if (!shareByMajor) {\n return undefined;\n }\n const normalized = {};\n for (const [rawKey, rawShare] of Object.entries(shareByMajor)) {\n const major = this.parseMajorVersion(rawKey);\n const share = this.normalizePercent(rawShare);\n if (typeof major === 'number' && typeof share === 'number') {\n normalized[major] = share;\n }\n }\n return Object.keys(normalized).length > 0 ? normalized : undefined;\n }\n resolveCurrentVersionSharePercent(currentMajorVersion, normalizedShareByMajor) {\n if (typeof currentMajorVersion !== 'number' || !normalizedShareByMajor) {\n return undefined;\n }\n return normalizedShareByMajor[currentMajorVersion];\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,qBAAqB,GAAGA,mBAAc,CAAC,uBAAuB,EAAE;IACtE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,wBAAwB,EAAE,CAAC;IAC5E,CAAC;;ICHD;IACA;IACA;IACA;IACA;IACA;IACA;IACO,MAAM,iCAAiC,GAAG,8BAA8B;IAExE,MAAM,8BAA8B,GAAG;IAC9C,IAAI,GAAG,EAAE,QAAQ;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,QAAQ;IAClB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IACjB,IAAI,IAAI,EAAE,OAAO;IAC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AAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAChD,IAAI;IACJ,IAAI,4BAA4B,CAAC,YAAY,EAAE;IAC/C,QAAQ,IAAI,CAAC,YAAY,EAAE;IAC3B,YAAY,OAAO,SAAS;IAC5B,QAAQ;IACR,QAAQ,MAAM,UAAU,GAAG,EAAE;IAC7B,QAAQ,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;IACvE,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC;IACxD,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;IACzD,YAAY,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IACxE,gBAAgB,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK;IACzC,YAAY;IACZ,QAAQ;IACR,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,GAAG,SAAS;IAC1E,IAAI;IACJ,IAAI,iCAAiC,CAAC,mBAAmB,EAAE,sBAAsB,EAAE;IACnF,QAAQ,IAAI,OAAO,mBAAmB,KAAK,QAAQ,IAAI,CAAC,sBAAsB,EAAE;IAChF,YAAY,OAAO,SAAS;IAC5B,QAAQ;IACR,QAAQ,OAAO,sBAAsB,CAAC,mBAAmB,CAAC;IAC1D,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-webview-version-checker",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.3",
|
|
4
4
|
"description": "Capacitor plugin for checking outdated Android WebView engines, emitting status events, and presenting native update prompts.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"ios/Sources",
|
|
14
14
|
"ios/Tests",
|
|
15
15
|
"Package.swift",
|
|
16
|
-
"CapgoCapacitorWebviewVersionChecker.podspec"
|
|
16
|
+
"CapgoCapacitorWebviewVersionChecker.podspec",
|
|
17
|
+
"scripts/generate-version-share-data.mjs",
|
|
18
|
+
"src/generated-version-share.ts"
|
|
17
19
|
],
|
|
18
20
|
"author": "Martin Donadieu <martin@capgo.app>",
|
|
19
21
|
"license": "MPL-2.0",
|
|
@@ -50,7 +52,10 @@
|
|
|
50
52
|
"prepublishOnly": "bun run build",
|
|
51
53
|
"capacitor:sync:before": "node scripts/generate-version-share-data.mjs",
|
|
52
54
|
"capacitor:update:before": "node scripts/generate-version-share-data.mjs",
|
|
53
|
-
"check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs"
|
|
55
|
+
"check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
|
|
56
|
+
"example:install": "bun run build && bun scripts/install-packed-example.mjs",
|
|
57
|
+
"example:build": "bun run example:install && cd example-app && bun run build",
|
|
58
|
+
"example:capgo:deploy": "bun run example:build && bun scripts/deploy-example-capgo.mjs"
|
|
54
59
|
},
|
|
55
60
|
"devDependencies": {
|
|
56
61
|
"@capacitor/android": "^8.0.0",
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { dirname } from 'node:path';
|
|
5
|
+
|
|
6
|
+
const SOURCE_URL = 'https://raw.githubusercontent.com/Fyrd/caniuse/main/data.json';
|
|
7
|
+
|
|
8
|
+
const outputTsPath = new URL('../src/generated-version-share.ts', import.meta.url).pathname;
|
|
9
|
+
const outputJavaPath = new URL(
|
|
10
|
+
'../android/src/main/java/app/capgo/webviewversionchecker/GeneratedVersionShareData.java',
|
|
11
|
+
import.meta.url,
|
|
12
|
+
).pathname;
|
|
13
|
+
|
|
14
|
+
const timeoutMs = 15000;
|
|
15
|
+
|
|
16
|
+
const parseMajorVersion = (input) => {
|
|
17
|
+
if (input === null || input === undefined) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const value = String(input).trim();
|
|
22
|
+
if (!value) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const normalized = value.startsWith('v') || value.startsWith('V') ? value.slice(1) : value;
|
|
27
|
+
const match = normalized.match(/(\d+)/);
|
|
28
|
+
if (!match) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const major = Number.parseInt(match[1], 10);
|
|
33
|
+
return Number.isFinite(major) && major >= 0 ? major : null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const normalizePercent = (input) => {
|
|
37
|
+
const value = typeof input === 'number' ? input : Number(input);
|
|
38
|
+
if (!Number.isFinite(value)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const clamped = Math.min(100, Math.max(0, value));
|
|
42
|
+
return Number(clamped.toFixed(6));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const mergeUsageGlobal = (target, usageGlobal, { override = false } = {}) => {
|
|
46
|
+
if (!usageGlobal || typeof usageGlobal !== 'object') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
for (const [versionKey, shareRaw] of Object.entries(usageGlobal)) {
|
|
51
|
+
const major = parseMajorVersion(versionKey);
|
|
52
|
+
const share = normalizePercent(shareRaw);
|
|
53
|
+
if (major === null || share === null || share <= 0) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (!override && target.has(major)) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
target.set(major, share);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const extractShareMap = (rawData) => {
|
|
64
|
+
const agents = rawData?.agents ?? {};
|
|
65
|
+
const map = new Map();
|
|
66
|
+
|
|
67
|
+
// Prefer Android-specific buckets.
|
|
68
|
+
mergeUsageGlobal(map, agents?.and_chr?.usage_global, { override: false });
|
|
69
|
+
mergeUsageGlobal(map, agents?.android?.usage_global, { override: false });
|
|
70
|
+
|
|
71
|
+
// If Android buckets are sparse, fill missing majors from Chrome global.
|
|
72
|
+
if (map.size < 5) {
|
|
73
|
+
mergeUsageGlobal(map, agents?.chrome?.usage_global, { override: false });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return Object.fromEntries([...map.entries()].sort((a, b) => b[0] - a[0]).map(([major, share]) => [String(major), share]));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const generateTs = (shareMap, generatedAtIso) => {
|
|
80
|
+
const prettyJson = JSON.stringify(shareMap, null, 2);
|
|
81
|
+
return `/* eslint-disable */
|
|
82
|
+
/**
|
|
83
|
+
* AUTO-GENERATED FILE. DO NOT EDIT.
|
|
84
|
+
* Generated by: scripts/generate-version-share-data.mjs
|
|
85
|
+
* Source: ${SOURCE_URL}
|
|
86
|
+
* Generated at: ${generatedAtIso}
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
export const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';
|
|
90
|
+
export const DEFAULT_VERSION_SHARE_GENERATED_AT = '${generatedAtIso}';
|
|
91
|
+
export const DEFAULT_VERSION_SHARE_BY_MAJOR: Record<string, number> = ${prettyJson};
|
|
92
|
+
`;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const escapeJavaString = (value) => value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
96
|
+
|
|
97
|
+
const generateJava = (shareMap, generatedAtIso) => {
|
|
98
|
+
const compactJson = JSON.stringify(shareMap);
|
|
99
|
+
const escaped = escapeJavaString(compactJson);
|
|
100
|
+
return `package app.capgo.webviewversionchecker;
|
|
101
|
+
|
|
102
|
+
import org.json.JSONObject;
|
|
103
|
+
|
|
104
|
+
final class GeneratedVersionShareData {
|
|
105
|
+
|
|
106
|
+
private static final String GENERATED_AT = "${generatedAtIso}";
|
|
107
|
+
private static final String DATA_SOURCE = "generatedVersionShareByMajor";
|
|
108
|
+
private static final String JSON_DATA = "${escaped}";
|
|
109
|
+
|
|
110
|
+
private GeneratedVersionShareData() {}
|
|
111
|
+
|
|
112
|
+
static JSONObject getDefaultVersionShareByMajor() {
|
|
113
|
+
try {
|
|
114
|
+
return new JSONObject(JSON_DATA);
|
|
115
|
+
} catch (Exception ignored) {
|
|
116
|
+
return new JSONObject();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static String getDataSource() {
|
|
121
|
+
return DATA_SOURCE;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static String getGeneratedAt() {
|
|
125
|
+
return GENERATED_AT;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const ensureParentDir = async (filePath) => {
|
|
132
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const hasExistingGeneratedFiles = async () => {
|
|
136
|
+
try {
|
|
137
|
+
await Promise.all([readFile(outputTsPath, 'utf8'), readFile(outputJavaPath, 'utf8')]);
|
|
138
|
+
return true;
|
|
139
|
+
} catch {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const fetchWithTimeout = async (url, timeout) => {
|
|
145
|
+
const controller = new AbortController();
|
|
146
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
147
|
+
|
|
148
|
+
try {
|
|
149
|
+
const response = await fetch(url, {
|
|
150
|
+
signal: controller.signal,
|
|
151
|
+
headers: {
|
|
152
|
+
Accept: 'application/json',
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
if (!response.ok) {
|
|
156
|
+
throw new Error(`HTTP ${response.status}`);
|
|
157
|
+
}
|
|
158
|
+
return await response.json();
|
|
159
|
+
} finally {
|
|
160
|
+
clearTimeout(timer);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const writeOutputs = async (shareMap) => {
|
|
165
|
+
const generatedAtIso = new Date().toISOString();
|
|
166
|
+
const tsContent = generateTs(shareMap, generatedAtIso);
|
|
167
|
+
const javaContent = generateJava(shareMap, generatedAtIso);
|
|
168
|
+
|
|
169
|
+
await ensureParentDir(outputTsPath);
|
|
170
|
+
await ensureParentDir(outputJavaPath);
|
|
171
|
+
await Promise.all([writeFile(outputTsPath, tsContent, 'utf8'), writeFile(outputJavaPath, javaContent, 'utf8')]);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const main = async () => {
|
|
175
|
+
try {
|
|
176
|
+
const data = await fetchWithTimeout(SOURCE_URL, timeoutMs);
|
|
177
|
+
const shareMap = extractShareMap(data);
|
|
178
|
+
|
|
179
|
+
if (Object.keys(shareMap).length === 0) {
|
|
180
|
+
throw new Error('No usable version-share entries extracted from source data.');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
await writeOutputs(shareMap);
|
|
184
|
+
console.log(`Generated version-share defaults with ${Object.keys(shareMap).length} majors.`);
|
|
185
|
+
return;
|
|
186
|
+
} catch (error) {
|
|
187
|
+
const fallbackAvailable = await hasExistingGeneratedFiles();
|
|
188
|
+
if (fallbackAvailable) {
|
|
189
|
+
console.warn(`Warning: Could not refresh version-share data (${String(error)}). Keeping existing generated files.`);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
await main();
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* AUTO-GENERATED FILE. DO NOT EDIT.
|
|
4
|
+
* Generated by: scripts/generate-version-share-data.mjs
|
|
5
|
+
* Source: https://raw.githubusercontent.com/Fyrd/caniuse/main/data.json
|
|
6
|
+
* Generated at: 2026-06-16T03:32:51.778Z
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const DEFAULT_VERSION_SHARE_DATA_SOURCE = 'generatedVersionShareByMajor';
|
|
10
|
+
export const DEFAULT_VERSION_SHARE_GENERATED_AT = '2026-06-16T03:32:51.778Z';
|
|
11
|
+
export const DEFAULT_VERSION_SHARE_BY_MAJOR: Record<string, number> = {
|
|
12
|
+
"4": 0.000031,
|
|
13
|
+
"39": 0.08685,
|
|
14
|
+
"40": 0.08685,
|
|
15
|
+
"41": 0.08685,
|
|
16
|
+
"42": 0.08685,
|
|
17
|
+
"43": 0.08685,
|
|
18
|
+
"44": 0.08685,
|
|
19
|
+
"45": 0.091675,
|
|
20
|
+
"46": 0.08685,
|
|
21
|
+
"47": 0.08685,
|
|
22
|
+
"48": 0.091675,
|
|
23
|
+
"49": 0.091675,
|
|
24
|
+
"50": 0.08685,
|
|
25
|
+
"51": 0.08685,
|
|
26
|
+
"52": 0.091675,
|
|
27
|
+
"53": 0.08685,
|
|
28
|
+
"54": 0.08685,
|
|
29
|
+
"55": 0.08685,
|
|
30
|
+
"56": 0.08685,
|
|
31
|
+
"57": 0.08685,
|
|
32
|
+
"58": 0.08685,
|
|
33
|
+
"59": 0.08685,
|
|
34
|
+
"60": 0.08685,
|
|
35
|
+
"66": 0.004825,
|
|
36
|
+
"69": 0.004825,
|
|
37
|
+
"70": 0.024125,
|
|
38
|
+
"79": 0.02895,
|
|
39
|
+
"86": 0.004825,
|
|
40
|
+
"87": 0.014475,
|
|
41
|
+
"91": 0.00965,
|
|
42
|
+
"93": 0.014475,
|
|
43
|
+
"96": 0.004825,
|
|
44
|
+
"97": 0.004825,
|
|
45
|
+
"98": 0.02895,
|
|
46
|
+
"99": 0.014475,
|
|
47
|
+
"100": 0.00965,
|
|
48
|
+
"101": 0.00965,
|
|
49
|
+
"102": 0.004825,
|
|
50
|
+
"103": 0.303975,
|
|
51
|
+
"104": 0.2509,
|
|
52
|
+
"105": 0.236425,
|
|
53
|
+
"106": 0.236425,
|
|
54
|
+
"107": 0.236425,
|
|
55
|
+
"108": 0.246075,
|
|
56
|
+
"109": 0.7334,
|
|
57
|
+
"110": 0.24125,
|
|
58
|
+
"111": 0.2895,
|
|
59
|
+
"112": 0.902275,
|
|
60
|
+
"114": 0.024125,
|
|
61
|
+
"115": 0.00965,
|
|
62
|
+
"116": 0.516275,
|
|
63
|
+
"117": 0.284675,
|
|
64
|
+
"118": 1.1773,
|
|
65
|
+
"119": 0.02895,
|
|
66
|
+
"120": 0.294325,
|
|
67
|
+
"121": 0.024125,
|
|
68
|
+
"122": 0.033775,
|
|
69
|
+
"123": 0.033775,
|
|
70
|
+
"124": 0.27985,
|
|
71
|
+
"125": 0.5211,
|
|
72
|
+
"126": 0.0386,
|
|
73
|
+
"127": 0.0193,
|
|
74
|
+
"128": 0.053075,
|
|
75
|
+
"129": 0.0193,
|
|
76
|
+
"130": 0.062725,
|
|
77
|
+
"131": 0.564525,
|
|
78
|
+
"132": 0.04825,
|
|
79
|
+
"133": 0.516275,
|
|
80
|
+
"134": 0.04825,
|
|
81
|
+
"135": 0.0386,
|
|
82
|
+
"136": 0.043425,
|
|
83
|
+
"137": 0.082025,
|
|
84
|
+
"138": 0.159225,
|
|
85
|
+
"139": 0.101325,
|
|
86
|
+
"140": 0.0772,
|
|
87
|
+
"141": 0.0579,
|
|
88
|
+
"142": 0.902275,
|
|
89
|
+
"143": 0.110975,
|
|
90
|
+
"144": 0.29915,
|
|
91
|
+
"145": 0.863675,
|
|
92
|
+
"146": 0.583825,
|
|
93
|
+
"147": 6.10362,
|
|
94
|
+
"148": 8.41963,
|
|
95
|
+
"149": 42.196,
|
|
96
|
+
"150": 0.00965
|
|
97
|
+
};
|