Socket
Socket
Sign inDemoInstall

@aller/blink-labrador

Package Overview
Dependencies
Maintainers
16
Versions
284
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aller/blink-labrador - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

8

lib/gdpr/cmp.js

@@ -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]);
});
}

2

lib/main.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc