Hi Aaron,
  I wanted to say, good job to you and the other guys working on
Chrome/Chromium, it's coming along very nicely.  Also was checking out
your web page to find some more information regarding postMessage,
very clearly written and understandable, great explanations.

  What I am trying to do in an extension goes along the lines of this:
     1) User opens a web page in Chrome.
     2) User hits button in toolstrip of extension.
     3) Modification happens to DOM of web page (after the toolstrip
button is pressed)

  My question is along the lines of Vasanth's, I have been scouring
the documentation looking for how I can communicate with a content
script from a toolstrip.  It seems from the documentation and your
blog that postMessage is the way to do this, but so far, I have been
unable to figure out how to do it.  Is there currently a mechanism,
even if only via building from source, where I can send a message from
a toolstrip back to a content script?  Here is what I have tried:

chrome.tabs.getSelected( undefined, function( in_objTab ) {
            if( in_objTab.postMessage )
            {
                console.log( 'can post message' );
            } // end if
            else
            {
                console.log( 'cannot post message' );
            } // end if
    } );

  I am guessing that getSelected is returning the tab with the context
of the web page and its own javascript, and since a content script
runs in its own javascript context, there is no postMessage
available.

  Am I being thick, unresourceful, not looking in the right place, all
three?

Thanks a bunch,
Shane

http://www.ubernote.com
http://www.shanetomlinson.com





On May 12, 5:58 pm, Aaron Boodman <[email protected]> wrote:
> The code on that page was just a proposal, it isn't exactly how it
> turned out. For best results, use the reference pages linked from
> here:
>
> http://dev.chromium.org/developers/design-documents/extensions
>
> The feature you are trying to use is documented on the content scripts
> page, here:
>
> http://dev.chromium.org/developers/design-documents/extensions/conten...
>
> It is a bit thin right now, though. You can also check out the Reader
> sample extension, which uses this feature, here:
>
> http://dev.chromium.org/developers/design-documents/extensions/samples
>
> - a

--~--~---------~--~----~------------~-------~--~----~
Chromium Discussion mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to