Skip to content

Commit

Permalink
šŸ› Avoid setting customizable attrs attribute unless we have processedā€¦
Browse files Browse the repository at this point in the history
ā€¦ attributes
  • Loading branch information
kierandrewett committed Dec 29, 2023
1 parent 8c66cd8 commit 66e122c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions components/customizableui/BrowserCustomizableInternal.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,14 @@ BrowserCustomizableInternal.prototype = {
Object.entries(attributes).map((a) => ({ name: a[0], value: a[1] }))
);

element.setAttribute(
"customizable-attrs",
Object.keys(processedAttributes).join(" ")
);
const processedAttributesKeys = Object.keys(processedAttributes);

if (processedAttributesKeys.length) {
element.setAttribute(
"customizable-attrs",
processedAttributesKeys.join(" ")
);
}

for (const [key, value] of Object.entries(processedAttributes)) {
const attributeValue = (value ?? "").toString();
Expand Down

0 comments on commit 66e122c

Please sign in to comment.