mirror of
https://github.com/NohamR/safari-internal-js.git
synced 2026-10-11 02:49:41 +00:00
14 lines
459 B
JavaScript
14 lines
459 B
JavaScript
//# sourceURL=__InjectedScript_WDElementDisplayed.js
|
|
function fetchTagNameAndAttributesOfElement(element) {
|
|
"use strict";
|
|
let tagName = element.tagName.toUpperCase();
|
|
let attributes = {};
|
|
for (let i = 0; i < element.attributes.length; ++i) {
|
|
let name = element.attributes[i].name.toLowerCase();
|
|
let value = element.attributes[i].value;
|
|
if (!value.length) value = null;
|
|
attributes[name] = value;
|
|
}
|
|
return { tagName, attributes };
|
|
}
|