C
C
CRACKeH2015-05-09 12:24:41
Google Chrome
CRACKeH, 2015-05-09 12:24:41

How to get active window link in chrome extension?

I can not find out the url of the active window of the browser.
tried like this:
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
alert(tab.url);
});
the console outputs the following:
Uncaught TypeError: Cannot read property 'onUpdated' of undefined
what to do??

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2015-05-09
@miraage

Did you write this in the manifest?

"permissions": [
          "tabs"
        ],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question