@multiplayer-app/session-recorder-browser 1.2.35 → 1.2.36

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.
@@ -9978,7 +9978,7 @@ const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
9978
9978
  const SESSION_RESPONSE = 'multiplayer-debug-session-response';
9979
9979
  const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
9980
9980
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
9981
- const PACKAGE_VERSION_EXPORT = "1.2.35" || 0;
9981
+ const PACKAGE_VERSION_EXPORT = "1.2.36" || 0;
9982
9982
  // Regex patterns for OpenTelemetry ignore URLs
9983
9983
  const OTEL_IGNORE_URLS = [
9984
9984
  // Traces endpoint
package/dist/index.js CHANGED
@@ -24143,7 +24143,7 @@ const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
24143
24143
  const SESSION_RESPONSE = 'multiplayer-debug-session-response';
24144
24144
  const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
24145
24145
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
24146
- const PACKAGE_VERSION_EXPORT = "1.2.35" || 0;
24146
+ const PACKAGE_VERSION_EXPORT = "1.2.36" || 0;
24147
24147
  // Regex patterns for OpenTelemetry ignore URLs
24148
24148
  const OTEL_IGNORE_URLS = [
24149
24149
  // Traces endpoint
@@ -24762,6 +24762,7 @@ class NavigationRecorder {
24762
24762
 
24763
24763
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24764
24764
  /* harmony export */ extractResponseBody: () => (/* binding */ extractResponseBody),
24765
+ /* harmony export */ getElementTextContent: () => (/* binding */ getElementTextContent),
24765
24766
  /* harmony export */ getExporterEndpoint: () => (/* binding */ getExporterEndpoint),
24766
24767
  /* harmony export */ headersToObject: () => (/* binding */ headersToObject),
24767
24768
  /* harmony export */ processHttpPayload: () => (/* binding */ processHttpPayload)
@@ -24968,6 +24969,16 @@ const getExporterEndpoint = (exporterEndpoint) => {
24968
24969
  const trimmedExporterEndpoint = new URL(exporterEndpoint).origin;
24969
24970
  return `${trimmedExporterEndpoint}/v1/traces`;
24970
24971
  };
24972
+ const getElementTextContent = (element) => {
24973
+ const getInnerText = (element) => {
24974
+ const slicedText = element.innerText.slice(0, 50);
24975
+ if (slicedText.length < element.innerText.length) {
24976
+ return `${slicedText}...`;
24977
+ }
24978
+ return slicedText;
24979
+ };
24980
+ return String(element.textContent || element.ariaLabel || getInnerText(element) || '').trim();
24981
+ };
24971
24982
 
24972
24983
 
24973
24984
  /***/ }),
@@ -25008,7 +25019,6 @@ const getExporterEndpoint = (exporterEndpoint) => {
25008
25019
 
25009
25020
  class TracerBrowserSDK {
25010
25021
  constructor() {
25011
- this.allowedElements = new Set(['A', 'BUTTON']);
25012
25022
  this.sessionId = '';
25013
25023
  this.globalErrorListenersRegistered = false;
25014
25024
  }
@@ -25138,11 +25148,10 @@ class TracerBrowserSDK {
25138
25148
  if (span['parentSpanContext']) {
25139
25149
  return true;
25140
25150
  }
25141
- let textContent = '';
25142
- if (this.allowedElements.has(element.tagName)) {
25143
- textContent = String(element.textContent || element.ariaLabel || '').trim();
25144
- }
25145
- span.setAttribute('target.innerText', textContent);
25151
+ span.setAttribute('target.innerText', (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.getElementTextContent)(element));
25152
+ Array.from(element.attributes).forEach(attribute => {
25153
+ span.setAttribute(`target.attribute.${attribute.name}`, attribute.value);
25154
+ });
25146
25155
  return false;
25147
25156
  },
25148
25157
  },