extend IE with .net (VB or C#)
I want to write IE extension in .Net (VB/C#)
I already have experience writing firefox addons.
All I want to do is, manipulate the DOM before showing it to the user. Like remove some stuff, highlight words, etc...
Is it possible to do it using .Net? Or is the only way C++/ATL and those things?
I tried searching, but the only useful search results that came close were an unanswered forum question and a website that asks me to buy thei开发者_StackOverflow社区r $149 product to extend using .net
P.S. Please no "extending FF is so easy, why u extending IE? IE sucks, FF so cool" kind of comments.
Yes it can be done by writing a Browser Helper Object that uses COM Interop. The article Build a Managed BHO and Plug into the Browser has a very good example of how to do this.
Additionally Microsoft themselves have published some extensive documentation on how to write browser extensions. However the mention that writing extensions in a managed language has some negative drawbacks:
Important Because extensions run in-process with the browser process, they should not be written using managed code.
That advice is a little old, and the issue may not be as great as it once was. There are also some reference links on that page which help explain why:
- The Old New Thing: Do not write in-process shell extensions in managed code
- Now that version 4 of the .NET Framework supports in-process side-by-side runtimes, is it now okay to write shell extensions in managed code?
- In-Process Side-by-Side
- Add-on Performance Part 3: Optimizing Add-on Startup Performance
It can be done. Have a look at this post on the IE8 blog that gives some details and links to resources on how to extend IE using C# or other .NET languages.
You can use Greasemonkey for IE to manipulate the DOM. You can use .NET to generate this javascript by serving it and entering the url in the ScriptURL attribute.
精彩评论