@newrelic/browser-agent 1.303.0-rc.2 → 1.303.0-rc.4

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.
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.303.0-rc.2";
20
+ const VERSION = exports.VERSION = "1.303.0-rc.4";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.303.0-rc.2";
20
+ const VERSION = exports.VERSION = "1.303.0-rc.4";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -278,7 +278,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
278
278
  }
279
279
  exports.Aggregate = Aggregate;
280
280
  function getActionText(elem) {
281
- const tagName = elem.tagName.toLowerCase();
281
+ const tagName = elem.tagName?.toLowerCase();
282
282
  const elementsOfInterest = ['a', 'button', 'input'];
283
283
  if (elementsOfInterest.includes(tagName)) {
284
284
  return elem.title || elem.value || elem.innerText;
@@ -62,6 +62,7 @@ class Instrument extends _instrumentBase.InstrumentBase {
62
62
  });
63
63
  });
64
64
  const processUserInteraction = (0, _invoke.debounce)(event => {
65
+ if (document.readyState === 'loading') return; // document.body is not expected to be defined yet during loading, so only "interactive" or "complete" is considered "legit" user interaction
65
66
  (0, _handle.handle)('newUIEvent', [event], undefined, this.featureName, this.ee);
66
67
  domObserver.observe(document.body, {
67
68
  attributes: true,
@@ -628,7 +628,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
628
628
  }, this.featureName, baseEE);
629
629
  baseEE.on('interaction', saveInteraction);
630
630
  function getActionText(node) {
631
- var nodeType = node.tagName.toLowerCase();
631
+ var nodeType = node.tagName?.toLowerCase();
632
632
  var goodNodeTypes = ['a', 'button', 'input'];
633
633
  var isGoodNode = goodNodeTypes.indexOf(nodeType) !== -1;
634
634
  if (isGoodNode) {
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.303.0-rc.2";
14
+ export const VERSION = "1.303.0-rc.4";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.303.0-rc.2";
14
+ export const VERSION = "1.303.0-rc.4";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -270,7 +270,7 @@ export class Aggregate extends AggregateBase {
270
270
  }
271
271
  }
272
272
  function getActionText(elem) {
273
- const tagName = elem.tagName.toLowerCase();
273
+ const tagName = elem.tagName?.toLowerCase();
274
274
  const elementsOfInterest = ['a', 'button', 'input'];
275
275
  if (elementsOfInterest.includes(tagName)) {
276
276
  return elem.title || elem.value || elem.innerText;
@@ -57,6 +57,7 @@ export class Instrument extends InstrumentBase {
57
57
  });
58
58
  });
59
59
  const processUserInteraction = debounce(event => {
60
+ if (document.readyState === 'loading') return; // document.body is not expected to be defined yet during loading, so only "interactive" or "complete" is considered "legit" user interaction
60
61
  handle('newUIEvent', [event], undefined, this.featureName, this.ee);
61
62
  domObserver.observe(document.body, {
62
63
  attributes: true,
@@ -620,7 +620,7 @@ export class Aggregate extends AggregateBase {
620
620
  }, this.featureName, baseEE);
621
621
  baseEE.on('interaction', saveInteraction);
622
622
  function getActionText(node) {
623
- var nodeType = node.tagName.toLowerCase();
623
+ var nodeType = node.tagName?.toLowerCase();
624
624
  var goodNodeTypes = ['a', 'button', 'input'];
625
625
  var isGoodNode = goodNodeTypes.indexOf(nodeType) !== -1;
626
626
  if (isGoodNode) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/instrument/index.js"],"names":[],"mappings":"AAsBA;IACE,2BAAiC;IACjC,2BAkDC;IAxCG,2CAA0C;CAyC/C;AAED,wCAAiC;+BAnEF,6BAA6B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/instrument/index.js"],"names":[],"mappings":"AAsBA;IACE,2BAAiC;IACjC,2BAmDC;IAzCG,2CAA0C;CA0C/C;AAED,wCAAiC;+BApEF,6BAA6B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.303.0-rc.2",
3
+ "version": "1.303.0-rc.4",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -267,7 +267,7 @@ export class Aggregate extends AggregateBase {
267
267
  }
268
268
 
269
269
  function getActionText (elem) {
270
- const tagName = elem.tagName.toLowerCase()
270
+ const tagName = elem.tagName?.toLowerCase()
271
271
  const elementsOfInterest = ['a', 'button', 'input']
272
272
  if (elementsOfInterest.includes(tagName)) {
273
273
  return elem.title || elem.value || elem.innerText
@@ -60,6 +60,7 @@ export class Instrument extends InstrumentBase {
60
60
  })
61
61
 
62
62
  const processUserInteraction = debounce((event) => {
63
+ if (document.readyState === 'loading') return // document.body is not expected to be defined yet during loading, so only "interactive" or "complete" is considered "legit" user interaction
63
64
  handle('newUIEvent', [event], undefined, this.featureName, this.ee)
64
65
  domObserver.observe(document.body, { attributes: true, childList: true, subtree: true, characterData: true })
65
66
  }, UI_WAIT_INTERVAL, { leading: true })
@@ -683,7 +683,7 @@ export class Aggregate extends AggregateBase {
683
683
  baseEE.on('interaction', saveInteraction)
684
684
 
685
685
  function getActionText (node) {
686
- var nodeType = node.tagName.toLowerCase()
686
+ var nodeType = node.tagName?.toLowerCase()
687
687
  var goodNodeTypes = ['a', 'button', 'input']
688
688
  var isGoodNode = goodNodeTypes.indexOf(nodeType) !== -1
689
689
  if (isGoodNode) {