如何制作像Firebug这样的插件?
我基本上是一个 dotnet 开发人员(初学者)。我需要制作一个 IE 插件,就像 Firefox 中的 Firebug 一样。 我需要 Firebug 的 HTML 和 CSS 功能,不需要其他功能。 我想知道我应该从哪里开始以及我应该选择哪个平台。我更喜欢 dotnet,但如果不可能的话也可以选择其他的。 我制作了一个连接客户端数据库的 FF 工具栏,但不知道 Firebug 类型的插件。 我需要使其仅适用于 IE。 有人可以帮助我提供链接、代码片段和/或一些指导我制作项目的理论吗? 感谢您的帮助:)
问候
I am basically a dotnet developer(beginner). I need to make an IE addon just like Firebug in Firefox. I need HTML and CSS features of Firebug, don't need the other features.
I would like to know where should I start with and which platform should I choose. I would prefer dotnet, but if not possible can go for others as well.
I have made a FF Toolbar that connects client's database, but have no idea about the Firebug kind of addon.
I need to make it only for IE.
Can someone help me with links, code snippets and/or some theories that would guide me to make my project.
Thanks for any help :)
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于我假设以前没有编写过 Firefox 扩展的人来说,开发像 Firebug 这样的东西是一项艰巨的任务。
也就是说,Mozilla 博客,以及 MSDN。
最后,您是否有理由需要自己写一些东西? Firebug 工作得很好,IE 有开发人员工具
Developing something like Firebug is a huge undertaking for someone who I'm assuming has not written a Firefox extension before.
That said, there's an introduction to developing extensions for Firefox on the Mozilla blog, and something similar for IE on MSDN.
Finally, is there a reason you need to write something yourself? Firebug works pretty well, and IE has Developer Tools
IE 开发工具栏最初实现的方式是一个浏览器栏,它遍历 DOM 并使用各种 IE COM 编程接口,例如 IDisplayServices。
这对于 IE 来说是一项艰巨的任务。有些事情无法通过扩展来很好地完成(因此开发工具直接集成到 IE 中),并且您可能会遇到同样的问题。而且,看起来你会边走边学,所以不要为此承诺一个非常激进的时间表。这不是小事。
但基本要点是:让您的资源管理器栏正常工作。实现 IObjectWithSite。当 IE 调用 get SetSite 方法时,缓存该 IUnknown 指针。您稍后可以使用 IUnknown::QueryInterface 和 IServiceProvider::QueryService 来查询它,以获取指向 DOM 和其他有用对象的指针。这是一本食谱。
另外,我根本不推荐使用 .net。您必须自己编写所有互操作,而且 IE 无论如何也不能很好地与托管扩展配合。
The way the IE Developer toolbar was originally implemented was an Explorer Bar that walks the DOM and uses the various IE COM programming interfaces, such as IDisplayServices.
This is a huge undertaking to do for IE. There were some things that just couldn't be done well from an extension (thus the dev tools were integrated directly into IE), and you'll likely run into the same problems. Also, it seems, you'll be learning as you go, so don't promise a very aggressive timeline for this. It's not trivial.
But the basic outline is: Get your Explorer Bar working. Implement IObjectWithSite. When IE calls your get SetSite method, cache that IUnknown pointer. You can later interrogate it with IUnknown::QueryInterface and IServiceProvider::QueryService to get pointers to the DOM and other useful objects. Here's a cookbook.
Also, I wouldn't recommend .net for this at all. You'll have to write all the interop yourself and IE doesn't play well with managed extensions anyway.
阅读答案 #4 中的评论 #1:Firebug Lite 已经存在并可在 IE 中运行,请参阅 http://getfirebug.com/firebuglite
它的开源 BSD 许可证,我们欢迎您的改进作为贡献。
Read comment #1 in answer #4: Firebug Lite already exists and works in IE, see http://getfirebug.com/firebuglite
Its open source BSD license and we would welcome your improvements as contributions.