Thursday, August 16, 2012

Zscaler Safe Shopping 1.1 for Internet Explorer: C++ BHO

I released Zscaler Safe Shopping for Internet Explorer in March 2012. This was my first attempt at writing a Browser Helper Object (BHO) and it was written in C#. There are are number of disadvantages to using C#, as I described in my last post. C++ is required for "advanced" features, like intercepting and modifying all HTTP/HTTPS traffic.

Ultimately, I decided to bite the bullet and to learn C++ on Windows in order to deliver some great extensions for Internet Explorer this year. It was quite a steep learning curve to go from from C# and the scripting languages (Perl, Ruby, etc.) that I knew well, to C++. CodeProject turned out to be a great source of sample code for C++ BHOs. Various colleagues also helped to shorten my learning curve. Now here were are and Zscaler Safe Shopping has been rewritten from scratch in C++. If you are using version 1.0, an upgrade to the new 1.1 will speed up your browsing when the extension is in use. C# BHOs require that the .Net framework be loaded first, which takes at least 0.20s-0.30s for every tab. With C++, load time is significantly reduced.

It is very important that the BHO loads quickly, in under about 0.20s so as to not negatively impact the user experience and avoid warning messages. Starting with Internet Explorer 9.0, a warning is shown to the user when the browser opens to disable "slow" add-ons:
Warning about slow add-ons

It is much harder to write browser add-ons for IE than it is for Firefox and Chrome, but you can do quite a lot with IE. Here is the breakdown of the "advanced" features available to add-ons on the three major browsers:

Feature Firefox Internet Explorer Chrome
Modify HTTP requests and responses YES YES YES
Access the file system YES YES NO
Include C++ libraries YES YES* NO
Run executables YES YES NO
Run server inside browser YES YES NO
(* IE add-ons are C++ libraries, of course)

I plan on releasing some exiting browser add-ons for Internet Explorer this year, keep an eye on this blog!

7 comments:

Anonymous said...

Do you know if an HTTPS everywhere plugin would end up being compatible with IE10's Enhanced Protected Mode?

Incredible work, would be willing to test any alphas/betas.

Anonymous said...

Would you know if an HTTPS Everywhere addon would end up being compatible with IE10's Enhanced Protected Mode?

Incredible work, I'd freely test any alphas/betas, can't wait!

Anonymous said...

Would you know if an HTTPS Everywhere addon would end up being compatible with IE10's Enhanced Protected Mode?

Incredible work, I'd freely test any alphas/betas, can't wait!

Anonymous said...

Would you know if an HTTPS Everywhere addon would end up being compatible with IE10's Enhanced Protected Mode?

Incredible work, I'd freely test any alphas/betas, can't wait!

Anonymous said...

Would you know if an HTTPS Everywhere addon would end up being compatible with IE10's Enhanced Protected Mode?

Incredible work, I'd freely test any alphas/betas, can't wait!

Julien Sobrier said...

I have a prototype of HTTPS Everywhere working for IE. It is written in C#, and it has too many restrictions. That's why I'm going to rewrite it in C++.

I'm not sure how IE 10 Enhanced Protected mode will work, but I can think of several ways to get around any potential limitations for HTTPS Everywhere.

sarah said...

very informative post indeed .being enrolled in http://www.wiziq.com/course/5776-object-oriented-programming-with-c
i was looking for such articles online to assist me and your article helped me a lot. i really like that you are providing such information.