@newrelic/browser-agent 1.317.0-rc.0 → 1.317.0-rc.2

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.
@@ -93,5 +93,7 @@ exports.default = void 0;
93
93
  * @property {Object} [user_actions]
94
94
  * @property {boolean} [user_actions.enabled] - Must be true to allow UserAction events to be captured.
95
95
  * @property {Array<string>} [user_actions.elementAttributes] - List of HTML Element properties to be captured with UserAction events' target elements. This may help to identify the source element being interacted with in the UI.
96
+ * @property {Object} [web_sockets]
97
+ * @property {boolean} [web_sockets.enabled] - Turn on/off the web sockets feature (off by default).
96
98
  */
97
99
  var _default = exports.default = {};
@@ -204,6 +204,9 @@ const InitModelFn = () => {
204
204
  user_actions: {
205
205
  enabled: true,
206
206
  elementAttributes: ['id', 'className', 'tagName', 'type']
207
+ },
208
+ web_sockets: {
209
+ enabled: false
207
210
  }
208
211
  };
209
212
  };
@@ -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.317.0-rc.0";
20
+ const VERSION = exports.VERSION = "1.317.0-rc.2";
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.317.0-rc.0";
20
+ const VERSION = exports.VERSION = "1.317.0-rc.2";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -261,7 +261,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
261
261
  };
262
262
  this.addEvent(event, target);
263
263
  }, this.featureName, this.ee);
264
- if (agentRef.init.feature_flags.includes('websockets')) {
264
+ if (agentRef.init.feature_flags.includes('websockets') || agentRef.init.web_sockets?.enabled) {
265
265
  (0, _registerHandler.registerHandler)('ws-complete', nrData => {
266
266
  const event = {
267
267
  ...nrData,
@@ -30,7 +30,7 @@ class Instrument extends _instrumentBase.InstrumentBase {
30
30
  static featureName = _constants.FEATURE_NAME;
31
31
  constructor(agentRef) {
32
32
  super(agentRef, _constants.FEATURE_NAME);
33
- const websocketsEnabled = agentRef.init.feature_flags.includes('websockets');
33
+ const websocketsEnabled = agentRef.init.feature_flags.includes('websockets') || agentRef.init.web_sockets?.enabled;
34
34
  const securityPolicyViolationEnabled = !agentRef.init.feature_flags.includes('no_spv');
35
35
 
36
36
  /** config values that gate whether the generic events aggregator should be imported at all */
@@ -88,6 +88,8 @@
88
88
  * @property {Object} [user_actions]
89
89
  * @property {boolean} [user_actions.enabled] - Must be true to allow UserAction events to be captured.
90
90
  * @property {Array<string>} [user_actions.elementAttributes] - List of HTML Element properties to be captured with UserAction events' target elements. This may help to identify the source element being interacted with in the UI.
91
+ * @property {Object} [web_sockets]
92
+ * @property {boolean} [web_sockets.enabled] - Turn on/off the web sockets feature (off by default).
91
93
  */
92
94
 
93
95
  export default {};
@@ -198,6 +198,9 @@ const InitModelFn = () => {
198
198
  user_actions: {
199
199
  enabled: true,
200
200
  elementAttributes: ['id', 'className', 'tagName', 'type']
201
+ },
202
+ web_sockets: {
203
+ enabled: false
201
204
  }
202
205
  };
203
206
  };
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.317.0-rc.0";
14
+ export const VERSION = "1.317.0-rc.2";
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.317.0-rc.0";
14
+ export const VERSION = "1.317.0-rc.2";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -254,7 +254,7 @@ export class Aggregate extends AggregateBase {
254
254
  };
255
255
  this.addEvent(event, target);
256
256
  }, this.featureName, this.ee);
257
- if (agentRef.init.feature_flags.includes('websockets')) {
257
+ if (agentRef.init.feature_flags.includes('websockets') || agentRef.init.web_sockets?.enabled) {
258
258
  registerHandler('ws-complete', nrData => {
259
259
  const event = {
260
260
  ...nrData,
@@ -25,7 +25,7 @@ export class Instrument extends InstrumentBase {
25
25
  static featureName = FEATURE_NAME;
26
26
  constructor(agentRef) {
27
27
  super(agentRef, FEATURE_NAME);
28
- const websocketsEnabled = agentRef.init.feature_flags.includes('websockets');
28
+ const websocketsEnabled = agentRef.init.feature_flags.includes('websockets') || agentRef.init.web_sockets?.enabled;
29
29
  const securityPolicyViolationEnabled = !agentRef.init.feature_flags.includes('no_spv');
30
30
 
31
31
  /** config values that gate whether the generic events aggregator should be imported at all */
@@ -276,5 +276,11 @@ export type Init = {
276
276
  */
277
277
  elementAttributes?: string[] | undefined;
278
278
  } | undefined;
279
+ web_sockets?: {
280
+ /**
281
+ * - Turn on/off the web sockets feature (off by default).
282
+ */
283
+ enabled?: boolean | undefined;
284
+ } | undefined;
279
285
  };
280
286
  //# sourceMappingURL=init-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/common/config/init.js"],"names":[],"mappings":"AAgJO,0CAEN;mBAtIY,OAAO,cAAc,EAAE,IAAI"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/common/config/init.js"],"names":[],"mappings":"AAiJO,0CAEN;mBAvIY,OAAO,cAAc,EAAE,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.317.0-rc.0",
3
+ "version": "1.317.0-rc.2",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -88,6 +88,8 @@
88
88
  * @property {Object} [user_actions]
89
89
  * @property {boolean} [user_actions.enabled] - Must be true to allow UserAction events to be captured.
90
90
  * @property {Array<string>} [user_actions.elementAttributes] - List of HTML Element properties to be captured with UserAction events' target elements. This may help to identify the source element being interacted with in the UI.
91
+ * @property {Object} [web_sockets]
92
+ * @property {boolean} [web_sockets.enabled] - Turn on/off the web sockets feature (off by default).
91
93
  */
92
94
 
93
95
  export default {}
@@ -138,7 +138,8 @@ const InitModelFn = () => {
138
138
  session_trace: { enabled: true, autoStart: true },
139
139
  soft_navigations: { enabled: true, autoStart: true },
140
140
  ssl: undefined,
141
- user_actions: { enabled: true, elementAttributes: ['id', 'className', 'tagName', 'type'] }
141
+ user_actions: { enabled: true, elementAttributes: ['id', 'className', 'tagName', 'type'] },
142
+ web_sockets: { enabled: false }
142
143
  }
143
144
  }
144
145
 
@@ -251,7 +251,7 @@ export class Aggregate extends AggregateBase {
251
251
  this.addEvent(event, target)
252
252
  }, this.featureName, this.ee)
253
253
 
254
- if (agentRef.init.feature_flags.includes('websockets')) {
254
+ if (agentRef.init.feature_flags.includes('websockets') || agentRef.init.web_sockets?.enabled) {
255
255
  registerHandler('ws-complete', (nrData) => {
256
256
  const event = {
257
257
  ...nrData,
@@ -26,7 +26,7 @@ export class Instrument extends InstrumentBase {
26
26
  static featureName = FEATURE_NAME
27
27
  constructor (agentRef) {
28
28
  super(agentRef, FEATURE_NAME)
29
- const websocketsEnabled = agentRef.init.feature_flags.includes('websockets')
29
+ const websocketsEnabled = agentRef.init.feature_flags.includes('websockets') || agentRef.init.web_sockets?.enabled
30
30
  const securityPolicyViolationEnabled = !agentRef.init.feature_flags.includes('no_spv')
31
31
 
32
32
  /** config values that gate whether the generic events aggregator should be imported at all */