sending message from background page to the content script

49 views
Skip to first unread message

jack

unread,
Aug 26, 2015, 6:51:51 AM8/26/15
to Chromium-extensions
hi,

i send a message from background script to the content script in a tabId and in the meantime, the tab became inactive. so my message would not be sent to the content script in that tab, right?

should I wait till that tab becomes active again and then, send this message? or we can ask the chrome to do that...for example, send the message to the content script in this tab when it becomes active again?

thanks in advance.

jack

unread,
Aug 26, 2015, 8:04:57 AM8/26/15
to Chromium-extensions
anyone please?

PhistucK

unread,
Aug 26, 2015, 8:11:45 AM8/26/15
to jack, Chromium-extensions
Please, do not bump threads after an hour. It may take days until you get a response.

What do you mean by "active"? That it is the foreground tab in the focused window?
The message is sent regardless of the "activeness" of the tab.
If the tab is closed before the message is passed, the message is lost.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/44ce7f7f-1baa-410d-8415-7973c85dff27%40chromium.org.

Tony BenBrahim

unread,
Aug 26, 2015, 4:53:58 PM8/26/15
to PhistucK, jack, Chromium-extensions
I just tested with an extension that receives messages from a native messaging extension in the background page, which are then passed to the content script, and then to the page. The messages keep being delivered even if the tab is inactive, Chrome is minimized, etc...

jagdish achara

unread,
Aug 26, 2015, 5:15:06 PM8/26/15
to Tony BenBrahim, PhistucK, Chromium-extensions
Great! thanks.
Reply all
Reply to author
Forward
0 new messages