From 113a71ecfdbb67423339b6724af8194a756de179 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Tue, 19 Nov 2024 17:18:18 +0000 Subject: [PATCH] fix --- patches/@rrweb__record@2.0.0-alpha.17.patch | 39 +++++++++++---------- pnpm-lock.yaml | 6 ++-- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/patches/@rrweb__record@2.0.0-alpha.17.patch b/patches/@rrweb__record@2.0.0-alpha.17.patch index 6d631a6bb..11f99b12c 100644 --- a/patches/@rrweb__record@2.0.0-alpha.17.patch +++ b/patches/@rrweb__record@2.0.0-alpha.17.patch @@ -1,13 +1,12 @@ diff --git a/dist/record.js b/dist/record.js -index 46ec389fefb698243008b39db65470dbdf0a3857..990c16270b0def8c49134f4d2f9ce0bc3befe706 100644 +index 46ec389fefb698243008b39db65470dbdf0a3857..e3e91248c890da930bd71af9883b94d4f09c1bdc 100644 --- a/dist/record.js +++ b/dist/record.js -@@ -20,6 +20,15 @@ const testableAccessors$1 = { +@@ -20,6 +20,14 @@ const testableAccessors$1 = { Element: ["shadowRoot", "querySelector", "querySelectorAll"], MutationObserver: [] }; +const isFunction = (x) => typeof x === 'function'; -+const isNativeFunction = (x) => isFunction(x) && x.toString().includes("[native code]"); +const isAngularZonePatchedFunction = (x) => { + if (!isFunction(x)) { + return false; @@ -18,10 +17,11 @@ index 46ec389fefb698243008b39db65470dbdf0a3857..990c16270b0def8c49134f4d2f9ce0bc const testableMethods$1 = { Node: ["contains", "getRootNode"], ShadowRoot: ["getSelection"], -@@ -36,13 +45,13 @@ function getUntaintedPrototype$1(key) { +@@ -35,14 +43,14 @@ function getUntaintedPrototype$1(key) { + const accessorNames = key in testableAccessors$1 ? testableAccessors$1[key] : void 0; const isUntaintedAccessors = Boolean( accessorNames && // @ts-expect-error 2345 - accessorNames.every( +- accessorNames.every( - (accessor) => { - var _a2, _b; - return Boolean( @@ -29,17 +29,18 @@ index 46ec389fefb698243008b39db65470dbdf0a3857..990c16270b0def8c49134f4d2f9ce0bc - ); - } - ) -+ (accessor) => { -+ var _a2, _b; -+ return Boolean( -+ (_b = (_a2 = Object.getOwnPropertyDescriptor(defaultPrototype, accessor)) == null ? void 0 : _a2.get) == null ? void 0 : _b.toString().includes("[native code]") -+ ); -+ } -+ ), ++ accessorNames.every( ++ (accessor) => { ++ var _a2, _b; ++ return Boolean( ++ (_b = (_a2 = Object.getOwnPropertyDescriptor(defaultPrototype, accessor)) == null ? void 0 : _a2.get) == null ? void 0 : _b.toString().includes("[native code]") ++ ); ++ } ++ ), ); const methodNames = key in testableMethods$1 ? testableMethods$1[key] : void 0; const isUntaintedMethods = Boolean( -@@ -54,7 +63,7 @@ function getUntaintedPrototype$1(key) { +@@ -54,7 +62,7 @@ function getUntaintedPrototype$1(key) { } ) ); @@ -48,7 +49,7 @@ index 46ec389fefb698243008b39db65470dbdf0a3857..990c16270b0def8c49134f4d2f9ce0bc untaintedBasePrototype$1[key] = defaultObj.prototype; return defaultObj.prototype; } -@@ -246,6 +255,9 @@ function isCSSImportRule(rule2) { +@@ -246,6 +254,9 @@ function isCSSImportRule(rule2) { function isCSSStyleRule(rule2) { return "selectorText" in rule2; } @@ -58,7 +59,7 @@ index 46ec389fefb698243008b39db65470dbdf0a3857..990c16270b0def8c49134f4d2f9ce0bc class Mirror { constructor() { __publicField$1(this, "idNodeMap", /* @__PURE__ */ new Map()); -@@ -809,9 +821,14 @@ function serializeElementNode(n2, options) { +@@ -809,9 +820,14 @@ function serializeElementNode(n2, options) { } } if (tagName === "link" && inlineStylesheet) { @@ -76,7 +77,7 @@ index 46ec389fefb698243008b39db65470dbdf0a3857..990c16270b0def8c49134f4d2f9ce0bc let cssText = null; if (stylesheet) { cssText = stringifyStylesheet(stylesheet); -@@ -1116,7300 +1133,227 @@ function serializeNodeWithId(n2, options) { +@@ -1116,7300 +1132,227 @@ function serializeNodeWithId(n2, options) { keepIframeSrcFn }; if (serializedNode.type === NodeType$2.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ; @@ -7586,7 +7587,7 @@ index 46ec389fefb698243008b39db65470dbdf0a3857..990c16270b0def8c49134f4d2f9ce0bc class BaseRRNode { // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any constructor(..._args) { -@@ -8507,7 +1451,7 @@ function getUntaintedPrototype(key) { +@@ -8507,7 +1450,7 @@ function getUntaintedPrototype(key) { } ) ); @@ -7595,7 +7596,7 @@ index 46ec389fefb698243008b39db65470dbdf0a3857..990c16270b0def8c49134f4d2f9ce0bc untaintedBasePrototype[key] = defaultObj.prototype; return defaultObj.prototype; } -@@ -11382,11 +4326,19 @@ class CanvasManager { +@@ -11382,11 +4325,19 @@ class CanvasManager { let rafId; const getCanvas = () => { const matchedCanvas = []; @@ -7620,7 +7621,7 @@ index 46ec389fefb698243008b39db65470dbdf0a3857..990c16270b0def8c49134f4d2f9ce0bc return matchedCanvas; }; const takeCanvasSnapshots = (timestamp) => { -@@ -11407,13 +4359,20 @@ class CanvasManager { +@@ -11407,13 +4358,20 @@ class CanvasManager { context.clear(context.COLOR_BUFFER_BIT); } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58112fe68..e8bf56ba0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,7 +6,7 @@ settings: patchedDependencies: '@rrweb/record@2.0.0-alpha.17': - hash: sorfa6jutufatzjjdyq5ts3t6y + hash: whowpogbeh6bxjqrkhjw6cjeui path: patches/@rrweb__record@2.0.0-alpha.17.patch '@rrweb/rrweb-plugin-console-record@2.0.0-alpha.17': hash: ytsspyi7p3hvqcq64vqb7wb6bu @@ -74,7 +74,7 @@ devDependencies: version: 12.1.1(rollup@4.24.0)(tslib@2.5.0)(typescript@5.5.4) '@rrweb/record': specifier: 2.0.0-alpha.17 - version: 2.0.0-alpha.17(patch_hash=sorfa6jutufatzjjdyq5ts3t6y) + version: 2.0.0-alpha.17(patch_hash=whowpogbeh6bxjqrkhjw6cjeui) '@rrweb/rrweb-plugin-console-record': specifier: 2.0.0-alpha.17 version: 2.0.0-alpha.17(patch_hash=ytsspyi7p3hvqcq64vqb7wb6bu)(rrweb@2.0.0-alpha.17) @@ -2870,7 +2870,7 @@ packages: dev: true optional: true - /@rrweb/record@2.0.0-alpha.17(patch_hash=sorfa6jutufatzjjdyq5ts3t6y): + /@rrweb/record@2.0.0-alpha.17(patch_hash=whowpogbeh6bxjqrkhjw6cjeui): resolution: {integrity: sha512-Je+lzjeWMF8/I0IDoXFzkGPKT8j7AkaBup5YcwUHlkp18VhLVze416MvI6915teE27uUA2ScXMXzG0Yiu5VTIw==} dependencies: '@rrweb/types': 2.0.0-alpha.17