Skip to content

Commit 8d15b9c

Browse files
committed
Made attrs arg of create.svgElem() optional to support attribute-less elems ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-widescreen]
1 parent 0b756bc commit 8d15b9c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

chromium/extension/lib/dom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ window.dom = {
3737
return style
3838
},
3939

40-
svgElem(type, attrs) {
40+
svgElem(type, attrs = {}) {
4141
const elem = document.createElementNS('http://www.w3.org/2000/svg', type)
4242
for (const attr in attrs) elem.setAttributeNS(null, attr, attrs[attr])
4343
return elem

firefox/extension/lib/dom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ window.dom = {
3737
return style
3838
},
3939

40-
svgElem(type, attrs) {
40+
svgElem(type, attrs = {}) {
4141
const elem = document.createElementNS('http://www.w3.org/2000/svg', type)
4242
for (const attr in attrs) elem.setAttributeNS(null, attr, attrs[attr])
4343
return elem

0 commit comments

Comments
 (0)