rudder-sdk-js 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +9 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -5519,7 +5519,7 @@
5519
5519
  PRODUCT_REVIEWED: "Product Reviewed"
5520
5520
  }; // Enumeration for integrations supported
5521
5521
 
5522
- var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.4.1";
5522
+ var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.4.2";
5523
5523
  var MAX_WAIT_FOR_INTEGRATION_LOAD = 10000;
5524
5524
  var INTEGRATION_LOAD_CHECK_INTERVAL = 1000;
5525
5525
  var POLYFILL_URL = "https://polyfill.io/v3/polyfill.min.js?features=Array.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries";
@@ -34221,7 +34221,7 @@
34221
34221
  this.build = "1.0.0";
34222
34222
  this.name = "RudderLabs JavaScript SDK";
34223
34223
  this.namespace = "com.rudderlabs.javascript";
34224
- this.version = "1.4.1";
34224
+ this.version = "1.4.2";
34225
34225
  });
34226
34226
 
34227
34227
  // Library information class
@@ -34229,7 +34229,7 @@
34229
34229
  _classCallCheck(this, RudderLibraryInfo);
34230
34230
 
34231
34231
  this.name = "RudderLabs JavaScript SDK";
34232
- this.version = "1.4.1";
34232
+ this.version = "1.4.2";
34233
34233
  }); // Operating System information class
34234
34234
 
34235
34235
 
@@ -36138,7 +36138,7 @@
36138
36138
  };
36139
36139
  var payload = JSON.stringify(data, this.replacer);
36140
36140
  var blob = new Blob([payload], {
36141
- type: "application/json"
36141
+ type: "text/plain"
36142
36142
  });
36143
36143
  var isPushed = navigator.sendBeacon("".concat(this.url, "?writeKey=").concat(this.writekey), blob);
36144
36144
 
@@ -36196,7 +36196,7 @@
36196
36196
  var queueOptions = {};
36197
36197
  var targetUrl = url.slice(-1) === "/" ? url.slice(0, -1) : url;
36198
36198
 
36199
- if (options && options.useBeacon) {
36199
+ if (options && options.useBeacon && navigator.sendBeacon) {
36200
36200
  if (options && options.beaconQueueOptions && options.beaconQueueOptions != null && _typeof(options.beaconQueueOptions) === "object") {
36201
36201
  queueOptions = options.beaconQueueOptions;
36202
36202
  }
@@ -36204,6 +36204,10 @@
36204
36204
  targetUrl = "".concat(targetUrl, "/beacon/v1/batch");
36205
36205
  this.queue = new BeaconQueue();
36206
36206
  } else {
36207
+ if (options && options.useBeacon) {
36208
+ logger.info("[EventRepository] sendBeacon feature not available in this browser :: fallback to XHR");
36209
+ }
36210
+
36207
36211
  if (options && options.queueOptions && options.queueOptions != null && _typeof(options.queueOptions) === "object") {
36208
36212
  queueOptions = options.queueOptions;
36209
36213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rudder-sdk-js",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "RudderStack Javascript SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",