I have a function that looks at a tab's URL and then either hides or
shows the Page Action icon. When I call this function inside the
onSelectionChanged event the icon doesn't get updated. I checked that
I'm getting the correct tab id, ect. and found that If I add a 200 ms
delay then the icon update works.

example code:

chrome.tabs.onSelectionChanged.addListener(function(tabId, selectInfo)
{
    // fails
    chrome.pageAction.show(tabId);
})
chrome.tabs.onSelectionChanged.addListener(function(tabId, selectInfo)
{
    // succeeds
    window.setTimeout("chrome.pageAction.show(" + tabId + ")", 200);
});

Is there some way to avoid having to use this delay? I assume the
delay required could vary from machine to machine and depending on cpu
load, etc.

--

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