Skip to content

Commit

Permalink
bar.js: removes the data-tracy-content HTML attributes from DOM
Browse files Browse the repository at this point in the history
so it doesn't shows in Developer Tools
  • Loading branch information
dg committed Jan 12, 2025
1 parent 41930ac commit dbea323
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Tracy/Bar/assets/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class Panel {
let elem = this.elem;

this.init = function () {};
elem.innerHTML = elem.dataset.tracyContent;
elem.innerHTML = elem.tracyContent = elem.dataset.tracyContent;
delete elem.dataset.tracyContent;
Tracy.Dumper.init(Debug.layer);
evalScripts(elem);

Expand Down Expand Up @@ -156,7 +157,7 @@ class Panel {

let meta = this.elem.parentElement.lastElementChild;
doc.body.innerHTML = '<tracy-div itemscope>'
+ '<div class="tracy-panel tracy-mode-window" id="' + this.elem.id + '">' + this.elem.dataset.tracyContent + '</div>'
+ '<div class="tracy-panel tracy-mode-window" id="' + this.elem.id + '">' + this.elem.tracyContent + '</div>'
+ meta.outerHTML
+ '</tracy-div>';
evalScripts(doc.body);
Expand Down

0 comments on commit dbea323

Please sign in to comment.