From 9a66c7c491c15e97c1f1e816b53f6e3dbee72cfb Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 17 Feb 2023 11:19:03 +0100 Subject: [PATCH] Adds support for classes --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 8bdfcad..53154cd 100644 --- a/index.js +++ b/index.js @@ -85,6 +85,8 @@ async function main() { for (let element of elements) { let box = await element.boundingBox(); + let classNameAttr = await element.getProperty('className'); + let className = await classNameAttr.jsonValue(); // Scale the bounding box box.x /= size.width; @@ -95,6 +97,10 @@ async function main() { // Give the selector as type box.type = selector; + if (className !== "") { + box.class = className; + } + info.push(box); }