@guardian/consent-management-platform
Advanced tools
Comparing version 13.3.0 to 13.3.1
@@ -926,29 +926,35 @@ import { log, removeCookie, storage } from '@guardian/libs'; | ||
const removeData = (consent) => Object.keys(vendorStorageIds).forEach((vendor) => { | ||
const consentForVendor = getConsentFor$1(vendor, consent); | ||
const vendorData = vendorStorageIds[vendor]; | ||
if (!consentForVendor) { | ||
if ('cookies' in vendorData) { | ||
vendorData.cookies.forEach((name) => { | ||
removeCookie({ name }); | ||
}); | ||
} | ||
if ('localStorage' in vendorData) { | ||
vendorData.localStorage.forEach((name) => { | ||
storage.local.remove(name); | ||
}); | ||
} | ||
if ('sessionStorage' in vendorData) { | ||
vendorData.sessionStorage.forEach((name) => { | ||
storage.session.remove(name); | ||
}); | ||
} | ||
} | ||
}); | ||
const initVendorDataManager = () => { | ||
onConsentChange$1((consent) => { | ||
requestIdleCallback(() => { | ||
Object.keys(vendorStorageIds).forEach((vendor) => { | ||
const consentForVendor = getConsentFor$1(vendor, consent); | ||
const vendorData = vendorStorageIds[vendor]; | ||
if (!consentForVendor) { | ||
if ('cookies' in vendorData) { | ||
vendorData.cookies.forEach((name) => { | ||
removeCookie({ name }); | ||
}); | ||
} | ||
if ('localStorage' in vendorData) { | ||
vendorData.localStorage.forEach((name) => { | ||
storage.local.remove(name); | ||
}); | ||
} | ||
if ('sessionStorage' in vendorData) { | ||
vendorData.sessionStorage.forEach((name) => { | ||
storage.session.remove(name); | ||
}); | ||
} | ||
} | ||
if ('requestIdleCallback' in window) { | ||
requestIdleCallback(() => { | ||
removeData(consent); | ||
}, { | ||
timeout: 2000, | ||
}); | ||
}, { | ||
timeout: 2000, | ||
}); | ||
} | ||
else { | ||
removeData(consent); | ||
} | ||
}); | ||
@@ -971,5 +977,5 @@ }; | ||
if (window.guCmpHotFix.initialised) { | ||
if (window.guCmpHotFix.cmp?.version !== "13.3.0") | ||
if (window.guCmpHotFix.cmp?.version !== "13.3.1") | ||
console.warn('Two different versions of the CMP are running:', [ | ||
"13.3.0", | ||
"13.3.1", | ||
window.guCmpHotFix.cmp?.version, | ||
@@ -1012,3 +1018,3 @@ ]); | ||
showPrivacyManager, | ||
version: "13.3.0", | ||
version: "13.3.1", | ||
__isDisabled: isDisabled, | ||
@@ -1015,0 +1021,0 @@ __enable: enable, |
@@ -930,29 +930,35 @@ 'use strict'; | ||
const removeData = (consent) => Object.keys(vendorStorageIds).forEach((vendor) => { | ||
const consentForVendor = getConsentFor$1(vendor, consent); | ||
const vendorData = vendorStorageIds[vendor]; | ||
if (!consentForVendor) { | ||
if ('cookies' in vendorData) { | ||
vendorData.cookies.forEach((name) => { | ||
libs.removeCookie({ name }); | ||
}); | ||
} | ||
if ('localStorage' in vendorData) { | ||
vendorData.localStorage.forEach((name) => { | ||
libs.storage.local.remove(name); | ||
}); | ||
} | ||
if ('sessionStorage' in vendorData) { | ||
vendorData.sessionStorage.forEach((name) => { | ||
libs.storage.session.remove(name); | ||
}); | ||
} | ||
} | ||
}); | ||
const initVendorDataManager = () => { | ||
onConsentChange$1((consent) => { | ||
requestIdleCallback(() => { | ||
Object.keys(vendorStorageIds).forEach((vendor) => { | ||
const consentForVendor = getConsentFor$1(vendor, consent); | ||
const vendorData = vendorStorageIds[vendor]; | ||
if (!consentForVendor) { | ||
if ('cookies' in vendorData) { | ||
vendorData.cookies.forEach((name) => { | ||
libs.removeCookie({ name }); | ||
}); | ||
} | ||
if ('localStorage' in vendorData) { | ||
vendorData.localStorage.forEach((name) => { | ||
libs.storage.local.remove(name); | ||
}); | ||
} | ||
if ('sessionStorage' in vendorData) { | ||
vendorData.sessionStorage.forEach((name) => { | ||
libs.storage.session.remove(name); | ||
}); | ||
} | ||
} | ||
if ('requestIdleCallback' in window) { | ||
requestIdleCallback(() => { | ||
removeData(consent); | ||
}, { | ||
timeout: 2000, | ||
}); | ||
}, { | ||
timeout: 2000, | ||
}); | ||
} | ||
else { | ||
removeData(consent); | ||
} | ||
}); | ||
@@ -975,5 +981,5 @@ }; | ||
if (window.guCmpHotFix.initialised) { | ||
if (window.guCmpHotFix.cmp?.version !== "13.3.0") | ||
if (window.guCmpHotFix.cmp?.version !== "13.3.1") | ||
console.warn('Two different versions of the CMP are running:', [ | ||
"13.3.0", | ||
"13.3.1", | ||
window.guCmpHotFix.cmp?.version, | ||
@@ -1016,3 +1022,3 @@ ]); | ||
showPrivacyManager, | ||
version: "13.3.0", | ||
version: "13.3.1", | ||
__isDisabled: isDisabled, | ||
@@ -1019,0 +1025,0 @@ __enable: enable, |
{ | ||
"name": "@guardian/consent-management-platform", | ||
"version": "13.3.0", | ||
"version": "13.3.1", | ||
"description": "Consent management for *.theguardian.com.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/guardian/consent-management-platform.git", |
2547
101711