@ecomconsult/consentkit 0.5.3 → 0.5.4

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.
@@ -28,7 +28,7 @@ export function undecidedState() {
28
28
  */
29
29
  export function createStub() {
30
30
  const stub = {
31
- version: '0.5.3',
31
+ version: '0.5.4',
32
32
  config: {},
33
33
  init: function () { return undecidedState(); },
34
34
  allowed: function (cat) { return cat === 'necessary'; },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecomconsult/consentkit",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "GDPR cookie consent core with blocking engine, Shadow DOM UI and Google Consent Mode v2. Zero dependencies, no build step.",
5
5
  "repository": {
6
6
  "type": "git",
package/src/ck-core.js CHANGED
@@ -81,6 +81,13 @@
81
81
  // INFRA_DB: the rest of Cloudflare's edge is infrastructure, but this one
82
82
  // beacon is a measurement product (§8 names it by hand for that reason).
83
83
  'static.cloudflareinsights.com': 'analytics',
84
+ // Tilda's stats endpoint. The REST of tildaapi.one is platform plumbing and
85
+ // sits in INFRA_DB host by host; this one subdomain measures visitors, so it
86
+ // is classified here instead. There is deliberately NO bare `tildaapi.one`
87
+ // in either table: lookupHostMap returns the FIRST matching key, not the
88
+ // longest, so a bare entry could shadow this one depending on insertion
89
+ // order. Every Tilda API host is therefore named in full.
90
+ 'stat.tildaapi.one': 'analytics',
84
91
 
85
92
  // --- marketing -----------------------------------------------------
86
93
  'connect.facebook.net': 'marketing',
@@ -137,6 +144,22 @@
137
144
  // iuteCredit — a Moldovan consumer-credit calculator embedded on shop
138
145
  // product pages. A third party the owner chose, offering a feature.
139
146
  'iutecredit.md': 'functional',
147
+ // Google Maps — a map or a store locator the owner embedded. It is a
148
+ // FEATURE, not measurement: a visitor who declines functional loses the map
149
+ // and nothing else. The two API hosts are dedicated to Maps, so the whole
150
+ // host is the right scope; the www.google.com/maps halves cannot be, and
151
+ // are path-scoped in PATH_DB below.
152
+ //
153
+ // maps.gstatic.com is the deliberate exception to `gstatic.com` sitting in
154
+ // INFRA_DB: the parent serves fonts and ordinary images a page is broken
155
+ // without, but this subdomain serves the map tiles and marker sprites of an
156
+ // embed the owner chose. categoryForUrl runs BEFORE the strict allowlist, so
157
+ // naming it here classifies (and holds) it while fonts.gstatic.com stays
158
+ // waved through — which is the split the pair of tests in blocking.test.mjs
159
+ // pins down.
160
+ 'maps.googleapis.com': 'functional',
161
+ 'places.googleapis.com': 'functional',
162
+ 'maps.gstatic.com': 'functional',
140
163
 
141
164
  // --- necessary -----------------------------------------------------
142
165
  // recaptcha.net is Google's alternate reCAPTCHA domain, served for regions
@@ -183,6 +206,34 @@
183
206
  '/gtag/js': 'analytics', // googletagmanager.com/gtag/js?id=G-XXXX
184
207
  'www.google.com/recaptcha/': 'necessary',
185
208
  'www.gstatic.com/recaptcha/': 'necessary',
209
+ // Google Maps on www.google.<tld>. Like reCAPTCHA above, the host cannot be
210
+ // given a category as a whole, so the map is named by path. Functional: it
211
+ // is a map the owner put on the page, and allowed() holds it until the
212
+ // visitor accepts functional.
213
+ //
214
+ // The host half is kept IN the key rather than matching a bare '/maps/'.
215
+ // Every fragment here is tested against the WHOLE resolved URL, so a bare
216
+ // key would also classify a site's OWN page at /maps/… . For '/gtag/js'
217
+ // that is intended (a self-hosted gtag really is analytics); a first-party
218
+ // route called /maps/embed is just a route.
219
+ //
220
+ // Google serves the iframe embed from google.com/maps/embed regardless of
221
+ // the visitor's country, so google.com covers the embed case; the ccTLD
222
+ // hosts appear for /maps/ links, which the first key covers on www.google
223
+ // .com and which are ordinary navigation elsewhere.
224
+ 'www.google.com/maps/': 'functional',
225
+ 'google.com/maps/embed': 'functional', // also maps.google.com
226
+ // Google Ads pings that carry no cookie of their own but still report a
227
+ // visit to the ad platform — the remarketing/conversion beacons a gtag or
228
+ // Ads tag fires against www.google.<tld>. They reach doubleclick.net too,
229
+ // where HOST_DB already files them as marketing; these keys are what catches
230
+ // the www.google.com and www.google.lt (and every other ccTLD) form, which
231
+ // no host entry can cover without ruling on all of Google at once. Matching
232
+ // is a substring test against the WHOLE resolved URL, so a leading path
233
+ // fragment matches every host.
234
+ '/pagead/1p-user-list/': 'marketing',
235
+ '/pagead/1p-conversion/': 'marketing',
236
+ '/ads/ga-audiences': 'marketing',
186
237
  '/trackers/ga.js': 'analytics',
187
238
  '/trackers/pixel.js': 'marketing',
188
239
  '/trackers/chat.js': 'functional'
@@ -304,7 +355,21 @@
304
355
  // --- site builders and hosting platforms ---------------------------
305
356
  'tildacdn.com',
306
357
  'tildacdn.net',
358
+ 'tildacdn.one',
359
+ 'static.tildacdn.one', // redundant under the line above, named
360
+ // for symmetry with the tildacdn.com
361
+ // fixtures, which use the same subdomain
307
362
  'tilda.ws',
363
+ // Tilda's own platform APIs: block feeds, geo lookup, the members area and
364
+ // form delivery. A Tilda page is broken without them and none of them is a
365
+ // decision the site owner made — they are the builder serving its own site.
366
+ // Enumerated one by one rather than as a bare `tildaapi.one`, because
367
+ // stat.tildaapi.one IS measurement and sits in HOST_DB as analytics; a bare
368
+ // suffix here would be a claim about that host too.
369
+ 'feeds.tildaapi.one',
370
+ 'geo.tildaapi.one',
371
+ 'members.tildaapi.one',
372
+ 'forms.tildaapi.one',
308
373
  'static.wixstatic.com',
309
374
  'parastorage.com', // Wix static assets
310
375
  'cdn.shopify.com',
@@ -325,6 +390,8 @@
325
390
  'b-cdn.net', // bunny.net
326
391
  // --- fonts ----------------------------------------------------------
327
392
  'fonts.googleapis.com',
393
+ 'fonts.google.com', // the catalogue host; some embeds and
394
+ // builders link stylesheets through it
328
395
  // gstatic.com whole: Google's static-asset domain. Its subdomains serve
329
396
  // fonts (fonts.gstatic.com), the reCAPTCHA widget's own code
330
397
  // (www.gstatic.com/recaptcha/) and ordinary images — assets a page is
@@ -880,6 +947,15 @@
880
947
  // miss every page that sets it after the core loads.
881
948
  function isInfraHost(host) {
882
949
  if (!host) { return false; }
950
+ // A host the database gives a CATEGORY to is never infrastructure, even when
951
+ // it sits under an INFRA_DB suffix. Without this, maps.gstatic.com (named as
952
+ // `functional` in HOST_DB, under a bare `gstatic.com` here) would be held
953
+ // back by the engine until functional consent while the scanner — which
954
+ // reads _infra() to set thirdParty[].infra — filed it as infrastructure and
955
+ // kept it out of the report entirely. Blocking and reporting would then
956
+ // disagree about one host, which is exactly what §8 exists to prevent.
957
+ // Every other INFRA_DB entry is uncategorised, so this changes nothing else.
958
+ if (lookupHostMap(EXTRA_DB, host) || lookupHostMap(HOST_DB, host)) { return false; }
883
959
  for (var i = 0; i < INFRA_DB.length; i++) {
884
960
  if (hostMatches(host, INFRA_DB[i])) { return true; }
885
961
  }
@@ -1461,7 +1537,7 @@
1461
1537
  // Public API
1462
1538
  // ---------------------------------------------------------------------------
1463
1539
  var ConsentKit = {
1464
- version: '0.5.3',
1540
+ version: '0.5.4',
1465
1541
  config: config,
1466
1542
 
1467
1543
  init: function (userConfig) {