I don't think that quite works in this context. My function
(browser_action: popup.html):
<script>
var selected_txt = window.getSelection(); <--- does not work
function shareaholic(){
chrome.tabs.getSelected( null , function(tab) {
var shareaholicUrl =
"http://www.shareaholic.com/share/";
var url = encodeURIComponent(tab.url);
var title = encodeURIComponent(tab.title);
var shareaholicUrl_tab = shareaholicUrl + '?url=' + url
+ '&title='
+ title +'¬e=' + selected_txt;
var shr_iframe = '<iframe id="shrFrame" name="shrFrame"
src="' +
shareaholicUrl_tab + '" noresize="noresize" frameborder="0"></
iframe>';
document.getElementById('shr_iframe').innerHTML =
shr_iframe;
});
}
</script>
On Nov 24, 1:03 pm, Mohamed Mansour <[email protected]> wrote:
> In JS, you should use window.getSelection()
>
> - Mohamed Mansour
>
> On Tue, Nov 24, 2009 at 5:39 AM, Jay <[email protected]> wrote:
> > Hey guys,
>
> > Any ideas on the best way to do this? In regular JS i'd use
> > content.getSelection(). A little lost on how to do it here.
>
> > Thanks in advance.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<chromium-extensions%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/chromium-extensions?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Chromium-extensions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/chromium-extensions?hl=en.