Re: How to register MIME type for NPAPI plugin in Linux
Enrique Ocaña González <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.plugins |
|---|---|
| Organization | Igalia |
| Message-ID | <[email protected]> |
On Lunes, 5 de Diciembre de 2011 09:43:22 Ashish Mittal escribió:
> I have written a NPAPI plugin using croos plattform tool(Qt), in
> the .res file of my plugin project(on Window OS), I have associated
> MIME type with this plugin dll, so that it is getting detected by
> firefox, now I wanted to use the same plugin on Linux machine, I have
> recompiled the project on Linux machine and getting .so as an output.
> But it is not getting detected by firefox , so how do I associate MIME
> type with this plugin under Linux env.
>
> or what is equlient of .res file in Linux.??
> my dll MIME type is "application/x-shockwave-flash|application/
> futuresplash"
MIME type registration in Linux happens in a different way. You need to
declare a function in your plugin that will tell the browser about the MIME
type on runtime, when the plugin is loaded:
char *
NP_GetMIMEDescription(void) {
return "application/pdf:.pdf:Portable Document Format";
}
You can get more information about this in the following links:
http://gplflash.sourceforge.net/gplflash2_blog/npapi.html#SEC9
https://developer.mozilla.org/en/NP_GetMIMEDescription
And a full MPL/GPL/LGPL multiplatform plugin sample at:
http://people.igalia.com/eocanha/dev/libertexto/npsimple.tar.gz
(used to be at http://git.webvm.net/?p=npsimple but that's not online anymore)
Hope this to be useful. Cheers.
--
Enrique Ocaña