@pendo/agent 2.276.0 → 2.277.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
@@ -7228,7 +7228,7 @@ function getScreenPosition(element) {
7228
7228
  };
7229
7229
  }
7230
7230
 
7231
- var VERSION = '2.276.0_';
7231
+ var VERSION = '2.277.0_';
7232
7232
  function isExtensionAgent() {
7233
7233
  var installType = getPendoConfigValue('installType') || getPendoConfigFromEnclosingScope().installType;
7234
7234
  return installType === EXTENSION_INSTALL_TYPE;
@@ -8639,14 +8639,15 @@ function roundOffsetPosition(position) {
8639
8639
  });
8640
8640
  return position;
8641
8641
  }
8642
- function getOffsetPosition(element) {
8642
+ function getOffsetPosition(element, _win) {
8643
+ if (_win === void 0) { _win = window; }
8643
8644
  if (isPositionFixed(element)) {
8644
8645
  var fixedPosition = getScreenPosition(element);
8645
8646
  fixedPosition.fixed = true;
8646
8647
  return roundOffsetPosition(fixedPosition);
8647
8648
  }
8648
8649
  else {
8649
- var absolutePosition = getAbsolutePosition(element, getBody());
8650
+ var absolutePosition = getAbsolutePosition(element, getBody(_win.document), _win);
8650
8651
  return roundOffsetPosition(absolutePosition);
8651
8652
  }
8652
8653
  }
@@ -9668,11 +9669,23 @@ var WeakRef = (function(global, factory) {
9668
9669
  return nativeWeakRef;
9669
9670
  })(window, WeakRefFactory);
9670
9671
 
9672
+ var trimString = function (str, limit) {
9673
+ var len = str.length;
9674
+ if (len <= limit)
9675
+ return str;
9676
+ return trimSurrogate(str.substring(0, limit));
9677
+ };
9678
+ function getTextValue(elem, limit) {
9679
+ if (elem.tagName && ['textarea', 'input'].indexOf(elem.tagName.toLowerCase()) > -1) {
9680
+ return trimString(elem.value, limit);
9681
+ }
9682
+ return getText(elem, limit);
9683
+ }
9671
9684
  function getText(elem, limit) {
9685
+ if (limit === void 0) { limit = 128; }
9672
9686
  var ret = '';
9673
9687
  var nodeType = elem.nodeType;
9674
9688
  var sub;
9675
- limit = limit || 128;
9676
9689
  if (nodeType === TEXT || nodeType === CDATA_SECTION) {
9677
9690
  return elem.nodeValue;
9678
9691
  }
@@ -9785,7 +9798,7 @@ var ElementGetter = /** @class */ (function () {
9785
9798
  ElementGetter.prototype.getText = function (limit) {
9786
9799
  if (limit === void 0) { limit = 1024; }
9787
9800
  // XXX not sure about size limit
9788
- return getText(this.get(), limit);
9801
+ return getTextValue(this.get(), limit);
9789
9802
  };
9790
9803
  ElementGetter.prototype.addEventListener = function (event, callback) {
9791
9804
  var _this = this;