@microsoft/applicationinsights-web-basic 3.0.0-beta.2209-01 → 3.0.0-beta.2210-01

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.
package/browser/aib.2.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript Web SDK - Basic, 3.0.0-beta.2209-01
2
+ * Application Insights JavaScript Web SDK - Basic, 3.0.0-beta.2210-01
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -470,14 +470,21 @@
470
470
  return _hasNavigator ? navigator : getInst(NAVIGATOR);
471
471
  }
472
472
 
473
+ var objGetOwnPropertyDescriptor = ObjClass.getOwnPropertyDescriptor;
474
+
473
475
  function objHasOwnProperty(obj, prop) {
474
476
  return obj && ObjProto[HAS_OWN_PROPERTY].call(obj, prop);
475
477
  }
476
478
 
479
+ var objHasOwn = ObjClass["hasOwn"] || polyObjHasOwn;
480
+ function polyObjHasOwn(obj, prop) {
481
+ return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop);
482
+ }
483
+
477
484
  function objForEachKey(theObject, callbackfn, thisArg) {
478
485
  if (theObject && isObject(theObject)) {
479
486
  for (var prop in theObject) {
480
- if (objHasOwnProperty(theObject, prop)) {
487
+ if (objHasOwn(theObject, prop)) {
481
488
  if (callbackfn.call(thisArg || theObject, prop, theObject[prop]) === -1) {
482
489
  break;
483
490
  }
@@ -725,6 +732,7 @@
725
732
  var _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
726
733
  var _DYN_CREATE_NEW = "createNew";
727
734
  var _DYN_COOKIE_CFG = "cookieCfg";
735
+ var _DYN_INDEX_OF$1 = "indexOf";
728
736
  var _DYN_SUBSTRING$1 = "substring";
729
737
  var _DYN_USER_AGENT = "userAgent";
730
738
  var _DYN_SPLIT$1 = "split";
@@ -1514,7 +1522,7 @@
1514
1522
  }
1515
1523
 
1516
1524
  var _objDefineProperty = ObjDefineProperty;
1517
- var version = "3.0.0-beta.2209-01";
1525
+ var version = "3.0.0-beta.2210-01";
1518
1526
  var instanceName = "." + newId(6);
1519
1527
  var _dataUid = 0;
1520
1528
  function _createAccessor(target, prop, value) {
@@ -2279,6 +2287,20 @@
2279
2287
  }
2280
2288
  return cookieMgrCfg;
2281
2289
  }
2290
+ function _isIgnoredCookie(cookieMgrCfg, name) {
2291
+ if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) {
2292
+ return cookieMgrCfg.ignoreCookies[_DYN_INDEX_OF$1 ](name) !== -1;
2293
+ }
2294
+ return false;
2295
+ }
2296
+ function _isBlockedCookie(cookieMgrCfg, name) {
2297
+ if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) {
2298
+ if (cookieMgrCfg.blockedCookies[_DYN_INDEX_OF$1 ](name) !== -1) {
2299
+ return true;
2300
+ }
2301
+ }
2302
+ return _isIgnoredCookie(cookieMgrCfg, name);
2303
+ }
2282
2304
  function createCookieMgr(rootConfig, logger) {
2283
2305
  var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);
2284
2306
  var _path = cookieMgrConfig.path || "/";
@@ -2298,10 +2320,10 @@
2298
2320
  },
2299
2321
  set: function (name, value, maxAgeSec, domain, path) {
2300
2322
  var result = false;
2301
- if (_isMgrEnabled(cookieMgr)) {
2323
+ if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) {
2302
2324
  var values = {};
2303
2325
  var theValue = strTrim(value || STR_EMPTY);
2304
- var idx = theValue.indexOf(";");
2326
+ var idx = theValue[_DYN_INDEX_OF$1 ](";");
2305
2327
  if (idx !== -1) {
2306
2328
  theValue = strTrim(value[_DYN_SUBSTRING$1 ](0, idx));
2307
2329
  values = _extractParts(value[_DYN_SUBSTRING$1 ](idx + 1));
@@ -2341,7 +2363,7 @@
2341
2363
  },
2342
2364
  get: function (name) {
2343
2365
  var value = STR_EMPTY;
2344
- if (_isMgrEnabled(cookieMgr)) {
2366
+ if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) {
2345
2367
  value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
2346
2368
  }
2347
2369
  return value;
@@ -2394,7 +2416,7 @@
2394
2416
  arrForEach(parts, function (thePart) {
2395
2417
  thePart = strTrim(thePart || STR_EMPTY);
2396
2418
  if (thePart) {
2397
- var idx = thePart.indexOf("=");
2419
+ var idx = thePart[_DYN_INDEX_OF$1 ]("=");
2398
2420
  if (idx === -1) {
2399
2421
  values[thePart] = null;
2400
2422
  }
@@ -4019,6 +4041,9 @@
4019
4041
  else if (window && window["opera"] && errorObj[strMessage]) {
4020
4042
  details = _getOperaStack(errorObj[_DYN_MESSAGE ]);
4021
4043
  }
4044
+ else if (errorObj["reason"] && errorObj.reason[strStack]) {
4045
+ details = _convertStackObj(errorObj.reason[strStack]);
4046
+ }
4022
4047
  else if (isString(errorObj)) {
4023
4048
  details = _convertStackObj(errorObj);
4024
4049
  }
@@ -4891,7 +4916,7 @@
4891
4916
  }
4892
4917
  }
4893
4918
  var EnvelopeCreator = {
4894
- Version: "3.0.0-beta.2209-01"
4919
+ Version: "3.0.0-beta.2210-01"
4895
4920
  };
4896
4921
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
4897
4922
  EnvelopeCreatorInit(logger, telemetryItem);