browser plug-in programming

What does it take to develop (program) a browser plug-in?

I’m thinking along the lines of the Google popup blocker.

What language is it written in?

How do you hook it into the browser?

etc.

      • I think if you want to do an IE plugin, you pay MS some bunch of money, and then they give you a few files you need to do it.
  • Netscape/Mozilla is open, however. Ask around there.
    ~

All the documentation for adding this kind of thing to IE is here.

It doesn’t cost anything.

Such items would usually be written in C++. Hooks into the browser are done using the MSHTML COM library which allows you to receive events from the document being viewed and act on them accordingly.

A full rundown on all the techniques would take ages - it all depends on what you want to do. The documentation I’ve linked to is pretty comprehensive.

Excellent, that’s just what I was looking for.

Before I dive into the docs … I was wondering if there was a way to “filter” Javascript events?

Basically what I would like to do is write a popup blocker for Javascript mouse-over popups.

To be honest, I find writing browser plugins like toolbar bands a bit of a pain. I’d look into hosting the browser control on a window at first since this’ll let you into the object model in a more flexible way and with a lot less boilerplate code and debug issues.

Two things:
Most of the mouse over popups I’ve seen use Flash. In this case there’s not a lot you can do to combat them other than block all embedded flash or (as I think some other browser may do?) exchange them for an optional “Load Flash” button.

Other mouseover popups would have to be done with DHTML. It’s going to be tricky to detect this kind of thing without trashing the popup menus that many sites use. I’d look into capturing the “onpropertychanged” event (set exposed on MSHTML.IHTMLElement2 as a property but, annoyingly, only as an event on the tag-specific classes) and trying to work out what’s going on from that. Since there’re so many ways to show/hide a block element this may be non-trivial (you can set the visibility or display styles, move it to a position off the side of the document etc).

In short, blocking the JS mouseover popups seems like is should be an easy thing to do, but it’s going to involve some fairly major logic to distinguish between acceptable and unacceptable events.

      • Now that I think of it, go look around on Astalavista Security Group’s website–they write IE plugins all the time… :smiley:
        ~

I was afraid this was going to be the case. So in effect, we might as well all get used to mouse-over popups because they are going to be difficult to block. I can see it all now, MS issues a $29.95 upgrade to IE that blocks mouse-over popups. Woe is me.