0

My extension shows how many times I have visited specific websites(youtube.com, quora.com), save in local storage and show it when a new tab is opened.The structure of extension looks like:

  • index.html
  • manifest.json
  • script.js

manifest.json

    {
      "manifest_version": 2,

      "name": "Getting started example",
      "description": "",
      "version": "1.0",
      "chrome_url_overrides" : {
        "newtab": "index.html"
      }
    }

index.html includes script.js.My question is how do I track the list of visited urls.Do I need to use the background page or can I use chrome API for current url in script.js?

johnnash
  • 424
  • 2
  • 8
  • 17
  • Possible duplicate of [How can I get the URL for a Google Chrome tab?](http://stackoverflow.com/questions/1979583/how-can-i-get-the-url-for-a-google-chrome-tab) – Michał Perłakowski Apr 03 '16 at 12:19
  • @Gothdo Can I use `chrome.tabs.query` in script.js or do I need to use it in a background page. – johnnash Apr 03 '16 at 12:21

0 Answers0