Powering up with Internet Explorer Extensibility
The information published in this post is now out-of-date and one or more links are invalid.
—IEBlog Editor, 21 August 2012
I’ve been keenly interested in extending Internet Explorer since long before I joined the team last fall. MSDN provides some great documentation on how to extend Internet Explorer, but as a longtime IE enhancer, I’d like to highlight some of my favorite resources.
IE provides a number of mechanisms that permit software developers to extend the browser in powerful ways. You can add:
- Toolbar buttons
- Tools menu items
- Context menu items
- Toolbars
- Download managers
- Pluggable transfer protocols
In addition to (or in combination with) the above extensibility, Browser Helper Objects permit you to power-up the browser with everything from mouse gestures to content-rewriting and beyond.
The first three extensibility points can be extended using registry keys or DHTML alone, while you can plug into the latter three using almost any language: Visual Basic, C++, Borland Delphi, or any of the .NET Framework languages.
Of late, I’ve become a big fan of extensibility mechanism #3. Context menu extensibility provides a ton of bang for the buck. Simply add a registry key and a DHTML file, and you can enhance Internet Explorer’s context menu with significant new functionality.
As a demonstration, I put together a small collection of scripts that enable the user to:
- Remove all non-text elements from the current page
- Look up the currently selected text in the dictionary or encyclopedia
- View the source of the currently selected HTML elements
- Copy any image from the page
Since they’re just DHTML, you can view (and tweak!) the DHTML source of the IEToys by looking inside the installation folder.
Have fun, and feel free to send us suggestions for more toys!
- EricLaw
Comments
Anonymous
January 01, 2003
I'm scared of .exe's - can you post the thing as a .zip of html files and a .reg? Like this one:
http://channel9.msdn.com/ShowPost.aspx?PostID=106302
It seems to me that images could be hidden with a simple favelet...
javascript: var imgs = document.getElementsByTagName("img"); for (var i = 0; i < imgs.length; i++) { var img = imgs[i]; img.style.visibility = "hidden"; } void(0);Anonymous
January 01, 2003
[ View the source of the currently selected HTML elements ]
This is something that should have been inherent in IE - under the "view source" option.
It would be so-o much more efficient to just SELECT a portion of the page, then right click to see below the "view source" -
another option to JUST view the "selected" HTML or JavaScript.
{You could of course use Front Page but it is not always accurate nor efficient}
BTW: maybe this feature could be added to IE7Anonymous
January 01, 2003
Looks fantastic, Eric. However, have you done any security testing? Have some of the SDETs take a look at potential function override attacks, as the plugin probably doesnt have a security context ;)
And I agree with the above comment that the view selected source thingy should be added as a feature in ie7. that would own so muchAnonymous
January 01, 2003
Maurits: The executable is digitally signed by me (Eric Lawrence) to prevent tampering. Why? It's easier for the average user to check a digital certificate than to examine a .REG file to decide if it's malicious. There are other downsides to a .REG file, including that manual editing of the .HTM files would be required to install to a non-standard installation path; this would be required to uninstall as well.
Yes, virtually anything that can be done in a Context Menu extension can be done as a "favelet" as well. I find the context menu convenient, but your mileage may vary, of course.
Paul, I encourage you to take a look and let me know offline if you find anything interesting/evil. Thanks!Anonymous
January 01, 2003
Eh I have a dream. I actually implemented it with a Dhtml javascript class myself, which by the way works on IE only.
But I'd like to have the feature in the browser.
That is, I select a text in a page with my mouse, and the text gets underlined via dhtml. This allows me to use a web page as I would use a book, and, partticularly if the text is long, trace back soon the portions I liked.
I underline a lot my books here. Many other persons do.
It's like reintroducing in the new medium a Gutenberg feature.
I double click what I underlined and the portion double clicked is no longer underlined.
As I said, I implemented this. The fact I could nest such a thing in the Registry was something I wasn't aware of. That's terrific.
Yet why I'd like it as embedded already in IE7? Because in this way once I have finished underlining, I could choose a context menu that says, say: "Save Excerpts" - and it should auto produces a txt file already SAVED with:
date, original URL, document Title and all the texts I underlined.
That is, it's the saving that I can't implement via my dhtml only. I can extract exceprts, but then I still have to paste into an external editor launched on purpose.
It has also considerable educational purposes: one could extract portions of say a Shakespeare drama read online by merely underlining it.Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
Looks good from a security standpoint. Keep up the good work :)Anonymous
January 01, 2003
Eric Law over at the IE blog shares his interest and resouces for extending IE.
"IE provides a...Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
Event argument unnecessary. A relic from the original.Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
<Microsoft needs to seriously force some sort of quality and security filtering before ANY addon is allowed to plug itself in.>
That's the "Cancel" button on the dialog that says "Do you trust this code?"
It's misleading to imply that IE is uniquely vulnerable to the user making stupid decisions.Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
Xepol: Try the ".NET Framework" link in the post. It provides a great base class for building a toolbar for IE/Explorer in C#.Anonymous
January 01, 2003
Some useful stuff Eric. Many thanks! :)Anonymous
January 01, 2003
Putzed around with the toolband sample code. It could use a little bit of updating. Couple errors in the source due to string safe updates and no DllUnregisterServer function which means no uninstall.
It would be nice to have a real downloadable visual studio solution, had to copy and paste all the files off MSDN then make my own export definition file to get it to work with regsvr32.
Coding in the shell is pain enough without struggling against sample code :).
The ATL approaches on code project seemed ok, but looked more abstracted than I want to deal with. I didn't want to deal with some third party wizard install.Anonymous
January 01, 2003
<It's misleading to imply that IE is uniquely vulnerable to the user making stupid decisions.>
Still there should be "uninstall extension" or "Undo install" to help the user. Even if he have been treaked into installing something.
< Eh I have a dream. >
Have use seen http://www.w3.org/2001/Annotea/ project?
< View the source of the currently selected HTML elements >
Mozilla has it :)
And there should be both - "View downloaded source" and "View current DOM source" (part of it is selection source).Anonymous
January 01, 2003
Some if not all this (but + a whole lot more) is available with the NILS accessibilty toolbar (http://www.nils.org.au/ais/web/resources/toolbar/index.html).
If you like what Eric has done I think you will like this even better ;-).Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
for Maurits:
I tweaked your bookmarklet so that it will work in all browsers (read: Uses the Standards supplied by the W3C, DOM and ECMAScript references)
So, 'visibility' is now 'display', and I also cleaned up the incorrect double quotes, the var declaration inside the for loop (redundant redefinition)
javascript:var imgs=document.getElementsByTagName('img');var img;for(var i=0;i<imgs.length;i++){img=imgs[i];img.style.display = 'none';}void(0);
Now you can use this in any Web Browser! ;-)
Note: IE users will have to click on a security warning dialog, because IE's version of JavaScript can access the OS.
Thanks,
JackAnonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
@Eric: I must admit that wasn't the response I was hoping for. Sure, I can verify that you are the author of the .exe, but I still have to trust you without being able to review the code first. Personally, I'm comfortable reviewing .reg files.
@Jack: Thanks for your help :) But, a couple of things...
* visibility /is/ standard CSS. I chose visibility rather than display because visibility doesn't reflow the page like display does. Of course, maybe a reflow is what we want... it depends whether the annoyance is due to flashing gif's or just loss of screen real estate. So both versions are useful.
* Double-quotes should be fine AFAICT
* I put the var img inside the for loop because that's the only place it's needed. I have a personal code style rule that variables should be declared within the smallest scope in which they are needed.
* Perhaps a background-image catcher is necessary too... and <object> and <iframe>... and <embed>...Anonymous
January 01, 2003
Is there any way to look at the elements of a webpage (think "View Page Info" in Firefox)?Anonymous
January 01, 2003
Eric, yes, there is a link to a third party kludge that doesn't work worth beans. Aside from the fact that it can't install properly, can't uninstall properly, and whacks your toolbars when you DO install it, it is a KLUDGE.
I would like to see REAL integration with dotNet. I would be nice if the dotNet code didn't have to carry around an extra DLL to pretend it was something it wasn't. Wouldn't it be nice if IE was capable of using dotNet code directly, without all the kludging and uglyness?
That, perhaps, is more what I had in mind.
That said, I am playing with the bad kludge. We'll see if I can do anything useful with it.Anonymous
January 01, 2003
Xepol-- Sorry to hear you didn't like the sample. I've used it internally to great effect for prototyping new IE7 features. I haven't run into any installation or uninstallation problems, but perhaps the comments at CodeProject can help you out with that.
The .NET Framework inherently carries around separate DLLs for Interop with COM; it's a design decision they made. Having written IE extensions in VB, C++, .NET, and Delphi, I'm happiest with the results I was able to get with C#.
C# is my primary language, and I agree that greater IE integration with .NET would be most excellent.Anonymous
January 01, 2003
I leveraged the extensibility of IE to build an address bar replacement toolbar (http://www.quero.at/). I really enjoyed the IE platform so far and the excellent documentation on MSDN. One thing I miss is an interface to handle changes made to the DOM tree by scripting. This would be very useful for content rewriting systems.
I am still hoping that the final release of IE7 will have the same toolbar layout flexibility like previous versions of IE had. Please allow the user to turn off the address and tab bar separately.
BTW there is a bug in the context menu UI handler of IE: if I double click and instantly right click a word to let's say perform a cursor search on that word, IE opens the wrong type of context menu (the context menu for the whole page instead of the context menu for the text selection). To reproduce the bug you have to click sufficiently fast.Anonymous
January 01, 2003
The above mentioned bug can be easier reproduced by selecting a text block and then double clicking on a word in it. Afterwards right click on the word to see what I mean.Anonymous
January 01, 2003
What sort of schedule are we looking at for further betas and then a public release?
At the company I work most of the developers are still working on win2k boxes - if IE7 is going to be XP only we'll need to upgrade to XP.
When it's made publically available will it be a windows update thing - IE 90% of XP users will switch from IE6 to IE7 overnight?
Is it going to be possible for us to run IE7 side by side with IE6, either officially or using the files that currently let me near-as-needs-be run IE6/IE5.5/IE5 on my win2k machine?
Cheers!Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
Hello.
Great tips. BTW, I use Adrian Batemam' IEPRint for fit-width printing:
http://adrianba.net/archive/blog-7826f25163ca406caee7ec2c11066a75.aspx
Is it possible to add this feature into right-click menu?
Also, is it possible to add "Print selection"
into same menu?
Thanks for answers.Anonymous
January 01, 2003
I would like to do the opposite: I'd like to remove the following items from my default context menu: 'Set as Background', 'Copy Background', 'Set as Desktop Item...'
Any idea how? I've tried rummaging around the registry, but to no avail.Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
<<I'd like to remove the following items>>
Arun: Sadly, we don't offer a simple way to do this inside IE. It's possible to use IDocHostUIHandler to customize context menus, but this is nontrivial. <<http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/hosting/reference/ifaces/idochostuihandler/idochostuihandler.asp?frame=true>>
We are doing some cleanup of this menu in IE7.Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
For a cool walkthrough tutorial on writing your own context menu extensions (with lots of examples) check out: http://www.siteexperts.com/tips/hj/ts01/samples.aspAnonymous
January 01, 2003
Even more goodness. ;-)
http://slingfive.com/pages/code/ssPowerTools/Anonymous
January 01, 2003
Why does the IEBlog show up as 7 duplicate entries for each single entry in Thunderbird?Anonymous
January 01, 2003
How about bittorrent build in support ? Opera already has it, will it be added in IE?
Visit http://www.madtorrent.com For Easy Torrent SearchAnonymous
January 01, 2003
I spent quite some time on remembering and documenting a lot of bugs in Internet Explorer 6, and listed features that would be a great addition to Internet Explorer 7. I hope it's not too late to be useful for the developers!
I posted it in my blog (anonymous comments enabled): http://www.livejournal.com/users/tmaster/32935.html
Please include my nickname if you wish to reply in IEBlog instead of mine :-)
Please check it out, I'd like to receive any corrections and/or answers about which bugs will and will not be fixed, or which features will be implemented.
And my compliments for this blog post, I consider myself a power user, yet didn't know you could extend IE in such a way, while not needing a lot more than knowledge of scripting languages!Anonymous
January 01, 2003
I like the idea of extensibility, but I really really would like the stop and refresh buttons to be put back first :)Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
Eric Law over at the IE blog shares his interest and resouces for extending IE.
"IE provides a number...Anonymous
January 01, 2003
i'm a BHO developer, eric.
with IE7, my bho fails immediately on
the Navigate() call to IWebBrowser2.
i'm guessing this is due to CUri or
something close to it.
can you elaborate on this or
when there will be some documentation
available?
thanks for any info...
hongAnonymous
January 01, 2003
Hong-- Please let me know what URLs you're trying to Navigate to... CURL should not be breaking this in anyway.
My email address is ericlaw at microsoft dotcom.
Thanks,Anonymous
May 19, 2006
On Episode 22 of the Desert Skies podcast we cover some of the new exciting features of Window-Eyes...Anonymous
May 19, 2006
On Episode 22 of the Desert Skies podcast we cover some of the new exciting features of Window-Eyes...Anonymous
September 11, 2006
PingBack from http://www.ptvguy.com/2006/09/11/internet-explorer-7-is-your-site-ready/Anonymous
October 20, 2006
Hey! I’m Pete LePage, one of the Product Managers for IE and I’ve been around Microsoft for some timeAnonymous
November 07, 2006
Building AddOns for Internet Explorer Could Net You A Trip To Mix07 and $2500!As part of the IE7 launch, we want you to create your own AddOns, and I think we’ve got a great way to encourage you to do this. How about the best AddOn submitted between NAnonymous
November 09, 2006
Interesting competition over here about building an add-on to IE7 and winning yourself some cash and...Anonymous
November 09, 2006
I added the ish bit because while it may not cost you any money, it may cost you time. The IE team haveAnonymous
November 10, 2006
develop an internet explorer addonAnonymous
January 04, 2007
PingBack from http://channy.creation.net/blog/?p=374Anonymous
March 21, 2008
PingBack from http://carsmaxblog.info/ieblog-call-to-action-help-us-clean-up-manage-add-ons/Anonymous
January 21, 2009
PingBack from http://www.hilpers.it/1509474-new-internet-explorer-7-beta2/4Anonymous
January 21, 2009
PingBack from http://www.keyongtech.com/668437-ie-toolbar-programmingAnonymous
February 06, 2009
PingBack from http://blog.owensperformance.com/1969/12/new-internet-explorer-7-to-allow-more-customization/Anonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=ieblog-powering-up-with-internet-explorer-extensibilityAnonymous
June 01, 2009
PingBack from http://woodtvstand.info/story.php?id=13888Anonymous
June 15, 2009
PingBack from http://debtsolutionsnow.info/story.php?id=2042Anonymous
April 08, 2015
Some of the links give 404 not found errors, including msdn.microsoft.com/.../default.asp and msdn.microsoft.com/.../default.asp. I know this site has a lot of old info, so how are add-ons created now for IE9 in 2015?