window.nevodSelection = () => {
const el = [...document.querySelectorAll(
'.syno-o-sh-view-selection'
)].find(el => {
const r = el.getBoundingClientRect();
return r.width > 0 && r.height > 0;
});
if (!el) return null;
const r = el.getBoundingClientRect();
return {
x: Math.round(r.x),
y: Math.round(r.y),
width: Math.round(r.width),
height: Math.round(r.height)
};
};
console.log('Выделение:', window.nevodSelection());