开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜