IE“每个浏览器”探险家酒吧
有没有办法在 IE 中创建“每个浏览器”资源管理器栏,这意味着所有打开的选项卡都有一个公共资源管理器栏?按照 MS 指南创建的资源管理器栏是“按选项卡”的,这意味着每个新选项卡上都会打开一个新的资源管理器栏。或者,有没有一种方法可以在内置的“每个浏览器”浏览器栏之一(“收藏夹”、“提要”、“讨论”等)内显示 HTML 文档?
Is there a way to create a "per-browser" explorer bar in IE, that means an explorer bar common for all open tabs? The explorer bars created following MS guidelines are "per-tab", meaning that a new explorer bar is opened on each new tab. Alternatively, is there a way to display an HTML document inside one of the built-in "per-browser" explorer bars - "Favorites", "Feeds", "Discuss" etc.?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有内置的方法可以做到这一点。资源管理器栏的可扩展性模型规定资源管理器栏和选项卡之间的比例为 1:1。造成这种情况的原因有很多,通常与从 IE6 到带有选项卡的现代网络浏览器的最简单路径有关。考虑一下基于 OLE 的体系结构:对于初学者,您拥有由 IObjectWithSite 设置的站点对象。您可以使用该站点来询问 IWebBrowser2、当前 IHTMLDocument2 等内容。扩展通常会在获取这些指针时对其进行缓存。因此,您需要这种 1:1 的对应关系。
如果您想要一个单实例资源管理器栏,您可以这样做,但这将涉及重新设置子窗口跨进程的父级,以及一大堆基于 BHO 的代码来正确获取 IE 的窗口状态。您最好使您的状态易于序列化,处理 DWebBrowserEvents2::WindowStateChanged 并伪造它。
There is no built-in way of doing this. The extensibility model for Explorer bars dictates a 1:1 ration between Explorer bars and Tabs. The reasons for this are many, and often have to do with the easiest path for getting from IE6 to a modern webbrowser with Tabs. Think about the OLE based architecture: for starters, you have your site object, set by IObjectWithSite. You use the site to interrogate for things like IWebBrowser2, the current IHTMLDocument2, etc. Often extensions cache these pointers when they get them. Thus you want this 1:1 correspondence.
If you want to have a single instance explorer bar, you could do it, but it would involve re-parenting child windows cross process, and a whole bunch of BHO-based code to get IE's window state just right. You're better off making your state easily serializable, handling DWebBrowserEvents2::WindowStateChanged and faking it.