uhm, i don't think my post showed up, so i'll type it again.
that code should work, but it really depends on WHEN you run it, to
actually get the popup view it has to be open at the moment, i use the
following function to do this
function getPopupPage(){
if(chrome.extension.getViews()[1]){
return chrome.extension.getViews()[1];
}else{
return false;
}
}
which is used, for example when new data arrives to the background
page ( it tries to get the view, if it doesn't exist, returns false,
else return the view)
if(getPopupPage()){
getPopupPage().dosomething()
}else{
//.... do something else, update icon badge perhaps?
}
if you only have a background and a popup , the popup view index on
the array should be 1.
On May 24, 1:08 pm, tazz_ben <
b...@wbpsystems.com> wrote:
> Ok, so I'm trying to update an already running pop-up (browser action)
> from the background page. I have this code:
>
> var views = chrome.extension.getViews();
> for (var i = 0; i < views.length; i++) {
> var view = views[i];
> console.log(view);
> if (view.location.href == 'popup.html'){
> view.UpdateProjectList();
> }
> }
>
> The problem is that it never gets into the if statement. I did the
> console.log there to see what was going on and I got a bunch of empty
> objects. A running popup is a "view" correct?
>
> --
> You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
> To post to this group, send email to
chromium-extensi...@chromium.org.
> To unsubscribe from this group, send email to
chromium-extensions+unsubscr...@chromium.org.