Easiest way: Add the line:

if (chrome.extension.lastError) {
  //Possibly do some tidy-up so you don't try again
  return;
}

to your callback.

Alternatively, you could iterate over all tabs using a call to
chrome.windows.getAll and chrome.tabs.getAllInWindow, but that would
be more fiddly.

On Wed, Jan 13, 2010 at 9:51 AM, ChrisBuchholz
<christoffer.buchh...@gmail.com> wrote:
> Hi,
>
> part of my extension keeps an eye on a tab, and runs some code on the
> tab every X seconds, but if the tab gets closed, chrome.tabs.get will
> give en error "Error during tabs.get: No tab with id: X" and possible
> also be the cause for some crashing that occurs at that state.
>
> So how do i check if a tab exists, without using chrome.tabs.get so I
> get rid of that error.
>
> --
> 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...@googlegroups.com.
> To unsubscribe from this group, send email to 
> chromium-extensions+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/chromium-extensions?hl=en.
>
>
>
>
-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to