Hi Jonna,

When you mean "attaching", do you want popup.html to have access to the
content script? If so, you can use message communication between the Popup
and the Content script of the current tab.

For example, in your popup.html you can do something like this:

> chrome.tabs.getSelected(null, function(tab) {

  // Send a request to the content script.

  chrome.tabs.sendRequest(tab.id, {action: "giveMeSomething"},
> function(response) {

    console.log(response.result);

  });

});


While your content script should listen:

> chrome.extension.onRequest.addListener(function(request, sender,
> sendResponse) {

 if (request.action == "giveMeSomething")

   sendResponse({result: "Some result from content script"});

 else

   sendResponse({}); // Send nothing..

});


I explained this for someone in stackedoverflow,
http://stackoverflow.com/questions/1964225/accessing-current-tab-dom-object-from-popup-html/1964445#1964445

That is one of the ways to actually let your popup script to read anything
from the content script, that is called a simple one time request. Another
way which is a long living connection between your extension and the content
script is to use chrome.extension.connect(), for more information regarding
Message Passing, refer to this document:
http://code.google.com/chrome/extensions/messaging.html

-Mohamed Mansour


On Mon, Dec 28, 2009 at 2:30 AM, jonna <[email protected]> wrote:

> Hi,
>
> The content scripts are not attaching to popup.html or any other
> iframes inside popup.html in BrowserActions. The previous architecture
> of Toolstrips/Moles attached any content scripts to the iframes inside
> the mole. It would be great if this feature is included in the iframes
> in popup.html even in BrowserActions. Can anyone give me an update if
> this feature would "ever" be included as this feature greatly affects
> the extension we are developing.
>
> Thanks,
> Jonna.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Chromium-extensions" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<chromium-extensions%[email protected]>
> .
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to