0
chrome.tabs.query({   active: true,   currentWindow: true }, ([currentTab]) => {   console.log(currentTab.url); });

Code higher works but i want return current tab url. If i use

return currentTab.url

It returns undefined.

  • 1
    Possible duplicate of [How do I return the response from an asynchronous call?](https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call) – wOxxOm Jul 09 '18 at 16:29
  • Callbacks in extensions API are invoked asynchronously, see the linked topic for explanations and solutions. – wOxxOm Jul 09 '18 at 16:30

0 Answers0