I am working on a simple Firefox Extension and I want to get the selected text. I tried this:
var WordCount = {
/* ... */
changeSelected: function() {
Is this a normal Firefox extension or is it a JetPack Firefox extension.
In JetPack it would be
var doc = jetpack.tabs.focused.contentWindow;
if (doc.wrappedJSObject){ //This just checks if Firefox has put a XPCNativeWrapper around it for security
win = doc.wrappedJSObject;
}
or you can just access the window directly with window.getSelection()
like dcaunt suggested