Content scripts don't have access to the extension's localStorage, but you
can communicate data between content scripts and background/popup/options
pages using the messaging API.



On Fri, Dec 11, 2009 at 7:06 PM, hexid <nick.curr...@gmail.com> wrote:

> i do not know the tab id...the code gets injected into any tab that
> has facebook open...
>
> my extension is hosted at
> https://chrome.google.com/extensions/detail/oibchndgminbbeopaejobnnajfjgkcnk
>
> i'm not very good with javascript yet but i have been using css and
> html for a while now...
>
> i dont want all the tabs to get the script because if any other sites
> are using the same html ids then it would change the layout of those
> pages...
>
> i have posted my latest code at http://hexid.uni.cc/facebook.zip
> does anyone know how i can get the content script to read the
> localstorage of the options page or if i could create a cookie and
> have the content script read that...
>
> On Dec 11, 7:05 pm, Aaron Boodman <a...@google.com> wrote:
> > On Fri, Dec 11, 2009 at 2:27 PM, hexid <nick.curr...@gmail.com> wrote:
> > > ok...i havent used any background pages...been searching for a way to
> > > do this for days now...and google hasn't documented their API very
> > > well yet...which isn't making this any easier...
> >
> > > also...would i use the chrome.extension.connect() to transfer the data
> > > to the background page?
> >
> > You don't need to use a background page -- you can do this directly
> > from the options page.
> >
> > Take a look at:http://code.google.com/chrome/extensions/messaging.html
> >
> > If you know the ID of the tab you want to talk to, send a message from
> > the extension using chrome.tabs.connect. You can also broadcast to all
> > tabs, by getting all the tabs using chrome.tabs then iterating through
> > them and sending them all the updated info.
> >
> > HTH,
> >
> > - a
>
> --
>
> 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