browser-extension-utils 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/userscript.ts +2 -1
- package/package.json +1 -1
package/lib/userscript.ts
CHANGED
|
@@ -40,7 +40,8 @@ export const addElement =
|
|
|
40
40
|
for (const entry of Object.entries(attributes)) {
|
|
41
41
|
// Some userscript managers do not support innerHTML
|
|
42
42
|
// Stay do not support multiple classes: GM_addElement('div', {"class": "a b"}). Remove `|class` when it is supported
|
|
43
|
-
|
|
43
|
+
// Stay do not support data-* attributes
|
|
44
|
+
if (/^(on\w+|innerHTML|class|data-.+)$/.test(entry[0])) {
|
|
44
45
|
entries2.push(entry)
|
|
45
46
|
} else {
|
|
46
47
|
entries1.push(entry)
|