I do not think you have to manipulate any DOM for that, you just send the
getSelection() value to the popup page.
And yes, that is the only way to do it, you cannot access the content of a
tab with any API chrome presents, you can only do so with content script
(hence the name).

☆PhistucK


On Wed, Jan 13, 2010 at 18:03, Petty <m...@paulgriffinpetty.com> wrote:

> Brian --
>
> Seems like (and please correct me if I'm off) that I'd need to inject
> a JavaScript file into the tab and set some var to getSelection on
> every mouseup (assuming that's feasable on view-source) so the
> Extension's popup.html could then grab that variable updated value to
> pop into my form.
>
> If that's right, okay ... But since the Extension already works on
> tabs this seems a little arduous.  I'm hopeful that this can be done
> without DOM manipulation.
>
> In case it helps I'm including the contents of files from my
> implementation below.
>
> Also, here the URL to the actual extension:
> http://gush.es/extras/gushes_chrome_ext/gushes.crx
>
> Thanks for your help;
>
> Paul
>
> On Jan 13, 2:52 am, Brian Kennish <bkenn...@chromium.org> wrote:
> > On Mon, Jan 11, 2010 at 8:32 PM, Petty <m...@paulgriffinpetty.com>
> wrote:
> > > I'm actually just trying to use window.getSelection() on a tab that
> > > has a view-source: displayed so that raw HTML can be posted through a
> > > form in a Chrome extension's popup window.
> >
> > > I have it working for 'normal' window / tab displays but getSelection
> > > () returns nothing on view-source: tabs.
> >
> > I created this test content script and it works fine on "view-source:"
> pages:
> >
> >   onmouseup = function() { alert(getSelection()); };
> >
> > Give it a try.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Chromium-extensions" group.
> To post to this group, send email to chromium-extensi...@googlegroups.com.
> To unsubscribe from this group, send email to
> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com>
> .
> 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 chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.

Reply via email to