Adds support for classes
This commit is contained in:
parent
a36e88d15e
commit
9a66c7c491
6
index.js
6
index.js
|
@ -85,6 +85,8 @@ async function main() {
|
||||||
for (let element of elements) {
|
for (let element of elements) {
|
||||||
|
|
||||||
let box = await element.boundingBox();
|
let box = await element.boundingBox();
|
||||||
|
let classNameAttr = await element.getProperty('className');
|
||||||
|
let className = await classNameAttr.jsonValue();
|
||||||
|
|
||||||
// Scale the bounding box
|
// Scale the bounding box
|
||||||
box.x /= size.width;
|
box.x /= size.width;
|
||||||
|
@ -95,6 +97,10 @@ async function main() {
|
||||||
// Give the selector as type
|
// Give the selector as type
|
||||||
box.type = selector;
|
box.type = selector;
|
||||||
|
|
||||||
|
if (className !== "") {
|
||||||
|
box.class = className;
|
||||||
|
}
|
||||||
|
|
||||||
info.push(box);
|
info.push(box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue