src/UI/rect.js
function getSelectionRects() {
  try {
    let selection = window.getSelection();
    let range = selection.getRangeAt(0);
    let rects = range.getClientRects();

    if (rects.length > 0 &&
        rects[0].width > 0 &&
        rects[0].height > 0) {
      return rects;
    }
  } catch (e) {}
  
  return null;
}
function getSelectionRects() {
  try {
    let selection = window.getSelection();
    let range = selection.getRangeAt(0);
    let rects = range.getClientRects();

    if (rects.length > 0 &&
        rects[0].width > 0 &&
        rects[0].height > 0) {
      return rects;
    }
  } catch (e) {}
  
  return null;
}
function getSelectionRects ( ) { try { let selection = window . getSelection ( ) ; let range = selection . getRangeAt ( 0 ) ; let rects = range . getClientRects ( ) ; if ( rects . length > 0 && rects [ 0 ] . width > 0 && rects [ 0 ] . height > 0 ) { return rects ; } } catch ( e ) { } return null ; }
Get the current window selection as rects

@return {Array} An Array of rects
Get the current window selection as rects