Hi there,
first of all ... I am really not a newbie. I have been programming for more than 25 years. And now I wanted to get started with Google Chrome extensions. I looked at several examples and all of them worked well. But when I tried to develop something for myself I got stuck ... deeply stuck. I'm confused about sending and receiving messages, the background page, the content script ... everything.
In short terms: I wanted to extract the src attribute of an image with id "fc_image" from an opened page (inside a tab) and display this attribute as text in a popup.
I chose to have it as a browser action (even if it is only for certain pages right now, but it will be more general in the future).
The manifest.json has a reference to the background_page "background.html" and permissions ["tabs", "http://*/*"]
Now the background.html should inject the content script "contentscript.js" into the page. The script should extract the src attribute from the image and ......... somehow ...... bring it back to the popup.html to show it (and to continue working with it). Can someone give me a hint how the injection and the message passing can work between the mentioned files?


LinkBack URL
About LinkBacks



Reply With Quote