Skip to content

Commit

Permalink
fix variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Oct 22, 2024
1 parent 1284fef commit 4facee8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
33 changes: 20 additions & 13 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
diff --git a/dist/rrweb.js b/dist/rrweb.js
index 1db2d08b2fe9a73521001c3aa88b1a64d1b3e71a..53b91e6338ba49e8d461b7da5ffd82cbce41e71e 100644
index 1db2d08b2fe9a73521001c3aa88b1a64d1b3e71a..5a3ea8410b0f1dfa7248b9cb9752c04eea7b3ad3 100644
--- a/dist/rrweb.js
+++ b/dist/rrweb.js
@@ -661,9 +661,18 @@ function serializeElementNode(n2, options) {
@@ -85,6 +85,9 @@ function isCSSImportRule(rule) {
function isCSSStyleRule(rule) {
return "selectorText" in rule;
}
+function findStylesheet(doc, href) {
+ return Array.from(doc.styleSheets).find((s) => s.href === href);
+}
class Mirror {
constructor() {
__publicField$1(this, "idNodeMap", /* @__PURE__ */ new Map());
@@ -661,9 +664,14 @@ function serializeElementNode(n2, options) {
}
}
if (tagName === "link" && inlineStylesheet) {
- const stylesheet = Array.from(doc.styleSheets).find((s2) => {
- return s2.href === n2.href;
+ const href = n.href
+ let stylesheet = Array.from(doc.styleSheets).find((s) => {
+ return s.href === href;
});
- });
+ const href = n2.href;
+ let stylesheet = findStylesheet(doc, href);
+ if (!stylesheet && href.includes('.css')) {
+ const rootDomain = window.location.origin
+ const stylesheetPath = href.replace(window.location.href, '')
+ const potentialStylesheetHref = rootDomain + '/' + stylesheetPath
+ stylesheet = Array.from(doc.styleSheets).find((s) => {
+ return s.href === potentialStylesheetHref;
+ });
+ stylesheet = findStylesheet(doc, potentialStylesheetHref);
+ }
let cssText = null;
if (stylesheet) {
cssText = stringifyStylesheet(stylesheet);
@@ -5016,11 +5025,19 @@ class CanvasManager {
@@ -5016,11 +5024,19 @@ class CanvasManager {
let rafId;
const getCanvas = () => {
const matchedCanvas = [];
Expand All @@ -48,7 +55,7 @@ index 1db2d08b2fe9a73521001c3aa88b1a64d1b3e71a..53b91e6338ba49e8d461b7da5ffd82cb
return matchedCanvas;
};
const takeCanvasSnapshots = (timestamp) => {
@@ -5041,13 +5058,20 @@ class CanvasManager {
@@ -5041,13 +5057,20 @@ class CanvasManager {
context.clear(context.COLOR_BUFFER_BIT);
}
}
Expand All @@ -72,15 +79,15 @@ index 1db2d08b2fe9a73521001c3aa88b1a64d1b3e71a..53b91e6338ba49e8d461b7da5ffd82cb
dataURLOptions: options.dataURLOptions
},
[bitmap]
@@ -9805,6 +9829,7 @@ class Replayer {
@@ -9805,6 +9828,7 @@ class Replayer {
}
const { addCustomEvent } = record;
const { freezePage } = record;
+const version = "2.0.0-alpha.16"
export {
EventType,
IncrementalSource,
@@ -9816,6 +9841,7 @@ export {
@@ -9816,6 +9840,7 @@ export {
freezePage,
_mirror as mirror,
record,
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4facee8

Please sign in to comment.