Chrome extension content scripts and iframe

Viewed 22058

I'm tryng to make an extension for google chrome that does this things:

Run when loading www.example.com example.com has an iframe to another site, i need to get access to a link from this iframe (this is rapidshare, I need to grab the downloadlink)

So far so good, but..

Then I need the extension to inform the link url to example.com for further processing.

Any ideas o directions??

I've read http://code.google.com/chrome/extensions/content_scripts.html#host-page-communication but can't make it work...

3 Answers

v3: serg's answer, what worked for me

"manifest_version": 3,
"content_scripts": [
    {
      "matches": ["http://www.rapidshare.com/*"],
      "all_frames": true,
      "js": ["insideIframe-content.js"]
    }
]

background.js:

chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
  console.log(url)
})

insideIframe-content.js:

chrome.runtime.sendMessage(url)
Related