Skip to content

Commit a27adcc

Browse files
committed
fix: addElement issue (v0.3.3)
1 parent 0ae40a7 commit a27adcc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/userscript.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export const addElement =
4040
for (const entry of Object.entries(attributes)) {
4141
// Some userscript managers do not support innerHTML
4242
// Stay do not support multiple classes: GM_addElement('div', {"class": "a b"}). Remove `|class` when it is supported
43-
if (/^(on\w+|innerHTML|class)$/.test(entry[0])) {
43+
// Stay do not support data-* attributes
44+
if (/^(on\w+|innerHTML|class|data-.+)$/.test(entry[0])) {
4445
entries2.push(entry)
4546
} else {
4647
entries1.push(entry)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "browser-extension-utils",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Utilities for developing browser extensions and userscripts",
55
"type": "module",
66
"main": "./lib/index.ts",

0 commit comments

Comments
 (0)