[Project_owners] getSelection() length

Neil neil at parkwaycc.co.uk
Tue Mar 28 12:14:11 EST 2006


Michael Bar-David wrote:

> Sfter some searches, I understood that instead of using 
> document.getSelection() in an extension, I should use 
> window.content.getSelection(). But, I need to know it's length - and 
> this JS code of the extension:
> var word = window.content.getSelection();

document.getSelection() returns a string, but window.getSelection() 
returns a selection object. If you really want a string, you can use 
window.getSelection().toString() as a replacement.


More information about the Project_owners mailing list