19

I'd like to develop an Internet Explorer extension that changes the content of a specific webpage, like content scripts in Google Chrome. (eg. when I go to the website Google and I search for "car" I'd like to have a div created on the page with the word "car" inside).

I've been looking on SO but haven't found clear evidences if this kind of thing is possible.

What I'm specifically looking for is a clear tutorial or some example of how to do this.

Bruno,

Bruno
  • 8,497
  • 13
  • 38
  • 55

6 Answers6

17

That is exactly what GreaseMonkey for IE is made for http://www.gm4ie.com/

Rob W
  • 341,306
  • 83
  • 791
  • 678
Jonathon
  • 2,571
  • 5
  • 28
  • 49
  • @Jonathon Wisnoski Thanks for your answer; GreaseMonkey does look great but I'd prefer not to use it because of the installation it requires. – Bruno May 24 '11 at 07:36
  • The installation? How else are you intending to install an IE extension? The source code is on the page - you can probably adapt it to whatever you want, or at least learn from it. Were you hoping for a JavaScript object you can silently / maliciously load into a page??? – Rup May 26 '11 at 15:04
  • @Rup No, I only want to create an extension that I can share (like in Google Chrome or Firefox). – Bruno May 26 '11 at 15:22
  • 2
    But the user would still need to install that extension, but of course you would need to install two things GM for IE and then your custom script. Personally I think it is the best possibly solution, but an actual custom extension would work as well as far as I know. One thing to think about is that if you ever want to port your code to another browser the GM for IE would be by far the easiest to do so with, as it is just normal JS with a few extra custom functions (which at least I can guaranty you will be basically present in GM for Firefox). – Jonathon May 26 '11 at 22:50
  • @Jonathon Wisnoski Thanks for your comment. I mean, this is ridiculous : why can we write simple extension for Firefox, Chrome and Safari and not with IE ? :-) – Bruno May 27 '11 at 10:01
  • IE requires C+ and VB I think, while the others require javascript. And C+ is anything but simple. – Jonathon May 27 '11 at 12:12
  • 1
    Also so few IE user use extensions that it seems that most people have just given up on them. And that is why you cannot easily find tutorials on how to do it. – Jonathon May 27 '11 at 12:53
  • gm4ie.com is no longer active. – mix Aug 09 '12 at 03:31
  • I really want to know the latest answer for this question, since GreaseMonkey for IE is outdated. – phoenies Feb 21 '14 at 08:32
  • @phoenies The current best method seems to be http://kangoextensions.com/ but I have yet to use it. – Jonathon Feb 21 '14 at 12:48
13

I have answered a similar question, but the answer is in C#. It describes how to create a fully working project to accomplish exactly what you asked: changing page contents!

How to get started with developing Internet Explorer extensions?

It covers other topics too:

  • running javascripts from the addin
  • how to register IE addins
  • saving data (addin configurations)
Community
  • 1
  • 1
Miguel Angelo
  • 23,796
  • 16
  • 59
  • 82
  • I'm looking at your answer (which is great) but I'm worried with the compatibility issues and I don't even know how to package the extension (that's why I'm looking for a really newbie tutorial :-) [step by step like in Firefox or Chrome (I mean they're doing it why not IE staff]) – Bruno May 26 '11 at 14:57
4

You can read more about Internet Explorer Extension from MSDN:

http://msdn.microsoft.com/en-us/library/aa753587(v=vs.85).aspx

Extensions in IE are not created using web technologies, they are created using C++/.NET. Such as ActiveX

Mohamed Mansour
  • 39,445
  • 10
  • 116
  • 90
  • Thanks for your answer but the documentation looks quite outdated and I did not see a mention of code injection. – Bruno May 24 '11 at 13:47
  • 2
    Hi Bruno, you can take a look at what Jonathon stated in the GreaseMonkey IE Extension. The source code is available, and it extends IE and allows manipulation within the DOM if you need an example how IE extensions work – Mohamed Mansour May 24 '11 at 22:00
3

Similar to "GreaseMonkey for IE" is Trixie:

Trixie is to Internet Explorer as Greasemonkey is to Firefox. It lets you remix the Web via scripts. You may do this to either make it more readable, fix bugs or to even add little features to make the site more usable to you. Trixie by itself does none of this. It is just a plugin for Internet Explorer that enables executing chunks of JavaScript code and thus lets you use the Web the way you want to use it.

cwd
  • 53,018
  • 53
  • 161
  • 198
1

This is one of the best I found. http://www.enhanceie.com/ie/dev.asp It has give sample scripts as well. Which will help you.

Another one is open source and stable version : firebreath

same kind question is also asked How to get started with developing Internet Explorer extensions?

Community
  • 1
  • 1
Kamahire
  • 2,149
  • 3
  • 21
  • 50
0

This is a working example of manipulating the DOM from microsoft. This is a BHO development with MS Visual Studio. Check it out: http://msdn.microsoft.com/en-us/library/bb250489%28v=vs.85%29.aspx

Tyler Rafferty
  • 3,391
  • 4
  • 28
  • 37