Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Message communication between chrome and frame script

72 views
Skip to first unread message

Rajendra Sharma

unread,
Apr 22, 2016, 4:25:03 AM4/22/16
to dev-tech-e...@lists.mozilla.org
Hi Experts ,

I have a message listener in frame script loaded in content process.
frame script is injected in tab process using window.messageManager.
when I send message from chrome to content using
"window.messageManager.broadcastAsyncMessage" message is received in frame
script but when I send message from chrome to content using
"gBrowser.selectedBrowser.messageManager.sendAsyncMessage" message is not
received.

Is there any limitation that message listener in content will receive
messages from message manager who injected the frame script in content
process ?

Is there something I am doing wrong here ?


Regards,
Rajendra

Gabor Krizsanits

unread,
Apr 22, 2016, 9:02:59 AM4/22/16
to Rajendra Sharma, dev-tech-e...@lists.mozilla.org
Hi Rajendra,

If I get right what you are trying to do, from chrome side you should get
the selected tab and then tab.linkedBrowser.messageManager.sendAsyncMessage.

Regards,
- Gabor
> _______________________________________________
> dev-tech-electrolysis mailing list
> dev-tech-e...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-electrolysis
>

Bill McCloskey

unread,
Apr 22, 2016, 8:17:43 PM4/22/16
to Rajendra Sharma, dev-tech-electrolysis
On Fri, Apr 22, 2016 at 1:24 AM, Rajendra Sharma <sharma.r...@gmail.com
> wrote:

> Hi Experts ,
>
> I have a message listener in frame script loaded in content process.
> frame script is injected in tab process using window.messageManager.
> when I send message from chrome to content using
> "window.messageManager.broadcastAsyncMessage" message is received in frame
> script but when I send message from chrome to content using
> "gBrowser.selectedBrowser.messageManager.sendAsyncMessage" message is not
> received.
>

This should work. I think you'll need to provide more context to diagnose
the problem. Can you generate a reduced test case that shows the problem?

-Bill
0 new messages