@nuxt/scripts 1.0.0-beta.1 → 1.0.0-beta.13
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 +6 -0
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/48AF9EJD.js +1 -0
- package/dist/client/_nuxt/Bk6ed9rg.js +1 -0
- package/dist/client/_nuxt/C4Cj8gBr.js +162 -0
- package/dist/client/_nuxt/{DTDyDxvR.js → DP0kj6Xn.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/0e95b1cc-8751-4000-8cb4-a6ef270b636f.json +1 -0
- package/dist/client/_nuxt/entry.D45OuV0w.css +1 -0
- package/dist/client/_nuxt/error-404.B57D-jUQ.css +1 -0
- package/dist/client/_nuxt/error-500.DTHUW7BI.css +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.d.mts +87 -2
- package/dist/module.d.ts +176 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +710 -273
- package/dist/registry.d.ts +6 -0
- package/dist/registry.mjs +42 -19
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +1 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +1 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +7 -7
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +12 -12
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +1 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +1 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +5 -5
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +7 -7
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +7 -7
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +7 -7
- package/dist/runtime/components/ScriptCrisp.vue +1 -1
- package/dist/runtime/components/ScriptGoogleAdsense.vue +1 -1
- package/dist/runtime/components/ScriptInstagramEmbed.d.vue.ts +53 -0
- package/dist/runtime/components/ScriptInstagramEmbed.vue +38 -0
- package/dist/runtime/components/ScriptInstagramEmbed.vue.d.ts +53 -0
- package/dist/runtime/components/ScriptIntercom.vue +4 -3
- package/dist/runtime/components/ScriptLoadingIndicator.d.vue.ts +1 -1
- package/dist/runtime/components/ScriptLoadingIndicator.vue.d.ts +1 -1
- package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptPayPalButtons.vue +13 -11
- package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptPayPalMarks.vue +10 -8
- package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptPayPalMessages.vue +11 -9
- package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptStripePricingTable.vue +2 -2
- package/dist/runtime/components/ScriptVimeoPlayer.vue +1 -1
- package/dist/runtime/components/ScriptXEmbed.d.vue.ts +82 -0
- package/dist/runtime/components/ScriptXEmbed.vue +76 -0
- package/dist/runtime/components/ScriptXEmbed.vue.d.ts +82 -0
- package/dist/runtime/components/ScriptYouTubePlayer.vue +7 -4
- package/dist/runtime/composables/useScript.js +32 -6
- package/dist/runtime/composables/useScriptEventPage.js +2 -2
- package/dist/runtime/composables/useScriptTriggerConsent.js +1 -1
- package/dist/runtime/composables/useScriptTriggerElement.js +1 -1
- package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +1 -1
- package/dist/runtime/composables/useScriptTriggerServiceWorker.d.ts +7 -0
- package/dist/runtime/composables/useScriptTriggerServiceWorker.js +39 -0
- package/dist/runtime/registry/clarity.js +21 -25
- package/dist/runtime/registry/cloudflare-web-analytics.js +1 -1
- package/dist/runtime/registry/crisp.js +1 -1
- package/dist/runtime/registry/databuddy-analytics.js +1 -1
- package/dist/runtime/registry/fathom-analytics.js +1 -1
- package/dist/runtime/registry/google-adsense.js +1 -1
- package/dist/runtime/registry/google-analytics.js +2 -2
- package/dist/runtime/registry/google-maps.d.ts +1 -1
- package/dist/runtime/registry/google-maps.js +1 -1
- package/dist/runtime/registry/google-recaptcha.js +2 -2
- package/dist/runtime/registry/google-sign-in.js +1 -1
- package/dist/runtime/registry/google-tag-manager.d.ts +1 -1
- package/dist/runtime/registry/google-tag-manager.js +2 -2
- package/dist/runtime/registry/hotjar.js +1 -1
- package/dist/runtime/registry/instagram-embed.d.ts +23 -0
- package/dist/runtime/registry/instagram-embed.js +22 -0
- package/dist/runtime/registry/intercom.js +1 -1
- package/dist/runtime/registry/lemon-squeezy.d.ts +0 -1
- package/dist/runtime/registry/matomo-analytics.js +2 -2
- package/dist/runtime/registry/meta-pixel.js +1 -1
- package/dist/runtime/registry/npm.js +1 -1
- package/dist/runtime/registry/paypal.d.ts +1 -1
- package/dist/runtime/registry/paypal.js +2 -2
- package/dist/runtime/registry/plausible-analytics.js +15 -9
- package/dist/runtime/registry/posthog.d.ts +3 -2
- package/dist/runtime/registry/posthog.js +8 -12
- package/dist/runtime/registry/reddit-pixel.js +1 -1
- package/dist/runtime/registry/rybbit-analytics.js +5 -3
- package/dist/runtime/registry/segment.js +1 -1
- package/dist/runtime/registry/snapchat-pixel.js +1 -1
- package/dist/runtime/registry/stripe.d.ts +1 -1
- package/dist/runtime/registry/stripe.js +1 -1
- package/dist/runtime/registry/tiktok-pixel.d.ts +1 -0
- package/dist/runtime/registry/tiktok-pixel.js +2 -1
- package/dist/runtime/registry/umami-analytics.js +1 -1
- package/dist/runtime/registry/vimeo-player.d.ts +2 -2
- package/dist/runtime/registry/vimeo-player.js +1 -1
- package/dist/runtime/registry/x-embed.d.ts +77 -0
- package/dist/runtime/registry/x-embed.js +41 -0
- package/dist/runtime/registry/x-pixel.js +1 -1
- package/dist/runtime/registry/youtube-player.d.ts +7 -7
- package/dist/runtime/registry/youtube-player.js +1 -1
- package/dist/runtime/server/google-static-maps-proxy.js +1 -1
- package/dist/runtime/server/instagram-embed-asset.d.ts +2 -0
- package/dist/runtime/server/instagram-embed-asset.js +42 -0
- package/dist/runtime/server/instagram-embed-image.d.ts +2 -0
- package/dist/runtime/server/instagram-embed-image.js +54 -0
- package/dist/runtime/server/instagram-embed.d.ts +2 -0
- package/dist/runtime/server/instagram-embed.js +91 -0
- package/dist/runtime/server/proxy-handler.d.ts +6 -0
- package/dist/runtime/server/proxy-handler.js +264 -0
- package/dist/runtime/server/utils/privacy.d.ts +141 -0
- package/dist/runtime/server/utils/privacy.js +324 -0
- package/dist/runtime/server/x-embed-image.d.ts +2 -0
- package/dist/runtime/server/x-embed-image.js +53 -0
- package/dist/runtime/server/x-embed.d.ts +49 -0
- package/dist/runtime/server/x-embed.js +31 -0
- package/dist/runtime/types.d.ts +51 -22
- package/dist/runtime/utils/pure.d.ts +9 -0
- package/dist/runtime/utils/pure.js +0 -0
- package/dist/runtime/utils.d.ts +3 -3
- package/dist/runtime/utils.js +3 -2
- package/dist/shared/scripts.DLRgvHQg.mjs +288 -0
- package/dist/stats.d.mts +39 -0
- package/dist/stats.d.ts +39 -0
- package/dist/stats.mjs +711 -0
- package/dist/types.d.mts +1 -1
- package/package.json +48 -41
- package/dist/client/_nuxt/Bdf7Qtwg.js +0 -1
- package/dist/client/_nuxt/CoyZWCgl.js +0 -162
- package/dist/client/_nuxt/Ds1k3yKJ.js +0 -1
- package/dist/client/_nuxt/builds/meta/62574f80-71d4-4f9e-8b96-145c85230d99.json +0 -1
- package/dist/client/_nuxt/entry.BjfcJo5q.css +0 -1
- package/dist/client/_nuxt/error-404.D45Vtjcx.css +0 -1
- package/dist/client/_nuxt/error-500.BOm1rWQf.css +0 -1
package/dist/stats.mjs
ADDED
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
import { g as getAllProxyConfigs } from './shared/scripts.DLRgvHQg.mjs';
|
|
2
|
+
|
|
3
|
+
const scriptMeta = {
|
|
4
|
+
// Analytics
|
|
5
|
+
plausibleAnalytics: {
|
|
6
|
+
urls: ["https://plausible.io/js/script.js"],
|
|
7
|
+
trackedData: ["page-views", "events", "conversions"]
|
|
8
|
+
},
|
|
9
|
+
cloudflareWebAnalytics: {
|
|
10
|
+
urls: ["https://static.cloudflareinsights.com/beacon.min.js"],
|
|
11
|
+
trackedData: ["page-views"]
|
|
12
|
+
},
|
|
13
|
+
postHog: {
|
|
14
|
+
urls: [],
|
|
15
|
+
// NPM-only, no CDN script
|
|
16
|
+
trackedData: ["page-views", "events", "conversions", "user-identity", "session-replay", "heatmaps", "ab-testing"]
|
|
17
|
+
},
|
|
18
|
+
fathomAnalytics: {
|
|
19
|
+
urls: ["https://cdn.usefathom.com/script.js"],
|
|
20
|
+
trackedData: ["page-views", "events", "conversions"]
|
|
21
|
+
},
|
|
22
|
+
matomoAnalytics: {
|
|
23
|
+
urls: [],
|
|
24
|
+
// Self-hosted, no canonical CDN
|
|
25
|
+
trackedData: ["page-views", "events", "conversions", "user-identity", "heatmaps", "ab-testing"]
|
|
26
|
+
},
|
|
27
|
+
rybbitAnalytics: {
|
|
28
|
+
urls: ["https://app.rybbit.io/api/script.js"],
|
|
29
|
+
trackedData: ["page-views", "events"]
|
|
30
|
+
},
|
|
31
|
+
databuddyAnalytics: {
|
|
32
|
+
urls: ["https://cdn.databuddy.cc/databuddy.js"],
|
|
33
|
+
trackedData: ["page-views", "events"]
|
|
34
|
+
},
|
|
35
|
+
segment: {
|
|
36
|
+
urls: [],
|
|
37
|
+
// Dynamic URL based on writeKey
|
|
38
|
+
trackedData: ["page-views", "events", "conversions", "user-identity"]
|
|
39
|
+
},
|
|
40
|
+
googleAnalytics: {
|
|
41
|
+
urls: ["https://www.googletagmanager.com/gtag/js?id=G-TR58L0EF8P"],
|
|
42
|
+
trackedData: ["page-views", "events", "conversions", "user-identity", "audiences"]
|
|
43
|
+
},
|
|
44
|
+
umamiAnalytics: {
|
|
45
|
+
urls: ["https://cloud.umami.is/script.js"],
|
|
46
|
+
trackedData: ["page-views", "events"]
|
|
47
|
+
},
|
|
48
|
+
// Ads / Pixels
|
|
49
|
+
metaPixel: {
|
|
50
|
+
urls: ["https://connect.facebook.net/en_US/fbevents.js"],
|
|
51
|
+
trackedData: ["page-views", "conversions", "retargeting", "audiences"]
|
|
52
|
+
},
|
|
53
|
+
xPixel: {
|
|
54
|
+
urls: ["https://static.ads-twitter.com/uwt.js"],
|
|
55
|
+
trackedData: ["page-views", "conversions", "retargeting", "audiences"]
|
|
56
|
+
},
|
|
57
|
+
tikTokPixel: {
|
|
58
|
+
urls: ["https://analytics.tiktok.com/i18n/pixel/events.js"],
|
|
59
|
+
trackedData: ["page-views", "conversions", "retargeting", "audiences"]
|
|
60
|
+
},
|
|
61
|
+
snapchatPixel: {
|
|
62
|
+
urls: ["https://sc-static.net/scevent.min.js"],
|
|
63
|
+
trackedData: ["page-views", "conversions", "retargeting", "audiences"]
|
|
64
|
+
},
|
|
65
|
+
redditPixel: {
|
|
66
|
+
urls: ["https://www.redditstatic.com/ads/pixel.js"],
|
|
67
|
+
trackedData: ["page-views", "conversions", "retargeting", "audiences"]
|
|
68
|
+
},
|
|
69
|
+
googleAdsense: {
|
|
70
|
+
urls: ["https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"],
|
|
71
|
+
trackedData: ["page-views", "retargeting", "audiences"]
|
|
72
|
+
},
|
|
73
|
+
carbonAds: {
|
|
74
|
+
urls: [],
|
|
75
|
+
// Dynamic script per site
|
|
76
|
+
trackedData: ["page-views"]
|
|
77
|
+
},
|
|
78
|
+
// Session replay / Heatmaps
|
|
79
|
+
hotjar: {
|
|
80
|
+
urls: ["https://static.hotjar.com/c/hotjar-3925006.js?sv=6"],
|
|
81
|
+
trackedData: ["page-views", "session-replay", "heatmaps", "clicks", "scrolls", "form-submissions"]
|
|
82
|
+
},
|
|
83
|
+
clarity: {
|
|
84
|
+
urls: ["https://www.clarity.ms/tag/mqk2m9dr2v"],
|
|
85
|
+
trackedData: ["page-views", "session-replay", "heatmaps", "clicks", "scrolls"]
|
|
86
|
+
},
|
|
87
|
+
// Tag Manager
|
|
88
|
+
googleTagManager: {
|
|
89
|
+
urls: ["https://www.googletagmanager.com/gtm.js?id=GTM-MWW974PF"],
|
|
90
|
+
trackedData: ["tag-injection"]
|
|
91
|
+
},
|
|
92
|
+
// Support
|
|
93
|
+
intercom: {
|
|
94
|
+
urls: ["https://widget.intercom.io/widget/akg5rmxb"],
|
|
95
|
+
trackedData: ["user-identity", "events"]
|
|
96
|
+
},
|
|
97
|
+
crisp: {
|
|
98
|
+
urls: ["https://client.crisp.chat/l.js"],
|
|
99
|
+
trackedData: ["user-identity", "events"]
|
|
100
|
+
},
|
|
101
|
+
// Payments
|
|
102
|
+
stripe: {
|
|
103
|
+
urls: ["https://js.stripe.com/v3/"],
|
|
104
|
+
trackedData: ["transactions"]
|
|
105
|
+
},
|
|
106
|
+
lemonSqueezy: {
|
|
107
|
+
urls: ["https://assets.lemonsqueezy.com/lemon.js"],
|
|
108
|
+
trackedData: ["transactions"]
|
|
109
|
+
},
|
|
110
|
+
payPal: {
|
|
111
|
+
urls: [],
|
|
112
|
+
// Dynamic URL with client-id
|
|
113
|
+
trackedData: ["transactions"]
|
|
114
|
+
},
|
|
115
|
+
// Video
|
|
116
|
+
vimeoPlayer: {
|
|
117
|
+
urls: ["https://player.vimeo.com/api/player.js"],
|
|
118
|
+
trackedData: ["video-engagement"]
|
|
119
|
+
},
|
|
120
|
+
youTubePlayer: {
|
|
121
|
+
urls: ["https://www.youtube.com/iframe_api"],
|
|
122
|
+
trackedData: ["video-engagement"]
|
|
123
|
+
},
|
|
124
|
+
// Content
|
|
125
|
+
googleMaps: {
|
|
126
|
+
urls: [],
|
|
127
|
+
// Dynamic URL with API key
|
|
128
|
+
trackedData: []
|
|
129
|
+
},
|
|
130
|
+
// CDN
|
|
131
|
+
npm: {
|
|
132
|
+
urls: [],
|
|
133
|
+
// Dynamic per package
|
|
134
|
+
trackedData: []
|
|
135
|
+
},
|
|
136
|
+
// Utility
|
|
137
|
+
googleRecaptcha: {
|
|
138
|
+
urls: ["https://www.google.com/recaptcha/api.js"],
|
|
139
|
+
trackedData: []
|
|
140
|
+
},
|
|
141
|
+
googleSignIn: {
|
|
142
|
+
urls: ["https://accounts.google.com/gsi/client"],
|
|
143
|
+
trackedData: ["user-identity"]
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const plausibleAnalytics = {
|
|
148
|
+
totalTransferKb: 1.9,
|
|
149
|
+
totalDecodedKb: 2.9,
|
|
150
|
+
loadTimeMs: 69,
|
|
151
|
+
scripts: [
|
|
152
|
+
{
|
|
153
|
+
url: "https://plausible.io/js/script.js",
|
|
154
|
+
transferKb: 1.9,
|
|
155
|
+
decodedKb: 2.9,
|
|
156
|
+
encoding: "zstd",
|
|
157
|
+
durationMs: 69,
|
|
158
|
+
initiatorType: "script",
|
|
159
|
+
protocol: "unknown"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
};
|
|
163
|
+
const cloudflareWebAnalytics = {
|
|
164
|
+
totalTransferKb: 10.8,
|
|
165
|
+
totalDecodedKb: 30.4,
|
|
166
|
+
loadTimeMs: 67,
|
|
167
|
+
scripts: [
|
|
168
|
+
{
|
|
169
|
+
url: "https://static.cloudflareinsights.com/beacon.min.js",
|
|
170
|
+
transferKb: 10.8,
|
|
171
|
+
decodedKb: 30.4,
|
|
172
|
+
encoding: "gzip",
|
|
173
|
+
durationMs: 67,
|
|
174
|
+
initiatorType: "script",
|
|
175
|
+
protocol: "unknown"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
};
|
|
179
|
+
const postHog = {
|
|
180
|
+
totalTransferKb: 0,
|
|
181
|
+
totalDecodedKb: 0,
|
|
182
|
+
loadTimeMs: 0,
|
|
183
|
+
scripts: [
|
|
184
|
+
]
|
|
185
|
+
};
|
|
186
|
+
const fathomAnalytics = {
|
|
187
|
+
totalTransferKb: 3,
|
|
188
|
+
totalDecodedKb: 6.7,
|
|
189
|
+
loadTimeMs: 261,
|
|
190
|
+
scripts: [
|
|
191
|
+
{
|
|
192
|
+
url: "https://cdn.usefathom.com/script.js",
|
|
193
|
+
transferKb: 2.7,
|
|
194
|
+
decodedKb: 6.7,
|
|
195
|
+
encoding: "zstd",
|
|
196
|
+
durationMs: 88,
|
|
197
|
+
initiatorType: "script",
|
|
198
|
+
protocol: "unknown"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
url: "https://cdn.usefathom.com/?h=http%3A%2F%2F127.0.0.1&p=%2FfathomAnalytics&r=&sid=null&qs=%7B%7D&cid=14910023",
|
|
202
|
+
transferKb: 0.3,
|
|
203
|
+
decodedKb: 0,
|
|
204
|
+
encoding: "none",
|
|
205
|
+
durationMs: 261,
|
|
206
|
+
initiatorType: "img",
|
|
207
|
+
protocol: "unknown"
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
};
|
|
211
|
+
const matomoAnalytics = {
|
|
212
|
+
totalTransferKb: 0,
|
|
213
|
+
totalDecodedKb: 0,
|
|
214
|
+
loadTimeMs: 0,
|
|
215
|
+
scripts: [
|
|
216
|
+
]
|
|
217
|
+
};
|
|
218
|
+
const rybbitAnalytics = {
|
|
219
|
+
totalTransferKb: 9,
|
|
220
|
+
totalDecodedKb: 25.3,
|
|
221
|
+
loadTimeMs: 1087,
|
|
222
|
+
scripts: [
|
|
223
|
+
{
|
|
224
|
+
url: "https://app.rybbit.io/api/script.js",
|
|
225
|
+
transferKb: 9,
|
|
226
|
+
decodedKb: 25.3,
|
|
227
|
+
encoding: "zstd",
|
|
228
|
+
durationMs: 1087,
|
|
229
|
+
initiatorType: "script",
|
|
230
|
+
protocol: "unknown"
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
};
|
|
234
|
+
const databuddyAnalytics = {
|
|
235
|
+
totalTransferKb: 10.6,
|
|
236
|
+
totalDecodedKb: 29.2,
|
|
237
|
+
loadTimeMs: 49,
|
|
238
|
+
scripts: [
|
|
239
|
+
{
|
|
240
|
+
url: "https://cdn.databuddy.cc/databuddy.js",
|
|
241
|
+
transferKb: 10.6,
|
|
242
|
+
decodedKb: 29.2,
|
|
243
|
+
encoding: "zstd",
|
|
244
|
+
durationMs: 49,
|
|
245
|
+
initiatorType: "script",
|
|
246
|
+
protocol: "unknown"
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
};
|
|
250
|
+
const segment = {
|
|
251
|
+
totalTransferKb: 0,
|
|
252
|
+
totalDecodedKb: 0,
|
|
253
|
+
loadTimeMs: 0,
|
|
254
|
+
scripts: [
|
|
255
|
+
]
|
|
256
|
+
};
|
|
257
|
+
const googleAnalytics = {
|
|
258
|
+
totalTransferKb: 151.4,
|
|
259
|
+
totalDecodedKb: 445.9,
|
|
260
|
+
loadTimeMs: 544,
|
|
261
|
+
scripts: [
|
|
262
|
+
{
|
|
263
|
+
url: "https://www.googletagmanager.com/gtag/js?id=G-TR58L0EF8P",
|
|
264
|
+
transferKb: 151.4,
|
|
265
|
+
decodedKb: 445.9,
|
|
266
|
+
encoding: "zstd",
|
|
267
|
+
durationMs: 544,
|
|
268
|
+
initiatorType: "script",
|
|
269
|
+
protocol: "unknown"
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
};
|
|
273
|
+
const umamiAnalytics = {
|
|
274
|
+
totalTransferKb: 2.4,
|
|
275
|
+
totalDecodedKb: 2.6,
|
|
276
|
+
loadTimeMs: 63,
|
|
277
|
+
scripts: [
|
|
278
|
+
{
|
|
279
|
+
url: "https://cloud.umami.is/script.js",
|
|
280
|
+
transferKb: 2.4,
|
|
281
|
+
decodedKb: 2.6,
|
|
282
|
+
encoding: "br",
|
|
283
|
+
durationMs: 63,
|
|
284
|
+
initiatorType: "script",
|
|
285
|
+
protocol: "unknown"
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
};
|
|
289
|
+
const metaPixel = {
|
|
290
|
+
totalTransferKb: 93.9,
|
|
291
|
+
totalDecodedKb: 353.3,
|
|
292
|
+
loadTimeMs: 114,
|
|
293
|
+
scripts: [
|
|
294
|
+
{
|
|
295
|
+
url: "https://connect.facebook.net/en_US/fbevents.js",
|
|
296
|
+
transferKb: 93.9,
|
|
297
|
+
decodedKb: 353.3,
|
|
298
|
+
encoding: "gzip",
|
|
299
|
+
durationMs: 114,
|
|
300
|
+
initiatorType: "script",
|
|
301
|
+
protocol: "h2"
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
};
|
|
305
|
+
const xPixel = {
|
|
306
|
+
totalTransferKb: 9.5,
|
|
307
|
+
totalDecodedKb: 32.3,
|
|
308
|
+
loadTimeMs: 53,
|
|
309
|
+
scripts: [
|
|
310
|
+
{
|
|
311
|
+
url: "https://static.ads-twitter.com/uwt.js",
|
|
312
|
+
transferKb: 9.5,
|
|
313
|
+
decodedKb: 32.3,
|
|
314
|
+
encoding: "gzip",
|
|
315
|
+
durationMs: 53,
|
|
316
|
+
initiatorType: "script",
|
|
317
|
+
protocol: "unknown"
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
};
|
|
321
|
+
const tikTokPixel = {
|
|
322
|
+
totalTransferKb: 2.7,
|
|
323
|
+
totalDecodedKb: 7.6,
|
|
324
|
+
loadTimeMs: 348,
|
|
325
|
+
scripts: [
|
|
326
|
+
{
|
|
327
|
+
url: "https://analytics.tiktok.com/i18n/pixel/events.js",
|
|
328
|
+
transferKb: 2.7,
|
|
329
|
+
decodedKb: 7.6,
|
|
330
|
+
encoding: "gzip",
|
|
331
|
+
durationMs: 348,
|
|
332
|
+
initiatorType: "script",
|
|
333
|
+
protocol: "unknown"
|
|
334
|
+
}
|
|
335
|
+
]
|
|
336
|
+
};
|
|
337
|
+
const snapchatPixel = {
|
|
338
|
+
totalTransferKb: 24.7,
|
|
339
|
+
totalDecodedKb: 57.4,
|
|
340
|
+
loadTimeMs: 600,
|
|
341
|
+
scripts: [
|
|
342
|
+
{
|
|
343
|
+
url: "https://sc-static.net/scevent.min.js",
|
|
344
|
+
transferKb: 24.7,
|
|
345
|
+
decodedKb: 57.4,
|
|
346
|
+
encoding: "gzip",
|
|
347
|
+
durationMs: 600,
|
|
348
|
+
initiatorType: "script",
|
|
349
|
+
protocol: "unknown"
|
|
350
|
+
}
|
|
351
|
+
]
|
|
352
|
+
};
|
|
353
|
+
const redditPixel = {
|
|
354
|
+
totalTransferKb: 20,
|
|
355
|
+
totalDecodedKb: 79.6,
|
|
356
|
+
loadTimeMs: 110,
|
|
357
|
+
scripts: [
|
|
358
|
+
{
|
|
359
|
+
url: "https://www.redditstatic.com/ads/pixel.js",
|
|
360
|
+
transferKb: 20,
|
|
361
|
+
decodedKb: 79.6,
|
|
362
|
+
encoding: "gzip",
|
|
363
|
+
durationMs: 110,
|
|
364
|
+
initiatorType: "script",
|
|
365
|
+
protocol: "unknown"
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
};
|
|
369
|
+
const googleAdsense = {
|
|
370
|
+
totalTransferKb: 63.3,
|
|
371
|
+
totalDecodedKb: 192.6,
|
|
372
|
+
loadTimeMs: 367,
|
|
373
|
+
scripts: [
|
|
374
|
+
{
|
|
375
|
+
url: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
|
|
376
|
+
transferKb: 63.3,
|
|
377
|
+
decodedKb: 192.6,
|
|
378
|
+
encoding: "br",
|
|
379
|
+
durationMs: 367,
|
|
380
|
+
initiatorType: "script",
|
|
381
|
+
protocol: "h2"
|
|
382
|
+
}
|
|
383
|
+
]
|
|
384
|
+
};
|
|
385
|
+
const carbonAds = {
|
|
386
|
+
totalTransferKb: 0,
|
|
387
|
+
totalDecodedKb: 0,
|
|
388
|
+
loadTimeMs: 0,
|
|
389
|
+
scripts: [
|
|
390
|
+
]
|
|
391
|
+
};
|
|
392
|
+
const hotjar = {
|
|
393
|
+
totalTransferKb: 6.1,
|
|
394
|
+
totalDecodedKb: 14.7,
|
|
395
|
+
loadTimeMs: 332,
|
|
396
|
+
scripts: [
|
|
397
|
+
{
|
|
398
|
+
url: "https://static.hotjar.com/c/hotjar-3925006.js?sv=6",
|
|
399
|
+
transferKb: 6.1,
|
|
400
|
+
decodedKb: 14.7,
|
|
401
|
+
encoding: "br",
|
|
402
|
+
durationMs: 332,
|
|
403
|
+
initiatorType: "script",
|
|
404
|
+
protocol: "unknown"
|
|
405
|
+
}
|
|
406
|
+
]
|
|
407
|
+
};
|
|
408
|
+
const clarity = {
|
|
409
|
+
totalTransferKb: 0.8,
|
|
410
|
+
totalDecodedKb: 0.6,
|
|
411
|
+
loadTimeMs: 351,
|
|
412
|
+
scripts: [
|
|
413
|
+
{
|
|
414
|
+
url: "https://www.clarity.ms/tag/mqk2m9dr2v",
|
|
415
|
+
transferKb: 0.8,
|
|
416
|
+
decodedKb: 0.6,
|
|
417
|
+
encoding: "none",
|
|
418
|
+
durationMs: 351,
|
|
419
|
+
initiatorType: "script",
|
|
420
|
+
protocol: "unknown"
|
|
421
|
+
}
|
|
422
|
+
]
|
|
423
|
+
};
|
|
424
|
+
const googleTagManager = {
|
|
425
|
+
totalTransferKb: 106.1,
|
|
426
|
+
totalDecodedKb: 295,
|
|
427
|
+
loadTimeMs: 599,
|
|
428
|
+
scripts: [
|
|
429
|
+
{
|
|
430
|
+
url: "https://www.googletagmanager.com/gtm.js?id=GTM-MWW974PF",
|
|
431
|
+
transferKb: 106.1,
|
|
432
|
+
decodedKb: 295,
|
|
433
|
+
encoding: "zstd",
|
|
434
|
+
durationMs: 599,
|
|
435
|
+
initiatorType: "script",
|
|
436
|
+
protocol: "unknown"
|
|
437
|
+
}
|
|
438
|
+
]
|
|
439
|
+
};
|
|
440
|
+
const intercom = {
|
|
441
|
+
totalTransferKb: 3.6,
|
|
442
|
+
totalDecodedKb: 7.4,
|
|
443
|
+
loadTimeMs: 77,
|
|
444
|
+
scripts: [
|
|
445
|
+
{
|
|
446
|
+
url: "https://widget.intercom.io/widget/akg5rmxb",
|
|
447
|
+
transferKb: 3.6,
|
|
448
|
+
decodedKb: 7.4,
|
|
449
|
+
encoding: "gzip",
|
|
450
|
+
durationMs: 77,
|
|
451
|
+
initiatorType: "script",
|
|
452
|
+
protocol: "unknown"
|
|
453
|
+
}
|
|
454
|
+
]
|
|
455
|
+
};
|
|
456
|
+
const crisp = {
|
|
457
|
+
totalTransferKb: 3.3,
|
|
458
|
+
totalDecodedKb: 7.6,
|
|
459
|
+
loadTimeMs: 64,
|
|
460
|
+
scripts: [
|
|
461
|
+
{
|
|
462
|
+
url: "https://client.crisp.chat/l.js",
|
|
463
|
+
transferKb: 3.3,
|
|
464
|
+
decodedKb: 7.6,
|
|
465
|
+
encoding: "br",
|
|
466
|
+
durationMs: 64,
|
|
467
|
+
initiatorType: "script",
|
|
468
|
+
protocol: "unknown"
|
|
469
|
+
}
|
|
470
|
+
]
|
|
471
|
+
};
|
|
472
|
+
const stripe = {
|
|
473
|
+
totalTransferKb: 213.2,
|
|
474
|
+
totalDecodedKb: 916.7,
|
|
475
|
+
loadTimeMs: 125,
|
|
476
|
+
scripts: [
|
|
477
|
+
{
|
|
478
|
+
url: "https://js.stripe.com/v3/",
|
|
479
|
+
transferKb: 213.2,
|
|
480
|
+
decodedKb: 916.7,
|
|
481
|
+
encoding: "br",
|
|
482
|
+
durationMs: 125,
|
|
483
|
+
initiatorType: "script",
|
|
484
|
+
protocol: "h2"
|
|
485
|
+
}
|
|
486
|
+
]
|
|
487
|
+
};
|
|
488
|
+
const lemonSqueezy = {
|
|
489
|
+
totalTransferKb: 1.8,
|
|
490
|
+
totalDecodedKb: 3.8,
|
|
491
|
+
loadTimeMs: 56,
|
|
492
|
+
scripts: [
|
|
493
|
+
{
|
|
494
|
+
url: "https://assets.lemonsqueezy.com/lemon.js",
|
|
495
|
+
transferKb: 1.8,
|
|
496
|
+
decodedKb: 3.8,
|
|
497
|
+
encoding: "br",
|
|
498
|
+
durationMs: 56,
|
|
499
|
+
initiatorType: "script",
|
|
500
|
+
protocol: "unknown"
|
|
501
|
+
}
|
|
502
|
+
]
|
|
503
|
+
};
|
|
504
|
+
const payPal = {
|
|
505
|
+
totalTransferKb: 0,
|
|
506
|
+
totalDecodedKb: 0,
|
|
507
|
+
loadTimeMs: 0,
|
|
508
|
+
scripts: [
|
|
509
|
+
]
|
|
510
|
+
};
|
|
511
|
+
const vimeoPlayer = {
|
|
512
|
+
totalTransferKb: 8.9,
|
|
513
|
+
totalDecodedKb: 23.8,
|
|
514
|
+
loadTimeMs: 81,
|
|
515
|
+
scripts: [
|
|
516
|
+
{
|
|
517
|
+
url: "https://player.vimeo.com/api/player.js",
|
|
518
|
+
transferKb: 8.9,
|
|
519
|
+
decodedKb: 23.8,
|
|
520
|
+
encoding: "gzip",
|
|
521
|
+
durationMs: 81,
|
|
522
|
+
initiatorType: "script",
|
|
523
|
+
protocol: "unknown"
|
|
524
|
+
}
|
|
525
|
+
]
|
|
526
|
+
};
|
|
527
|
+
const youTubePlayer = {
|
|
528
|
+
totalTransferKb: 13.6,
|
|
529
|
+
totalDecodedKb: 32.4,
|
|
530
|
+
loadTimeMs: 256,
|
|
531
|
+
scripts: [
|
|
532
|
+
{
|
|
533
|
+
url: "https://www.youtube.com/iframe_api",
|
|
534
|
+
transferKb: 3,
|
|
535
|
+
decodedKb: 1,
|
|
536
|
+
encoding: "br",
|
|
537
|
+
durationMs: 256,
|
|
538
|
+
initiatorType: "script",
|
|
539
|
+
protocol: "unknown"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
url: "https://www.youtube.com/s/player/140dafda/www-widgetapi.vflset/www-widgetapi.js",
|
|
543
|
+
transferKb: 10.6,
|
|
544
|
+
decodedKb: 31.4,
|
|
545
|
+
encoding: "br",
|
|
546
|
+
durationMs: 22,
|
|
547
|
+
initiatorType: "script",
|
|
548
|
+
protocol: "unknown"
|
|
549
|
+
}
|
|
550
|
+
]
|
|
551
|
+
};
|
|
552
|
+
const googleMaps = {
|
|
553
|
+
totalTransferKb: 0,
|
|
554
|
+
totalDecodedKb: 0,
|
|
555
|
+
loadTimeMs: 0,
|
|
556
|
+
scripts: [
|
|
557
|
+
]
|
|
558
|
+
};
|
|
559
|
+
const npm = {
|
|
560
|
+
totalTransferKb: 0,
|
|
561
|
+
totalDecodedKb: 0,
|
|
562
|
+
loadTimeMs: 0,
|
|
563
|
+
scripts: [
|
|
564
|
+
]
|
|
565
|
+
};
|
|
566
|
+
const googleRecaptcha = {
|
|
567
|
+
totalTransferKb: 360.6,
|
|
568
|
+
totalDecodedKb: 843.2,
|
|
569
|
+
loadTimeMs: 247,
|
|
570
|
+
scripts: [
|
|
571
|
+
{
|
|
572
|
+
url: "https://www.google.com/recaptcha/api.js",
|
|
573
|
+
transferKb: 1.5,
|
|
574
|
+
decodedKb: 1.6,
|
|
575
|
+
encoding: "gzip",
|
|
576
|
+
durationMs: 247,
|
|
577
|
+
initiatorType: "script",
|
|
578
|
+
protocol: "unknown"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
url: "https://www.gstatic.com/recaptcha/releases/AWtrSI7lAmTAfV1rzWqEqz54/recaptcha__en.js",
|
|
582
|
+
transferKb: 359.1,
|
|
583
|
+
decodedKb: 841.6,
|
|
584
|
+
encoding: "gzip",
|
|
585
|
+
durationMs: 201,
|
|
586
|
+
initiatorType: "script",
|
|
587
|
+
protocol: "h2"
|
|
588
|
+
}
|
|
589
|
+
]
|
|
590
|
+
};
|
|
591
|
+
const googleSignIn = {
|
|
592
|
+
totalTransferKb: 91.8,
|
|
593
|
+
totalDecodedKb: 246.7,
|
|
594
|
+
loadTimeMs: 567,
|
|
595
|
+
scripts: [
|
|
596
|
+
{
|
|
597
|
+
url: "https://accounts.google.com/gsi/client",
|
|
598
|
+
transferKb: 91.8,
|
|
599
|
+
decodedKb: 246.7,
|
|
600
|
+
encoding: "gzip",
|
|
601
|
+
durationMs: 567,
|
|
602
|
+
initiatorType: "script",
|
|
603
|
+
protocol: "unknown"
|
|
604
|
+
}
|
|
605
|
+
]
|
|
606
|
+
};
|
|
607
|
+
const scriptSizes = {
|
|
608
|
+
plausibleAnalytics: plausibleAnalytics,
|
|
609
|
+
cloudflareWebAnalytics: cloudflareWebAnalytics,
|
|
610
|
+
postHog: postHog,
|
|
611
|
+
fathomAnalytics: fathomAnalytics,
|
|
612
|
+
matomoAnalytics: matomoAnalytics,
|
|
613
|
+
rybbitAnalytics: rybbitAnalytics,
|
|
614
|
+
databuddyAnalytics: databuddyAnalytics,
|
|
615
|
+
segment: segment,
|
|
616
|
+
googleAnalytics: googleAnalytics,
|
|
617
|
+
umamiAnalytics: umamiAnalytics,
|
|
618
|
+
metaPixel: metaPixel,
|
|
619
|
+
xPixel: xPixel,
|
|
620
|
+
tikTokPixel: tikTokPixel,
|
|
621
|
+
snapchatPixel: snapchatPixel,
|
|
622
|
+
redditPixel: redditPixel,
|
|
623
|
+
googleAdsense: googleAdsense,
|
|
624
|
+
carbonAds: carbonAds,
|
|
625
|
+
hotjar: hotjar,
|
|
626
|
+
clarity: clarity,
|
|
627
|
+
googleTagManager: googleTagManager,
|
|
628
|
+
intercom: intercom,
|
|
629
|
+
crisp: crisp,
|
|
630
|
+
stripe: stripe,
|
|
631
|
+
lemonSqueezy: lemonSqueezy,
|
|
632
|
+
payPal: payPal,
|
|
633
|
+
vimeoPlayer: vimeoPlayer,
|
|
634
|
+
youTubePlayer: youTubePlayer,
|
|
635
|
+
googleMaps: googleMaps,
|
|
636
|
+
npm: npm,
|
|
637
|
+
googleRecaptcha: googleRecaptcha,
|
|
638
|
+
googleSignIn: googleSignIn
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
function computePrivacyLevel(privacy) {
|
|
642
|
+
if (!privacy)
|
|
643
|
+
return "unknown";
|
|
644
|
+
const flags = Object.values(privacy);
|
|
645
|
+
if (flags.every(Boolean))
|
|
646
|
+
return "full";
|
|
647
|
+
if (flags.some(Boolean))
|
|
648
|
+
return "partial";
|
|
649
|
+
return "none";
|
|
650
|
+
}
|
|
651
|
+
function extractDomains(routes) {
|
|
652
|
+
const domains = /* @__PURE__ */ new Set();
|
|
653
|
+
for (const { proxy } of Object.values(routes)) {
|
|
654
|
+
const match = proxy.match(/^https?:\/\/([^/]+)/);
|
|
655
|
+
if (match?.[1])
|
|
656
|
+
domains.add(match[1]);
|
|
657
|
+
}
|
|
658
|
+
return [...domains].sort();
|
|
659
|
+
}
|
|
660
|
+
function deriveMetaKey(importName, label) {
|
|
661
|
+
if (importName) {
|
|
662
|
+
const stripped = importName.replace(/^useScript/, "");
|
|
663
|
+
return stripped.charAt(0).toLowerCase() + stripped.slice(1);
|
|
664
|
+
}
|
|
665
|
+
if (label) {
|
|
666
|
+
const words = label.split(/[\s-]+/);
|
|
667
|
+
return words.map(
|
|
668
|
+
(w, i) => i === 0 ? w.toLowerCase() : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()
|
|
669
|
+
).join("");
|
|
670
|
+
}
|
|
671
|
+
return "";
|
|
672
|
+
}
|
|
673
|
+
async function getScriptStats() {
|
|
674
|
+
const { registry } = await import('./registry.mjs');
|
|
675
|
+
const entries = await registry();
|
|
676
|
+
const proxyConfigs = getAllProxyConfigs("/_scripts");
|
|
677
|
+
const sizes = scriptSizes;
|
|
678
|
+
return entries.map((entry) => {
|
|
679
|
+
const metaKey = deriveMetaKey(entry.import?.name, entry.label);
|
|
680
|
+
const meta = scriptMeta[metaKey];
|
|
681
|
+
const size = sizes[metaKey];
|
|
682
|
+
const proxyConfig = entry.proxy ? proxyConfigs[entry.proxy] : void 0;
|
|
683
|
+
let loadingMethod = "cdn";
|
|
684
|
+
if (entry.src === false)
|
|
685
|
+
loadingMethod = "npm";
|
|
686
|
+
else if (!entry.src && typeof entry.scriptBundling === "function")
|
|
687
|
+
loadingMethod = "dynamic";
|
|
688
|
+
const privacy = proxyConfig?.privacy ?? null;
|
|
689
|
+
const routes = proxyConfig?.routes ?? {};
|
|
690
|
+
const domains = extractDomains(routes);
|
|
691
|
+
const endpoints = Object.keys(routes).length;
|
|
692
|
+
return {
|
|
693
|
+
id: metaKey,
|
|
694
|
+
label: entry.label || metaKey,
|
|
695
|
+
category: entry.category || "unknown",
|
|
696
|
+
scripts: size?.scripts ?? [],
|
|
697
|
+
totalTransferKb: size?.totalTransferKb ?? 0,
|
|
698
|
+
totalDecodedKb: size?.totalDecodedKb ?? 0,
|
|
699
|
+
trackedData: meta?.trackedData ?? [],
|
|
700
|
+
hasBundling: entry.scriptBundling !== false && entry.scriptBundling !== void 0,
|
|
701
|
+
hasProxy: !!entry.proxy,
|
|
702
|
+
domains,
|
|
703
|
+
endpoints,
|
|
704
|
+
privacy,
|
|
705
|
+
privacyLevel: computePrivacyLevel(privacy),
|
|
706
|
+
loadingMethod
|
|
707
|
+
};
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export { getScriptStats };
|
package/dist/types.d.mts
CHANGED