@aller/blink-labrador
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -13,2 +13,3 @@ 'use strict'; | ||
exports.hasMeasurementConsent = hasMeasurementConsent; | ||
exports.hasEveryConsent = hasEveryConsent; | ||
/** | ||
@@ -78,2 +79,9 @@ * This is a typical response from OIL | ||
hasConsent(CMP_MEASUREMENT, cb); | ||
} | ||
function hasEveryConsent(cb) { | ||
getVendorConsents(function (res) { | ||
var cons = res.purposeConsents; | ||
cb(cons[CMP_INFORMATION_STORAGE] && cons[CMP_PERSONALISATION] && cons[CMP_AD_TRACKING] && cons[CMP_CONTENT_TRACKING] && cons[CMP_MEASUREMENT]); | ||
}); | ||
} |
@@ -116,3 +116,3 @@ 'use strict'; | ||
send: function send(el) { | ||
return _sender2.default.sendWhenBefitting(el); | ||
return _sender2.default.checkPermissionsBeforeSending(el); | ||
}, | ||
@@ -119,0 +119,0 @@ utils: { |
@@ -32,2 +32,4 @@ 'use strict'; | ||
var _cmp = require('../gdpr/cmp'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -41,2 +43,14 @@ | ||
function sendWithBeacon(events) { | ||
var data = JSON.stringify(events); | ||
if ('sendBeacon' in navigator) { | ||
window.navigator.sendBeacon(sendUrl, data); | ||
} else { | ||
var req = new XMLHttpRequest(); | ||
req.open('POST', sendUrl, true); | ||
req.setRequestHeader('Content-Type', 'application/json'); | ||
req.send(data); | ||
} | ||
} | ||
// Configure batching | ||
@@ -54,13 +68,3 @@ setInterval(function () { | ||
_sender2.default.configureSend(function (events) { | ||
var data = JSON.stringify(events); | ||
if ('sendBeacon' in navigator) { | ||
window.navigator.sendBeacon(sendUrl, data); | ||
} else { | ||
var req = new XMLHttpRequest(); | ||
req.open('POST', sendUrl, true); | ||
req.setRequestHeader('Content-Type', 'application/json'); | ||
req.send(data); | ||
} | ||
}); | ||
_sender2.default.configureSend(sendWithBeacon, _cmp.hasEveryConsent); | ||
@@ -67,0 +71,0 @@ // Configure event handlers |
@@ -24,3 +24,3 @@ 'use strict'; | ||
send = _ref.send, | ||
hasPersonalisationConsent = _ref.hasPersonalisationConsent; | ||
checkConsent = _ref.checkConsent; | ||
@@ -34,3 +34,3 @@ _classCallCheck(this, Sender); | ||
this.sentStore.add(sentEvents); | ||
this.hasPersonalisationConsent = hasPersonalisationConsent; | ||
this.checkConsent = checkConsent; | ||
} | ||
@@ -40,4 +40,5 @@ | ||
key: 'configureSend', | ||
value: function configureSend(send) { | ||
value: function configureSend(send, checkConsent) { | ||
this.send = send; | ||
this.checkConsent = checkConsent; | ||
} | ||
@@ -71,8 +72,11 @@ }, { | ||
value: function checkPermissionsBeforeSending() { | ||
var _this2 = this; | ||
var events = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; | ||
// Comment from the developer: Why are we not checking any other consents here? | ||
if (this.hasPersonalisationConsent) { | ||
this.sendWhenBefitting(events); | ||
} | ||
this.checkConsent(function (hasConsent) { | ||
if (hasConsent) { | ||
_this2.sendWhenBefitting(events); | ||
} | ||
}); | ||
} | ||
@@ -79,0 +83,0 @@ }, { |
{ | ||
"name": "@aller/blink-labrador", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Library for using blink on Labrador", | ||
@@ -21,3 +21,3 @@ "main": "lib/main.js", | ||
"transpile": "babel src/ -d lib/", | ||
"prepublish": "npm run transpile" | ||
"prepare": "npm run transpile" | ||
}, | ||
@@ -48,4 +48,3 @@ "repository": { | ||
"dependencies": { | ||
"@aller/blink": "0.0.16", | ||
"@aller/external-id": "^4.0.6", | ||
"@aller/blink": "0.0.17", | ||
"@soldotno/aller-in-view": "^3.0.2" | ||
@@ -55,2 +54,3 @@ }, | ||
"babel-cli": "^6.26.0", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
"babel-preset-env": "^1.7.0", | ||
@@ -61,4 +61,9 @@ "eslint": "^5.3.0", | ||
"jest": "^23.4.2", | ||
"rollup": "^0.64.1", | ||
"rollup-plugin-babel": "^3.0.7", | ||
"rollup-plugin-commonjs": "^9.1.4", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-plugin-replace": "^2.0.0", | ||
"size-limit": "^0.19.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43208
2
1130
13
+ Added@aller/blink@0.0.17(transitive)
+ Added@aller/external-id@4.0.7(transitive)
- Removed@aller/external-id@^4.0.6
- Removed@aller/blink@0.0.16(transitive)
- Removed@aller/external-id@4.0.64.3.2(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedanymatch@1.3.2(transitive)
- Removedarr-diff@2.0.04.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-unique@0.2.10.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedasync-each@1.0.6(transitive)
- Removedatob@2.1.2(transitive)
- Removedbabel-cli@6.26.0(transitive)
- Removedbabel-code-frame@6.26.0(transitive)
- Removedbabel-core@6.26.3(transitive)
- Removedbabel-generator@6.26.1(transitive)
- Removedbabel-helpers@6.24.1(transitive)
- Removedbabel-messages@6.23.0(transitive)
- Removedbabel-polyfill@6.26.0(transitive)
- Removedbabel-register@6.26.0(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedbabel-template@6.26.0(transitive)
- Removedbabel-traverse@6.26.0(transitive)
- Removedbabel-types@6.26.0(transitive)
- Removedbabylon@6.18.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbinary-extensions@1.13.1(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@1.8.52.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedchokidar@1.7.0(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removeddetect-indent@4.0.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedesutils@2.0.3(transitive)
- Removedexpand-brackets@0.1.52.1.4(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@0.3.22.0.4(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfill-range@2.2.44.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfs-readdir-recursive@1.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@1.2.13(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.0(transitive)
- Removedglobals@9.18.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhome-or-tmp@2.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedinvariant@2.2.4(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-binary-path@1.0.1(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-extglob@1.0.0(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-glob@2.0.1(transitive)
- Removedis-number@2.1.03.0.04.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedjs-tokens@3.0.2(transitive)
- Removedjsesc@1.3.0(transitive)
- Removedjson5@0.5.1(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmd5@2.3.0(transitive)
- Removedmicromatch@2.3.113.1.10(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedms@2.0.0(transitive)
- Removednan@2.20.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedoutput-file-sync@1.1.2(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedprivate@0.1.8(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedreaddirp@2.2.1(transitive)
- Removedregenerator-runtime@0.10.50.11.1(transitive)
- Removedregex-cache@0.4.4(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedslash@1.0.0(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-support@0.4.18(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedtlds@1.209.0(transitive)
- Removedto-fast-properties@1.0.3(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedtrim-right@1.0.1(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removeduser-home@1.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedv8flags@2.1.1(transitive)
- Removedwrappy@1.0.2(transitive)
Updated@aller/blink@0.0.17