Use Javascript to get selected text in Mobile Safari

后端 未结 3 637
天命终不由人
天命终不由人 2021-02-07 20:16

So I\'m working on a bookmarklet where it would be ideal for me to grab the content selected by the user using the \"loop\". Both window.getSelection and document.getSelection a

3条回答
  •  死守一世寂寞
    2021-02-07 20:35

    I think you would have to have the bookmarklet insert some content into the page that would operate on the selection. You might add a button to the top or bottom of the page, and when clicked it would act on the current selection. It could then clean up the added content or leave it there.

提交回复
热议问题