Ali Baig
Ali Baig

Reputation: 3867

Firebreath Document Viewer Plugin

I've been playing with firebreath from last 3 days, I saw the video and setup a basic plugin on windows and that's working. I tried adding new methods and they are fine too.

Now what I've planned to do is, I'm developing a document viewer plugin which works like quickview and adobe acrobat used for rendering documents inside browsers. For this, I want to capture the click events when clicked on some file in browser lets say. I know I'll need to setup multiple Mime-types in the plugin configuration.

Can you please tell me whether its possible using firebreath for this purpose? I've been struggling from last many days and came across firebreath 3 days ago. Looking for a response. Thanks

Upvotes: 1

Views: 138

Answers (1)

taxilian
taxilian

Reputation: 14324

FireBreath isn't really set up for creating "full page" plugins. There are two basic types of NPAPI plugins:

  • Plugins instantiated by an object or embed tag
  • "Full page" plugins, which are instantiated when you try to view a page with a mimetype handled by the plugin

If you're trying to do something which involves using a plugin on an existing web page, then FireBreath should work fine for that. If you're trying to do a full screen plugin which automatically opens when the user tries to browse to a document of a specified mimetype on any arbitrary domain, you could probably do it but will need to learn more about NPAPI and maybe get your hands dirty in the internals a bit.

Honestly, if it were me, I'd forget about trying to do a plugin for something like this and build a document viewer in javascript (a la pdf.js). A good rule of thumb is that you never, ever want to make a plugin if you can do it another way, and I wouldn't think a document viewer fell under that category. If you need a proprietary C++ module or something consider compiling it with emscripten to get it into the browser.

Upvotes: 2

Related Questions