@sentry/replay 11.10.0 → 11.12.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/build/npm/cjs/index.js +133 -102
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/esm/index.js +133 -102
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/package.json +1 -1
- package/build/npm/types/coreHandlers/util/shouldSampleForBufferEvent.d.ts.map +1 -1
- package/build/npm/types/integration.d.ts.map +1 -1
- package/package.json +30 -32
package/build/npm/esm/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { GLOBAL_OBJ, normalize, isObjectLike, fill, _INTERNAL_performanceTimeToSeconds, debug as debug$1, severityLevelFromString, captureException, addBreadcrumb, uuid4, getClient, getCurrentScope, getActiveSpan, getDynamicSamplingContextFromSpan, isSentryRequestUrl, stringMatchesSomePattern, addEventProcessor, debounce as debounce$1, createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader, prepareEvent, getIsolationScope, updateRateLimits, isRateLimited, setContext, getRootSpan, spanToJSON, isBrowser, safeSetSpanJSONAttributes, parseSampleRate, consoleSandbox } from '@sentry/core';
|
|
2
2
|
import { setTimeout as setTimeout$3, htmlTreeAsString, addPerformanceInstrumentationHandler, addLcpInstrumentationHandler, addClsInstrumentationHandler, addInpInstrumentationHandler, getLocationHref, serializeFormData, getFetchRequestArgBody, getBodyString, SENTRY_XHR_DATA_KEY, parseXhrResponseHeaders, addClickKeypressInstrumentationHandler, addHistoryInstrumentationHandler } from '@sentry/browser-utils';
|
|
3
3
|
|
|
4
|
+
const Ob="sentry.replay_id",qb="sentry.segment.name.source";
|
|
5
|
+
|
|
4
6
|
const WINDOW = GLOBAL_OBJ;
|
|
5
7
|
const REPLAY_SESSION_KEY = "sentryReplaySession";
|
|
6
8
|
const REPLAY_EVENT_NAME = "replay_event";
|
|
@@ -21,8 +23,6 @@ const MIN_REPLAY_DURATION = 4999;
|
|
|
21
23
|
const MIN_REPLAY_DURATION_LIMIT = 5e4;
|
|
22
24
|
const MAX_REPLAY_DURATION = 36e5;
|
|
23
25
|
|
|
24
|
-
const hb="sentry.segment.name.source";
|
|
25
|
-
|
|
26
26
|
var __defProp = Object.defineProperty;
|
|
27
27
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
28
28
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -152,9 +152,7 @@ class Mirror {
|
|
|
152
152
|
const id = this.getId(n);
|
|
153
153
|
this.idNodeMap.delete(id);
|
|
154
154
|
if (n.childNodes) {
|
|
155
|
-
n.childNodes.forEach(
|
|
156
|
-
(childNode) => this.removeNodeFromMap(childNode)
|
|
157
|
-
);
|
|
155
|
+
n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));
|
|
158
156
|
}
|
|
159
157
|
if (isElement$1(n) && n.shadowRoot) {
|
|
160
158
|
this.removeNodeFromMap(n.shadowRoot);
|
|
@@ -902,12 +900,12 @@ function serializeElementNode(n, options) {
|
|
|
902
900
|
unblockSelector
|
|
903
901
|
);
|
|
904
902
|
const tagName = getValidTagName(n);
|
|
905
|
-
let
|
|
903
|
+
let attributes = {};
|
|
906
904
|
const len = n.attributes.length;
|
|
907
905
|
for (let i2 = 0; i2 < len; i2++) {
|
|
908
906
|
const attr = n.attributes[i2];
|
|
909
907
|
if (attr.name && !ignoreAttribute(tagName, attr.name, attr.value)) {
|
|
910
|
-
|
|
908
|
+
attributes[attr.name] = transformAttribute(
|
|
911
909
|
doc,
|
|
912
910
|
tagName,
|
|
913
911
|
toLowerCase(attr.name),
|
|
@@ -927,10 +925,10 @@ function serializeElementNode(n, options) {
|
|
|
927
925
|
cssText = stringifyStylesheet(stylesheet);
|
|
928
926
|
}
|
|
929
927
|
if (cssText) {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
928
|
+
attributes.rel = null;
|
|
929
|
+
attributes.href = null;
|
|
930
|
+
attributes.crossorigin = null;
|
|
931
|
+
attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);
|
|
934
932
|
}
|
|
935
933
|
}
|
|
936
934
|
if (tagName === "style" && n.sheet && // TODO: Currently we only try to get dynamic stylesheet when it is an empty style element
|
|
@@ -939,7 +937,7 @@ function serializeElementNode(n, options) {
|
|
|
939
937
|
n.sheet
|
|
940
938
|
);
|
|
941
939
|
if (cssText) {
|
|
942
|
-
|
|
940
|
+
attributes._cssText = absoluteToStylesheet(cssText, getHref(doc));
|
|
943
941
|
}
|
|
944
942
|
}
|
|
945
943
|
if (tagName === "input" || tagName === "textarea" || tagName === "select" || tagName === "option") {
|
|
@@ -947,7 +945,7 @@ function serializeElementNode(n, options) {
|
|
|
947
945
|
const type = getInputType(el);
|
|
948
946
|
const value = getInputValue(el, toUpperCase(tagName), type);
|
|
949
947
|
const checked = el.checked;
|
|
950
|
-
if (type !== "submit" && type !== "button" && value) {
|
|
948
|
+
if (type !== "submit" && type !== "button" && (value || attributes.value)) {
|
|
951
949
|
const forceMask = needMaskingText(
|
|
952
950
|
el,
|
|
953
951
|
maskTextClass,
|
|
@@ -960,7 +958,7 @@ function serializeElementNode(n, options) {
|
|
|
960
958
|
maskInputOptions
|
|
961
959
|
})
|
|
962
960
|
);
|
|
963
|
-
|
|
961
|
+
attributes.value = maskInputValue({
|
|
964
962
|
isMasked: forceMask,
|
|
965
963
|
element: el,
|
|
966
964
|
value,
|
|
@@ -968,20 +966,20 @@ function serializeElementNode(n, options) {
|
|
|
968
966
|
});
|
|
969
967
|
}
|
|
970
968
|
if (checked) {
|
|
971
|
-
|
|
969
|
+
attributes.checked = checked;
|
|
972
970
|
}
|
|
973
971
|
}
|
|
974
972
|
if (tagName === "option") {
|
|
975
973
|
if (n.selected && !maskInputOptions["select"]) {
|
|
976
|
-
|
|
974
|
+
attributes.selected = true;
|
|
977
975
|
} else {
|
|
978
|
-
delete
|
|
976
|
+
delete attributes.selected;
|
|
979
977
|
}
|
|
980
978
|
}
|
|
981
979
|
if (tagName === "canvas" && recordCanvas) {
|
|
982
980
|
if (n.__context === "2d") {
|
|
983
981
|
if (!is2DCanvasBlank(n)) {
|
|
984
|
-
|
|
982
|
+
attributes.rr_dataURL = n.toDataURL(
|
|
985
983
|
dataURLOptions.type,
|
|
986
984
|
dataURLOptions.quality
|
|
987
985
|
);
|
|
@@ -999,7 +997,7 @@ function serializeElementNode(n, options) {
|
|
|
999
997
|
dataURLOptions.quality
|
|
1000
998
|
);
|
|
1001
999
|
if (canvasDataURL !== blankCanvasDataURL) {
|
|
1002
|
-
|
|
1000
|
+
attributes.rr_dataURL = canvasDataURL;
|
|
1003
1001
|
}
|
|
1004
1002
|
}
|
|
1005
1003
|
}
|
|
@@ -1017,15 +1015,14 @@ function serializeElementNode(n, options) {
|
|
|
1017
1015
|
canvasService.width = image.naturalWidth;
|
|
1018
1016
|
canvasService.height = image.naturalHeight;
|
|
1019
1017
|
canvasCtx.drawImage(image, 0, 0);
|
|
1020
|
-
|
|
1018
|
+
attributes.rr_dataURL = canvasService.toDataURL(
|
|
1021
1019
|
dataURLOptions.type,
|
|
1022
1020
|
dataURLOptions.quality
|
|
1023
1021
|
);
|
|
1024
1022
|
} catch (err) {
|
|
1025
1023
|
if (image.crossOrigin !== "anonymous") {
|
|
1026
1024
|
image.crossOrigin = "anonymous";
|
|
1027
|
-
if (image.complete && image.naturalWidth !== 0)
|
|
1028
|
-
recordInlineImage();
|
|
1025
|
+
if (image.complete && image.naturalWidth !== 0) recordInlineImage();
|
|
1029
1026
|
else image.addEventListener("load", recordInlineImage);
|
|
1030
1027
|
return;
|
|
1031
1028
|
} else {
|
|
@@ -1035,37 +1032,37 @@ function serializeElementNode(n, options) {
|
|
|
1035
1032
|
}
|
|
1036
1033
|
}
|
|
1037
1034
|
if (image.crossOrigin === "anonymous") {
|
|
1038
|
-
priorCrossOrigin ?
|
|
1035
|
+
priorCrossOrigin ? attributes.crossOrigin = priorCrossOrigin : image.removeAttribute("crossorigin");
|
|
1039
1036
|
}
|
|
1040
1037
|
};
|
|
1041
1038
|
if (image.complete && image.naturalWidth !== 0) recordInlineImage();
|
|
1042
1039
|
else image.addEventListener("load", recordInlineImage);
|
|
1043
1040
|
}
|
|
1044
1041
|
if (tagName === "audio" || tagName === "video") {
|
|
1045
|
-
|
|
1046
|
-
|
|
1042
|
+
attributes.rr_mediaState = n.paused ? "paused" : "played";
|
|
1043
|
+
attributes.rr_mediaCurrentTime = n.currentTime;
|
|
1047
1044
|
}
|
|
1048
1045
|
if (!newlyAddedElement) {
|
|
1049
1046
|
if (n.scrollLeft) {
|
|
1050
|
-
|
|
1047
|
+
attributes.rr_scrollLeft = n.scrollLeft;
|
|
1051
1048
|
}
|
|
1052
1049
|
if (n.scrollTop) {
|
|
1053
|
-
|
|
1050
|
+
attributes.rr_scrollTop = n.scrollTop;
|
|
1054
1051
|
}
|
|
1055
1052
|
}
|
|
1056
1053
|
if (needBlock) {
|
|
1057
1054
|
const { width, height } = n.getBoundingClientRect();
|
|
1058
|
-
|
|
1059
|
-
class:
|
|
1055
|
+
attributes = {
|
|
1056
|
+
class: attributes.class,
|
|
1060
1057
|
rr_width: `${width}px`,
|
|
1061
1058
|
rr_height: `${height}px`
|
|
1062
1059
|
};
|
|
1063
1060
|
}
|
|
1064
|
-
if (tagName === "iframe" && !keepIframeSrcFn(
|
|
1061
|
+
if (tagName === "iframe" && !keepIframeSrcFn(attributes.src)) {
|
|
1065
1062
|
if (!needBlock && !getIFrameContentDocument$1(n)) {
|
|
1066
|
-
|
|
1063
|
+
attributes.rr_src = attributes.src;
|
|
1067
1064
|
}
|
|
1068
|
-
delete
|
|
1065
|
+
delete attributes.src;
|
|
1069
1066
|
}
|
|
1070
1067
|
let isCustomElement;
|
|
1071
1068
|
try {
|
|
@@ -1075,7 +1072,7 @@ function serializeElementNode(n, options) {
|
|
|
1075
1072
|
return {
|
|
1076
1073
|
type: NodeType$1.Element,
|
|
1077
1074
|
tagName,
|
|
1078
|
-
attributes
|
|
1075
|
+
attributes,
|
|
1079
1076
|
childNodes: [],
|
|
1080
1077
|
isSVG: isSVGElement(n) || void 0,
|
|
1081
1078
|
needBlock,
|
|
@@ -1190,8 +1187,8 @@ function serializeNodeWithId(n, options) {
|
|
|
1190
1187
|
} else {
|
|
1191
1188
|
id = genId();
|
|
1192
1189
|
}
|
|
1193
|
-
const
|
|
1194
|
-
mirror.add(n,
|
|
1190
|
+
const serializedNode = Object.assign(_serializedNode, { id });
|
|
1191
|
+
mirror.add(n, serializedNode);
|
|
1195
1192
|
if (id === IGNORED_NODE) {
|
|
1196
1193
|
return null;
|
|
1197
1194
|
}
|
|
@@ -1199,14 +1196,14 @@ function serializeNodeWithId(n, options) {
|
|
|
1199
1196
|
onSerialize(n);
|
|
1200
1197
|
}
|
|
1201
1198
|
let recordChild = !skipChild;
|
|
1202
|
-
if (
|
|
1203
|
-
recordChild = recordChild && !
|
|
1199
|
+
if (serializedNode.type === NodeType$1.Element) {
|
|
1200
|
+
recordChild = recordChild && !serializedNode.needBlock;
|
|
1204
1201
|
const shadowRoot = n.shadowRoot;
|
|
1205
1202
|
if (shadowRoot && isNativeShadowDom(shadowRoot))
|
|
1206
|
-
|
|
1203
|
+
serializedNode.isShadowHost = true;
|
|
1207
1204
|
}
|
|
1208
|
-
if ((
|
|
1209
|
-
if (slimDOMOptions.headWhitespace &&
|
|
1205
|
+
if ((serializedNode.type === NodeType$1.Document || serializedNode.type === NodeType$1.Element) && recordChild) {
|
|
1206
|
+
if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$1.Element && serializedNode.tagName === "head") {
|
|
1210
1207
|
preserveWhiteSpace = false;
|
|
1211
1208
|
}
|
|
1212
1209
|
const bypassOptions = {
|
|
@@ -1244,7 +1241,7 @@ function serializeNodeWithId(n, options) {
|
|
|
1244
1241
|
for (const childN of childNodes) {
|
|
1245
1242
|
const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
|
|
1246
1243
|
if (serializedChildNode) {
|
|
1247
|
-
|
|
1244
|
+
serializedNode.childNodes.push(serializedChildNode);
|
|
1248
1245
|
}
|
|
1249
1246
|
}
|
|
1250
1247
|
if (isElement$1(n) && n.shadowRoot) {
|
|
@@ -1252,15 +1249,15 @@ function serializeNodeWithId(n, options) {
|
|
|
1252
1249
|
const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
|
|
1253
1250
|
if (serializedChildNode) {
|
|
1254
1251
|
isNativeShadowDom(n.shadowRoot) && (serializedChildNode.isShadow = true);
|
|
1255
|
-
|
|
1252
|
+
serializedNode.childNodes.push(serializedChildNode);
|
|
1256
1253
|
}
|
|
1257
1254
|
}
|
|
1258
1255
|
}
|
|
1259
1256
|
}
|
|
1260
1257
|
if (n.parentNode && isShadowRoot(n.parentNode) && isNativeShadowDom(n.parentNode)) {
|
|
1261
|
-
|
|
1258
|
+
serializedNode.isShadow = true;
|
|
1262
1259
|
}
|
|
1263
|
-
if (
|
|
1260
|
+
if (serializedNode.type === NodeType$1.Element && serializedNode.tagName === "iframe" && !serializedNode.needBlock) {
|
|
1264
1261
|
onceIframeLoaded(
|
|
1265
1262
|
n,
|
|
1266
1263
|
() => {
|
|
@@ -1307,14 +1304,14 @@ function serializeNodeWithId(n, options) {
|
|
|
1307
1304
|
iframeLoadTimeout
|
|
1308
1305
|
);
|
|
1309
1306
|
}
|
|
1310
|
-
if (
|
|
1307
|
+
if (serializedNode.type === NodeType$1.Element && serializedNode.tagName === "img" && !n.complete && serializedNode.needBlock) {
|
|
1311
1308
|
const image = n;
|
|
1312
1309
|
const updateImageDimensions = () => {
|
|
1313
1310
|
if (image.isConnected && !image.complete && onBlockedImageLoad) {
|
|
1314
1311
|
try {
|
|
1315
1312
|
const rect = image.getBoundingClientRect();
|
|
1316
1313
|
if (rect.width > 0 && rect.height > 0) {
|
|
1317
|
-
onBlockedImageLoad(image,
|
|
1314
|
+
onBlockedImageLoad(image, serializedNode, rect);
|
|
1318
1315
|
}
|
|
1319
1316
|
} catch (error) {
|
|
1320
1317
|
}
|
|
@@ -1325,7 +1322,7 @@ function serializeNodeWithId(n, options) {
|
|
|
1325
1322
|
image.addEventListener("load", updateImageDimensions);
|
|
1326
1323
|
}
|
|
1327
1324
|
}
|
|
1328
|
-
if (
|
|
1325
|
+
if (serializedNode.type === NodeType$1.Element && serializedNode.tagName === "link" && typeof serializedNode.attributes.rel === "string" && (serializedNode.attributes.rel === "stylesheet" || serializedNode.attributes.rel === "preload" && typeof serializedNode.attributes.href === "string" && extractFileExtension(serializedNode.attributes.href) === "css")) {
|
|
1329
1326
|
onceStylesheetLoaded(
|
|
1330
1327
|
n,
|
|
1331
1328
|
() => {
|
|
@@ -1371,10 +1368,10 @@ function serializeNodeWithId(n, options) {
|
|
|
1371
1368
|
stylesheetLoadTimeout
|
|
1372
1369
|
);
|
|
1373
1370
|
}
|
|
1374
|
-
if (
|
|
1375
|
-
delete
|
|
1371
|
+
if (serializedNode.type === NodeType$1.Element) {
|
|
1372
|
+
delete serializedNode.needBlock;
|
|
1376
1373
|
}
|
|
1377
|
-
return
|
|
1374
|
+
return serializedNode;
|
|
1378
1375
|
}
|
|
1379
1376
|
function snapshot(n, options) {
|
|
1380
1377
|
const {
|
|
@@ -1797,6 +1794,17 @@ function setTimeout$2(...rest) {
|
|
|
1797
1794
|
function clearTimeout$2(...rest) {
|
|
1798
1795
|
return getImplementation("clearTimeout")(...rest);
|
|
1799
1796
|
}
|
|
1797
|
+
function runAll(handlers) {
|
|
1798
|
+
const errors = [];
|
|
1799
|
+
for (const handler of handlers) {
|
|
1800
|
+
try {
|
|
1801
|
+
handler();
|
|
1802
|
+
} catch (error) {
|
|
1803
|
+
errors.push(error);
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
return errors;
|
|
1807
|
+
}
|
|
1800
1808
|
var EventType = /* @__PURE__ */ ((EventType2) => {
|
|
1801
1809
|
EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded";
|
|
1802
1810
|
EventType2[EventType2["Load"] = 1] = "Load";
|
|
@@ -2916,13 +2924,7 @@ function initInputObserver({
|
|
|
2916
2924
|
const userTriggered = event.isTrusted;
|
|
2917
2925
|
const tagName = target && toUpperCase(target.tagName);
|
|
2918
2926
|
if (tagName === "OPTION") target = target.parentElement;
|
|
2919
|
-
if (!target || !tagName || INPUT_TAGS.indexOf(tagName) < 0 || isBlocked(
|
|
2920
|
-
target,
|
|
2921
|
-
blockClass,
|
|
2922
|
-
blockSelector,
|
|
2923
|
-
unblockSelector,
|
|
2924
|
-
true
|
|
2925
|
-
)) {
|
|
2927
|
+
if (!target || !tagName || INPUT_TAGS.indexOf(tagName) < 0 || isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {
|
|
2926
2928
|
return;
|
|
2927
2929
|
}
|
|
2928
2930
|
const el = target;
|
|
@@ -3040,9 +3042,7 @@ function getNestedCSSRulePositions(rule) {
|
|
|
3040
3042
|
const positions = [];
|
|
3041
3043
|
function recurse(childRule, pos) {
|
|
3042
3044
|
if (hasNestedCSSRule("CSSGroupingRule") && childRule.parentRule instanceof CSSGroupingRule || hasNestedCSSRule("CSSMediaRule") && childRule.parentRule instanceof CSSMediaRule || hasNestedCSSRule("CSSSupportsRule") && childRule.parentRule instanceof CSSSupportsRule || hasNestedCSSRule("CSSConditionRule") && childRule.parentRule instanceof CSSConditionRule) {
|
|
3043
|
-
const rules2 = Array.from(
|
|
3044
|
-
childRule.parentRule.cssRules
|
|
3045
|
-
);
|
|
3045
|
+
const rules2 = Array.from(childRule.parentRule.cssRules);
|
|
3046
3046
|
const index = rules2.indexOf(childRule);
|
|
3047
3047
|
pos.unshift(index);
|
|
3048
3048
|
} else if (childRule.parentStyleSheet) {
|
|
@@ -3262,35 +3262,51 @@ function initAdoptedStyleSheetObserver({
|
|
|
3262
3262
|
patchTarget?.prototype,
|
|
3263
3263
|
"adoptedStyleSheets"
|
|
3264
3264
|
) : void 0;
|
|
3265
|
-
|
|
3265
|
+
const previousAdoptedStyleSheetsDescriptor = Object.getOwnPropertyDescriptor(
|
|
3266
|
+
host,
|
|
3267
|
+
"adoptedStyleSheets"
|
|
3268
|
+
);
|
|
3269
|
+
if (hostId === null || hostId === -1 || !patchTarget || !originalPropertyDescriptor || // Another script locked `host` itself: it put a locked property on it, or
|
|
3270
|
+
// sealed or froze it. Patching would throw, so we don't. Full snapshots
|
|
3271
|
+
// still capture the adopted stylesheets; we only miss changes between
|
|
3272
|
+
// snapshots.
|
|
3273
|
+
previousAdoptedStyleSheetsDescriptor?.configurable === false || !Object.isExtensible(host))
|
|
3266
3274
|
return () => {
|
|
3267
3275
|
};
|
|
3276
|
+
let adoptedStyleSheetsOverrideIsActive = true;
|
|
3277
|
+
const adoptedStyleSheetsSetter = function(sheets) {
|
|
3278
|
+
originalPropertyDescriptor.set?.call(this, sheets);
|
|
3279
|
+
if (adoptedStyleSheetsOverrideIsActive && hostId !== null && hostId !== -1) {
|
|
3280
|
+
try {
|
|
3281
|
+
stylesheetManager.adoptStyleSheets(sheets, hostId);
|
|
3282
|
+
} catch (e2) {
|
|
3283
|
+
}
|
|
3284
|
+
}
|
|
3285
|
+
};
|
|
3268
3286
|
Object.defineProperty(host, "adoptedStyleSheets", {
|
|
3269
|
-
configurable:
|
|
3287
|
+
configurable: true,
|
|
3270
3288
|
enumerable: originalPropertyDescriptor.enumerable,
|
|
3271
3289
|
get() {
|
|
3272
3290
|
return originalPropertyDescriptor.get?.call(this);
|
|
3273
3291
|
},
|
|
3274
|
-
set
|
|
3275
|
-
const result = originalPropertyDescriptor.set?.call(this, sheets);
|
|
3276
|
-
if (hostId !== null && hostId !== -1) {
|
|
3277
|
-
try {
|
|
3278
|
-
stylesheetManager.adoptStyleSheets(sheets, hostId);
|
|
3279
|
-
} catch (e2) {
|
|
3280
|
-
}
|
|
3281
|
-
}
|
|
3282
|
-
return result;
|
|
3283
|
-
}
|
|
3292
|
+
set: adoptedStyleSheetsSetter
|
|
3284
3293
|
});
|
|
3285
3294
|
return callbackWrapper(() => {
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3295
|
+
adoptedStyleSheetsOverrideIsActive = false;
|
|
3296
|
+
const currentDescriptor = Object.getOwnPropertyDescriptor(
|
|
3297
|
+
host,
|
|
3298
|
+
"adoptedStyleSheets"
|
|
3299
|
+
);
|
|
3300
|
+
if (currentDescriptor?.set !== adoptedStyleSheetsSetter) return;
|
|
3301
|
+
if (previousAdoptedStyleSheetsDescriptor) {
|
|
3302
|
+
Reflect.defineProperty(
|
|
3303
|
+
host,
|
|
3304
|
+
"adoptedStyleSheets",
|
|
3305
|
+
previousAdoptedStyleSheetsDescriptor
|
|
3306
|
+
);
|
|
3307
|
+
} else {
|
|
3308
|
+
Reflect.deleteProperty(host, "adoptedStyleSheets");
|
|
3309
|
+
}
|
|
3294
3310
|
});
|
|
3295
3311
|
}
|
|
3296
3312
|
function initStyleDeclarationObserver({
|
|
@@ -3418,7 +3434,11 @@ function initFontObserver({ fontCb, doc }) {
|
|
|
3418
3434
|
const fontMap = /* @__PURE__ */ new WeakMap();
|
|
3419
3435
|
const originalFontFace = win.FontFace;
|
|
3420
3436
|
win.FontFace = function FontFace2(family, source, descriptors) {
|
|
3421
|
-
const fontFace = new originalFontFace(
|
|
3437
|
+
const fontFace = new originalFontFace(
|
|
3438
|
+
family,
|
|
3439
|
+
source,
|
|
3440
|
+
descriptors
|
|
3441
|
+
);
|
|
3422
3442
|
fontMap.set(fontFace, {
|
|
3423
3443
|
family,
|
|
3424
3444
|
buffer: typeof source !== "string",
|
|
@@ -3570,21 +3590,24 @@ function initObservers(o2, _hooks = {}) {
|
|
|
3570
3590
|
);
|
|
3571
3591
|
}
|
|
3572
3592
|
return callbackWrapper(() => {
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3593
|
+
const errors = runAll([
|
|
3594
|
+
() => forEachMutationBuffer((b) => b.reset()),
|
|
3595
|
+
() => mutationObserver?.disconnect(),
|
|
3596
|
+
mousemoveHandler,
|
|
3597
|
+
mouseInteractionHandler,
|
|
3598
|
+
scrollHandler,
|
|
3599
|
+
viewportResizeHandler,
|
|
3600
|
+
inputHandler,
|
|
3601
|
+
mediaInteractionHandler,
|
|
3602
|
+
styleSheetObserver,
|
|
3603
|
+
adoptedStyleSheetObserver,
|
|
3604
|
+
styleDeclarationObserver,
|
|
3605
|
+
fontObserver,
|
|
3606
|
+
selectionObserver,
|
|
3607
|
+
customElementObserver,
|
|
3608
|
+
...pluginHandlers
|
|
3609
|
+
]);
|
|
3610
|
+
if (errors.length > 0) throw errors[0];
|
|
3588
3611
|
});
|
|
3589
3612
|
}
|
|
3590
3613
|
function hasNestedCSSRule(prop) {
|
|
@@ -4679,10 +4702,15 @@ function record(options = {}) {
|
|
|
4679
4702
|
);
|
|
4680
4703
|
}
|
|
4681
4704
|
return () => {
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4705
|
+
const errors = runAll([
|
|
4706
|
+
...handlers,
|
|
4707
|
+
() => processedNodeManager.destroy(),
|
|
4708
|
+
() => {
|
|
4709
|
+
_takeFullSnapshot = void 0;
|
|
4710
|
+
},
|
|
4711
|
+
unregisterErrorHandler
|
|
4712
|
+
]);
|
|
4713
|
+
if (errors.length > 0) throw errors[0];
|
|
4686
4714
|
};
|
|
4687
4715
|
} catch (error) {
|
|
4688
4716
|
console.warn(error);
|
|
@@ -6262,6 +6290,9 @@ function shouldSampleForBufferEvent(replay, event) {
|
|
|
6262
6290
|
if (!event.exception || event.type) {
|
|
6263
6291
|
return false;
|
|
6264
6292
|
}
|
|
6293
|
+
if (event.sdkProcessingMetadata?.hasDefaultSyntheticStacktrace) {
|
|
6294
|
+
return false;
|
|
6295
|
+
}
|
|
6265
6296
|
return isSampled(replay.getOptions().errorSampleRate);
|
|
6266
6297
|
}
|
|
6267
6298
|
|
|
@@ -7845,7 +7876,7 @@ class ReplayContainer {
|
|
|
7845
7876
|
return void 0;
|
|
7846
7877
|
}
|
|
7847
7878
|
const spanJson = spanToJSON(lastRootSpan);
|
|
7848
|
-
const source = spanJson.attributes[
|
|
7879
|
+
const source = spanJson.attributes[qb];
|
|
7849
7880
|
if (!source || !["route", "custom"].includes(source)) {
|
|
7850
7881
|
return void 0;
|
|
7851
7882
|
}
|
|
@@ -8526,7 +8557,7 @@ class Replay {
|
|
|
8526
8557
|
processSpan(span) {
|
|
8527
8558
|
const replayId = this.getReplayId(true);
|
|
8528
8559
|
if (replayId) {
|
|
8529
|
-
safeSetSpanJSONAttributes(span, {
|
|
8560
|
+
safeSetSpanJSONAttributes(span, { [Ob]: replayId });
|
|
8530
8561
|
if (this.getRecordingMode() === "buffer") {
|
|
8531
8562
|
safeSetSpanJSONAttributes(span, { "sentry._internal.replay_is_buffering": true });
|
|
8532
8563
|
}
|