error while getting tab from its id

407 views
Skip to first unread message

jack

unread,
Aug 13, 2015, 5:26:45 AM8/13/15
to Chromium-extensions
hi,

I get the tabid from onBeforeRequest listener like below:

chrome.webRequest.onBeforeRequest.addListener(function(details) {
        var current_tabId = details.tabId;

        chrome.tabs.get(current_tabId,function(tab) {
                         
         });
}, {urls: ['http://*/*', 'https://*/*']});



But I get the following error:

Unchecked runtime.lastError while running tabs.get: No tab with id: 70.
    at chrome.webRequest.onBeforeRequest.addListener.urls


How can it be possible that this tab does not exist? Are there some tabs which exist temporarily?

Thanks

jagdish achara

unread,
Aug 13, 2015, 7:50:50 AM8/13/15
to Chromium-extensions
Someone could guess the reason please?

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/459c6217-eb44-49a0-b105-fa0a9846c123%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Antony Sargent

unread,
Aug 14, 2015, 3:17:26 PM8/14/15
to jagdish achara, Chromium-extensions
May be due to pre-rendering / chrome instant. See the section "A note about tab IDs" at https://developer.chrome.com/extensions/webNavigation



Reply all
Reply to author
Forward
0 new messages