Chrome Extension: How to display tab objects?
I am in the process of designing an extension for Google Chrome that helps to organize tabs (I know, there are 开发者_运维技巧many that already exist; that doesn't matter). I wish to open a popup window that will display tabs as objects (i.e., in the same way that it is displayed in the tab bar at the top of the browser). One way of doing this would be to pull various details (ID, Title, URL, etc.) from each tab, create a class and make instantiations of it upon the opening of each tab using these data, but this seems rather convoluted considering that what I want is sitting right there in the tab bar. Is there any simpler way to achieve this?
In addition, I have seen several apps that utilize page previews. Is there something in the API that allows direct access to these?
That is the simplest way to do this, the only way to get the tabs of the window is by doing getAllInWindow from the tab API. Once you do that, you can organize it in any way you want within the popup.
To get page previews, you can use the screenshot API everytime, or use a third party to generate previews, and you can cache them locally, you can view the source for the speed dial extension to see how it is done.
精彩评论