How do I access currently selected text from a bookmarklet, while on gmail.com
I'm using FF 3.5.3 on Windows Vista.
This is my (edited for shortness) bookmarklet:
javascript:(function(){
var text = window.content.getSelection().toString();
alert(text);
})();
Works, but not on gmail.com. Probably due to dynamicly generated content.
I'm aware of this workaroun开发者_如何学运维d, but it only works for Firefox extensions.
Gmail using frames. Try:
document.getElementById('canvas_frame').contentWindow.getSelection().toString();
精彩评论