Skip to content

Commit 0b756bc

Browse files
committed
1 parent 0b26546 commit 0b756bc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

chromium/extension/lib/dom.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ window.dom = {
3030
return elem
3131
},
3232

33-
style(content) {
33+
style(content, attrs = {}) {
3434
const style = document.createElement('style')
35+
for (const attr in attrs) style.setAttribute(attr, attrs[attr])
3536
if (content) style.innerText = content
3637
return style
3738
},

firefox/extension/lib/dom.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ window.dom = {
3030
return elem
3131
},
3232

33-
style(content) {
33+
style(content, attrs = {}) {
3434
const style = document.createElement('style')
35+
for (const attr in attrs) style.setAttribute(attr, attrs[attr])
3536
if (content) style.innerText = content
3637
return style
3738
},

0 commit comments

Comments
 (0)