How to get currently selected text from within electron desktop application?


#1

I am building a desktop application with electron. As a part of its functionality I want to get text that is currently selected, when a particular event fires. This text can be any where - webpage, pdf, sublime etc.

Is there any way I can do this?


#2

Have you solved this?


#3

Google “userSelection” & “html Range” will help