开发者

Enumerating open tabs in Internet Explorer?

I'd like to find a way to enumerate the open tabs (and corresponding URLs) of the open tabs in Internet Explorer. I've found this question, which suggests that it's not possible to do this in general, but I'm looking specifically at solutions for IE7 and IE8.

I'd prefer Win32-only solutions (I don't want to take a dependency on .NET, if 开发者_StackOverflow社区possible).

I'm open to writing some kind of plugin for Internet Explorer, if that's necessary. Any pointers?


IE does not expose a supported way of enumerating tabs. What you have to do is write a BHO that sinks DWebBrowserEvents2::WindowStateChanged. Your BHO will be loaded once per tab, and you'll get a WindowStateChanged event whenever the user switches tabs to the old and new tab. Then you just have to keep a global map of BHOs to Tabs and a pointer to which is the active tab based on WindowStateChanged events.

Note: You can write a toolbar, instead of a BHO, that does the same thing. Just depends on if you want UI or not.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜