Skip to content

Commit

Permalink
Merge pull request #551 from AbdelrhmanMagdy/abmagdy/memory-leak-fix
Browse files Browse the repository at this point in the history
Ignoring src in media tags
  • Loading branch information
AbdelrhmanMagdy authored Mar 15, 2024
2 parents dfe4ad1 + 94ea7e1 commit bfca871
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/clarity-devtools/static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"manifest_version": 2,
"name": "Microsoft Clarity Developer Tools",
"description": "Clarity helps you understand how users are interacting with your website.",
"version": "0.7.23",
"version_name": "0.7.23",
"version": "0.7.24",
"version_name": "0.7.24",
"minimum_chrome_version": "50",
"devtools_page": "devtools.html",
"icons": {
Expand Down
10 changes: 10 additions & 0 deletions packages/clarity-js/src/layout/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ export default function (node: Node, source: Source): Node {
let linkData = { tag, attributes };
dom[call](node, parent, linkData, source);
break;
case "VIDEO":
case "AUDIO":
case "SOURCE":
// Ignoring any base64 src attribute for media elements to prevent big unused tokens to be sent and shock the network
if (Constant.Src in attributes && attributes[Constant.Src].startsWith("data:")) {
delete attributes[Constant.Src]
}
let mediaTag = { tag, attributes };
dom[call](node, parent, mediaTag, source);
break;
default:
let data = { tag, attributes };
if (element.shadowRoot) { child = element.shadowRoot; }
Expand Down

0 comments on commit bfca871

Please sign in to comment.