Is that is a bug??? On Dec 30, 12:02 am, Andriy Mykhaylyuk <mehal....@gmail.com> wrote: > Hello guys, > so I'm trying to remove tab which is created from popup script. My > code is working good when it's executed from chrome-extension:// > {chrome-extension-id}/popup.html, tab is created and removed after > some logic. But it's not working from actual popup dialog!!! What is > the problem there? > > chrome.tabs.create( > { url: "${URL}", selected: true }, > function (tab) { > var targetId = tab.id; > > var tabLoaded = function (tabId, changedProps, tab) { > if (tabId != targetId || changedProps.status != "complete" > || getURLParameter("session", tab.url) == "") > return; > var sessionDetails = JSON.parse(unescape(getURLParameter > ("session", tab.url))); > chrome.tabs.remove(tabId); > chrome.extension.getBackgroundPage().setSessionDetails > (sessionDetails); > } > chrome.tabs.onUpdated.addListener(tabLoaded); > }); > > Probably the problem is because it's executed under event context? > > Will appreciate any reply, thanx
-- 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.