How to access the parent tab's url from a popup?
So I have a default_popup:popup.html defined in the manifest.json, from which I want to access th开发者_Go百科e current tab that initiated the action. The tabId and the tab url are required. How do I go about doing it ?
I think this might help you:
http://code.google.com/chrome/extensions/tabs.html#method-getCurrent.
It returns the currently selected tab when you execute it (i.e. tab that initiated the action if you run it when the popup opens), and returns an object that contains the data you need.
精彩评论