You are missing my point or I'm missing some basic understanding:
When the user will request a URL, the Injected js will run and
generate my extended html elements.
This will happen again and again for every new URL the user will go
to.
I want to avoid it !!
I want to create my HTML elements once and to show them to the user on
button click event.
My interface is more then a simple div and it takes time to create -
it uses some data from the server and it interact with the user, and
so on and on..
This is my motivation for my request - to keep my interface alive as
long as the chrome window is open - like the background page, and not
as long as the user is in the same URL.
Many thanks,
Moshe
On Aug 11, 7:24 pm, Boris Smus <
s...@chromium.org> wrote:
> Hi Moshe,
>
> You can modify the current tab by injecting javascript into it using content
> scripts or programmatic injection (executeScript). Seehttp://
code.google.com/chrome/extensions/content_scripts.htmlfor more info
> about that.
>
> Then you can communicate between the background page and content script with
> message passing APIs:
http://code.google.com/chrome/extensions/messaging.html
>
> Hope this helps,
> - Boris
>
>
>
>
>
>
>
> On Wed, Aug 10, 2011 at 12:26 AM, moshe2b <
mosh...@gmail.com> wrote:
> > Hi,
> > I want to append the same html elements to the current TAB document
> > DOM.
> > I want these html extended elements to live "forever", so I want to
> > built them once, and append them on every page load by the content
> > script.
> > I was thinking to place the createElement commends at the background
> > page.
> > Then for every web page load, I want the content script to
> > communicate with the background script, so it will append them to the
> > current TAB document DOM.
> > Is that good practice?
> > My problem is that I don’t know how to append html elements to the DOM
> > from the background page.
> > Can you please help?
>
> > --
> > 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...@chromium.org.
> > To unsubscribe from this group, send email to
> >
chromium-extensions+unsubscr...@chromium.org.