Closed Bug 1276346 Opened 9 years ago Closed 9 years ago

chrome.tabs.create fails when called from a callback

Categories

(WebExtensions :: Untriaged, defect)

49 Branch
x86_64
Windows 10
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1238314

People

(Reporter: serge.zarembsky, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36 Steps to reproduce: While porting our extension (Ghostery) code written for Chrome to Firefox Nightly with Web Extensions API support we noticed that the links on our extension's popup fail to open. Here is the code we have for our openTab function which we call from background.js: function getActiveTab(callback) { chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) { callback(tabs[0]); }); }; function openTab(url) { utils.getActiveTab(function(tab) { if (tab) { chrome.tabs.create({ url: url, openerTabId: tab.id, index: tab.index + 1 }); } else { chrome.tabs.create({ url: url }); } }); } Debugging showed that the active tab was successfully found, but then chrome.tabs.create failed to execute, being called from the callback of getActiveTab. Actual results: Clicking on links in our extension's popup did not result in navigation. Expected results: They should've open a new tab and navigate it to the supplied url. Note that direct call: chrome.tabs.create({ url: url}); worked fine.
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
Component: Untriaged → WebExtensions
Product: Firefox → Toolkit
Serge, are there any errors or warnings logged to the console? Vasilica, could you please see if you can confirm this behaviour?
Flags: needinfo?(vasilica.mihasca)
Keywords: qawanted
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(vasilica.mihasca)
Resolution: --- → DUPLICATE
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.