@pendo/agent 2.309.0 → 2.310.0

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/dist/dom.esm.js CHANGED
@@ -7428,7 +7428,7 @@ function applyMatrix2dRect(matrix2d, rect) {
7428
7428
  return transformedRect;
7429
7429
  }
7430
7430
 
7431
- var VERSION = '2.309.0_';
7431
+ var VERSION = '2.310.0_';
7432
7432
 
7433
7433
  var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
7434
7434
 
@@ -7534,8 +7534,10 @@ var setCookie = function (name, val, millisToExpire, isSecure) {
7534
7534
  }
7535
7535
  var cookieTTL = limitCookieTTL(millisToExpire);
7536
7536
  var expireDate = new Date();
7537
+ var canSecure = document.location.protocol === 'https:' || isSecure;
7538
+ var sameSite = canSecure ? 'None' : 'Strict';
7537
7539
  expireDate.setTime(expireDate.getTime() + cookieTTL);
7538
- var cookie = name + '=' + encodeURIComponent(val) + (millisToExpire ? ';expires=' + expireDate.toUTCString() : '') + '; path=/' + (document.location.protocol === 'https:' || isSecure ? ';secure' : '') + '; SameSite=Strict';
7540
+ var cookie = name + '=' + encodeURIComponent(val) + (millisToExpire ? ';expires=' + expireDate.toUTCString() : '') + '; path=/' + (canSecure ? ';secure' : '') + '; SameSite=' + sameSite;
7539
7541
  if (storageIsDisabled() || allowLocalStorageOnly()) {
7540
7542
  inMemoryCookies[name] = cookie;
7541
7543
  }
@@ -10023,7 +10025,7 @@ var ElementGetter = /** @class */ (function () {
10023
10025
  }
10024
10026
  ElementGetter.prototype.get = function () {
10025
10027
  var _this = this;
10026
- var el = this.elRef && this.elRef.deref();
10028
+ var el = this.elRef && this.elRef.deref && this.elRef.deref();
10027
10029
  var isInDoc = isInDocument(el); // is this safe to call if el is null?
10028
10030
  if (el && isInDoc)
10029
10031
  return el;
@@ -3912,8 +3912,8 @@ let SERVER = '';
3912
3912
  let ASSET_HOST = '';
3913
3913
  let ASSET_PATH = '';
3914
3914
  let DESIGNER_SERVER = '';
3915
- let VERSION = '2.309.0_';
3916
- let PACKAGE_VERSION = '2.309.0';
3915
+ let VERSION = '2.310.0_';
3916
+ let PACKAGE_VERSION = '2.310.0';
3917
3917
  let LOADER = 'xhr';
3918
3918
  /* eslint-enable agent-eslint-rules/no-gulp-env-references */
3919
3919
  /**
@@ -4458,8 +4458,10 @@ var setCookie = function (name, val, millisToExpire, isSecure) {
4458
4458
  }
4459
4459
  const cookieTTL = limitCookieTTL(millisToExpire);
4460
4460
  var expireDate = new Date();
4461
+ const canSecure = document.location.protocol === 'https:' || isSecure;
4462
+ const sameSite = canSecure ? 'None' : 'Strict';
4461
4463
  expireDate.setTime(expireDate.getTime() + cookieTTL);
4462
- var cookie = name + '=' + encodeURIComponent(val) + (millisToExpire ? ';expires=' + expireDate.toUTCString() : '') + '; path=/' + (document.location.protocol === 'https:' || isSecure ? ';secure' : '') + '; SameSite=Strict';
4464
+ var cookie = name + '=' + encodeURIComponent(val) + (millisToExpire ? ';expires=' + expireDate.toUTCString() : '') + '; path=/' + (canSecure ? ';secure' : '') + '; SameSite=' + sameSite;
4463
4465
  if (cookieDomain) {
4464
4466
  cookie += ';domain=' + cookieDomain;
4465
4467
  }
@@ -11516,7 +11518,7 @@ class ElementGetter {
11516
11518
  this.cssSelector = cssSelector;
11517
11519
  }
11518
11520
  get() {
11519
- let el = this.elRef && this.elRef.deref();
11521
+ let el = this.elRef && this.elRef.deref && this.elRef.deref();
11520
11522
  const isInDoc = isInDocument(el); // is this safe to call if el is null?
11521
11523
  if (el && isInDoc)
11522
11524
  return el;
@@ -34640,7 +34642,7 @@ const IFrameMonitor = (function () {
34640
34642
  (frame.document.head || frame.document.body).appendChild(script);
34641
34643
  }
34642
34644
  }
34643
- function handleContentLoaded(frame, agentUrl) {
34645
+ function handleLoaded(frame, agentUrl) {
34644
34646
  frame.pendo.iframeWaiting = false;
34645
34647
  appendScriptTagToFrame(frame, agentUrl);
34646
34648
  }
@@ -34662,7 +34664,7 @@ const IFrameMonitor = (function () {
34662
34664
  }
34663
34665
  else {
34664
34666
  frame.pendo = { iframeWaiting: true }; // Add empty pendo object just so we don't try to add pendo to the frame twice while we wait
34665
- frame.document.addEventListener('DOMContentLoaded', pendoGlobal._.partial(handleContentLoaded, frame, agentUrl));
34667
+ frame.addEventListener('load', pendoGlobal._.partial(handleLoaded, frame, agentUrl));
34666
34668
  }
34667
34669
  }
34668
34670
  function checkForFrames() {
@@ -53600,6 +53602,7 @@ const RECORDING_CONFIG_ON_RECORDING_START = 'recording.onRecordingStart';
53600
53602
  const RECORDING_CONFIG_ON_RECORDING_STOP = 'recording.onRecordingStop';
53601
53603
  const RECORDING_CONFIG_WORKER_OVERRIDE = 'recording.workerOverride';
53602
53604
  const RECORDING_CONFIG_TREAT_IFRAME_AS_ROOT = 'recording.treatIframeAsRoot';
53605
+ const RECORDING_CONFIG_DISABLE_UNLOAD = 'recording.disableUnload';
53603
53606
  const RESOURCE_CACHING = 'resourceCaching';
53604
53607
  const ONE_DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000;
53605
53608
  const THIRTY_MINUTES = 1000 * 60 * 30;
@@ -54325,6 +54328,8 @@ class SessionRecorder {
54325
54328
  this.send({ hidden: true });
54326
54329
  }
54327
54330
  handleUnload() {
54331
+ if (this.api.ConfigReader.get(RECORDING_CONFIG_DISABLE_UNLOAD))
54332
+ return;
54328
54333
  this.send({ unload: true });
54329
54334
  }
54330
54335
  buildRequestUrl(baseUrl, queryObj) {
@@ -55418,9 +55423,9 @@ const MAX_LENGTH = 1000;
55418
55423
  const PII_PATTERN = {
55419
55424
  ip: /\b(?:\d{1,3}\.){3}\d{1,3}\b/g,
55420
55425
  ssn: /\b\d{3}-\d{2}-\d{4}\b/g,
55421
- creditCard: /\b(?:\d[ -]*?){13,16}\b/g,
55426
+ creditCard: /\b(?:\d[ -]?){12,18}\d\b/g,
55422
55427
  httpsUrls: /https:\/\/[^\s]+/g,
55423
- email: /\b\S+@[\w-]+\.[\w-]+\b/g
55428
+ email: /[\w._+-]+@[\w.-]+\.\w+/g
55424
55429
  };
55425
55430
  const PII_REPLACEMENT = '*'.repeat(10);
55426
55431
  const JSON_PII_KEYS = ['password', 'email', 'key', 'token', 'auth', 'authentication', 'phone', 'address', 'ssn'];