One of the features I use is to check if content is selected and to retrieve the links in the selected content. I used to use
Code: Select all
document.commandDispatcher.focusedWindow.getSelection();
Code: Select all
window.getSelection();
I have been testing with Firefox v51.0.1 32 bit and developer edition v53.0a2 and they both fail to return any selected content.
Running the following in Scratchpad
Code: Select all
console.log(window.getSelection());
Code: Select all
window.getSelection();
Code: Select all
Selection { anchorNode: null, anchorOffset: 0, focusNode: null, focusOffset: 0, isCollapsed: true, rangeCount: 0, caretBidiLevel: null, interlinePosition: false, type: 1 }
Code: Select all
Selection { anchorNode: #text " on Rodrigues. Around 40 centimetres (16 in) long, Newton's parakeet was roughly the size of the ", anchorOffset: 43, focusNode: #text " in 1708, and was mentioned only a few times by other writers. The bird became scarce due to deforestation and perhaps hunting, and was probably wiped out by a series of ", focusOffset: 9, isCollapsed: false, rangeCount: 1, caretBidiLevel: 0 }
Trying it in Firefox v47.0.2, everything works correctly.
Could someone please advise as to how to get this working correctly.