browser-extension-utils 0.1.18 → 0.1.19
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/index.js +5 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -102,11 +102,13 @@ export const removeEventListener = (element, type, listener, options) => {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
export const getAttribute = (element, name) =>
|
|
105
|
-
element ? element.getAttribute(name) : null
|
|
105
|
+
element && element.getAttribute ? element.getAttribute(name) : null
|
|
106
106
|
export const setAttribute = (element, name, value) =>
|
|
107
|
-
element
|
|
107
|
+
element && element.setAttribute
|
|
108
|
+
? element.setAttribute(name, value)
|
|
109
|
+
: undefined
|
|
108
110
|
export const removeAttribute = (element, name) =>
|
|
109
|
-
element ? element.removeAttribute(name) : undefined
|
|
111
|
+
element && element.removeAttribute ? element.removeAttribute(name) : undefined
|
|
110
112
|
|
|
111
113
|
export const setAttributes = (element, attributes) => {
|
|
112
114
|
if (element && attributes) {
|