1

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

Ali Baig
  • 3,819
  • 4
  • 34
  • 47
  • As it turned out, you got to me, but asking it this way isn't really an effective use of stackoverflow. Ask questions here for everyone; ask more targetted things if you want to on the firebreath-dev group. Asking to one particular person isn't a great use of this site. – taxilian Jan 03 '15 at 04:12
  • In your other question on this topic you didn't want to use NPAPI because it's being removed from Chromium-based browsers; you do realize that Firebreath won't solve that problem, right? The NPAPI plugin it would generate won't work in Chromium in the long term. – smorgan Jan 04 '15 at 14:23
  • @smorgan That's why i said I'm totally confused how I'm going to make it. With chrome, I thought even if we leave it for now and make solution work with firebreath on other browsers, it would be a good achievement and later we can implement for chrome. That was the thinking. – Ali Baig Jan 05 '15 at 08:47

1 Answers1

2

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.

taxilian
  • 14,229
  • 4
  • 34
  • 73
  • Hi I'm feel sorry if the way of asking question annoyed anyone but i couldn't help myself in frustration about the solution and feel like you are the only guy on planet who can show me a way on this. Sorry again!! – Ali Baig Jan 03 '15 at 07:26
  • And regarding the viewer, the problem i had to deal with was, I cannot update the solution of the system at server (someone owns it) to add support for document viewing and it must only be done on client, and since I had to give the support for more than 7 extensions (.mht, .tiff, .dwg, .pdf, .doc, .xls, .ppt), I felt firebreath (plugin dev.) was the only solution. I don't think there's enough material available regarding this subject on google. – Ali Baig Jan 03 '15 at 07:30
  • pdf.js *is* client-side. – smorgan Jan 04 '15 at 14:23
  • But that's only cover pdf, I have to cover other extensions as well and pdf.js would be required to integrate into the original solution whereas i cannot update the solution as I only have a build and not the code. – Ali Baig Jan 05 '15 at 08:42
  • 1
    Nobody said you should use pdf.js. He said you should build your document viewer in JS. Your answer was that you can't because it has to be client-side, and I was pointing out that that doesn't make sense as an objection because pdf.js (an example of a document viewer built in JS) is client-side. You want to build a client side document viewer, taxilian is suggesting doing that using JS (which again, the general possibility of which has been demonstrated via pdf.js) rather than Firebreath. – smorgan Jan 05 '15 at 21:51
  • Exactly as smorgan says; there *are* things that you need to use a plugin for, as there aren't alternatives, but before going that route you should look at all other possibilities. pdf.js is an example of something that renders documents client-side; there is a very good chance that you could do the same thing with your formats. – taxilian Jan 07 '15 at 20:05