--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
I have multiple extension pages that the user can open. They allow the
user to edit a record and save. When the user saves, I send out a
notification so that the other pages can update themselves with the
new data, if necessary. So each page can send notifications, and they
also listen for the same kind of notification.
What I'm trying to avoid is having the page that sends the
notification receive its own notification and update itself. In my
listener, I want to look at sender.tab.id to see which tab sent the
notification, and if it's the same as the current tab, it should do
nothing.
I could always set some other variable or property in each tab to
uniquely identify them, but it seems that being able to access a tab's
ID would've been something that's possible...
chrome.extensions.sendRequest('tabid-request', function(tabid) { /* do
something with the tab id */ });
and the background page has something like
chrome.extensions.onRequest.addListener(function(request, sender,
sendResponse) {
if (request == 'tabid-request')
sendResponse(sender.tab.id);
});
It's asynchronous, but it's better than nothing.
Hope this helps,
Michael
On Feb 15, 11:52 pm, "Jason Barnabe (np)" <jason.barn...@gmail.com>
wrote: