I'm sorry for not reading the guide before, and posting the question to the Forum. Here is my original question
I am learning how to develop a zotero plugin.
Specifically, the
purpose is to retrieve the coordinates of the selected text in relation
to the PDF page, and subsequently display relevant hints proximal to the
text. However, such an outcome has yet to be achieved.
I have
attempted to obtain the 'selection', then get the `range` by
`selection.getRangeAt(0)`. Unfortunately, this approach has been
hindered by the persistent outcome whereby `Selection.isCollapsed` is
always set to `true`.
Consequently, coordinates for the selected text are consistently registering as 0.
Several methods have been employed in an attempt to obtain the 'selection', including:
- `readerinstance._iframeWindow?.getSelection()`
- `readerinstance._iframeWindow?.document.getSelection()`
- `window.getSelection()` which listens to the `selectionchange` event.
These efforts have proved futile. As such, I am seeking further guidance or recommendations to resolve this issue.
Thank you in advance for your enthusiasm~