From feed2imap@acme.com Thu Jan 17 23:40:00 2013
From: =?utf-8?b?UGxhbmV0X0RlYmlhbg==?= <feed2imap@acme.com>
To: =?utf-8?b?UGxhbmV0X0RlYmlhbg==?= <feed2imap@acme.com>
Date: Thu, 17 Jan 2013 23:40:00 -1000
X-Feed2Imap-Version: 0.9.4
Message-Id: <PlanetDebian-5150@acme.com>
X-F2IStatus: Updated
Subject: Petter Reinholdtsen: How to find a browser plugin supporting a given MIME type
Content-Type: multipart/alternative; boundary="=-1358520190-304430-5848-6847-3-="
MIME-Version: 1.0
Status: RO
Content-Length: 5686
Lines: 154


--=-1358520190-304430-5848-6847-3-=
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

<http://people.skolelinux.org/pere/blog/How_to_find_a_browser_plugin_supporting_a_given_MIME_type.html>

Some times I try to figure out which Iceweasel browser plugin to install 
to get support for a given MIME type. Thanks to specifications done by 
Ubuntu[1] and Mozilla, it is possible to do this in Debian. 
Unfortunately, not very many packages provide the needed meta 
information, Anyway, here is a small script to look up all browser 
plugin packages announcing ther MIME support using this specification:

#!/usr/bin/python
import sys
import apt
def pkgs_handling_mimetype(mimetype):
cache = apt.Cache()
cache.open(None)
thepkgs = []
for pkg in cache:
version = pkg.candidate
if version is None:
version = pkg.installed
if version is None:
continue
record = version.record
if not record.has_key('Npp-MimeType'):
continue
mime_types = record['Npp-MimeType'].split(',')
for t in mime_types:
t = t.rstrip().strip()
if t == mimetype:
thepkgs.append(pkg.name)
return thepkgs
mimetype = "audio/ogg"
if 1 < len(sys.argv):
mimetype = sys.argv[1]
print "Browser plugin packages supporting %s:" % mimetype
for pkg in pkgs_handling_mimetype(mimetype):
print " %s" %pkg

It can be used like this to look up a given MIME type:

% ./apt-find-browserplug-for-mimetype
Browser plugin packages supporting audio/ogg:
gecko-mediaplayer
% ./apt-find-browserplug-for-mimetype application/x-shockwave-flash
Browser plugin packages supporting application/x-shockwave-flash:
browser-plugin-gnash
%

In Ubuntu this mechanism is combined with support in the browser itself 
to query for plugins and propose to install the needed packages. It 
would be great if Debian supported such feature too. Is anyone working 
on adding it?

*Update 2013-01-18 14:20*: The Debian BTS request for icweasel support 
for this feature is #484010[2] from 2008 (and #698426[3] from today). 
Lack of manpower and wish for a different design is the reason thus 
feature is not yet in iceweasel from Debian.

[1] https://wiki.ubuntu.com/MozillaTeam/Plugins
[2] http://bugs.debian.org/484010
[3] http://bugs.debian.org/698426
-- 
Feed: Planet Debian
<http://planet.debian.org/>
Item: Petter Reinholdtsen: How to find a browser plugin supporting a given MIME type
<http://people.skolelinux.org/pere/blog/How_to_find_a_browser_plugin_supporting_a_given_MIME_type.html>
Date: Thu Jan 17 23:40:00 -1000 2013

--=-1358520190-304430-5848-6847-3-=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<table border="1" width="100%" cellpadding="0" cellspacing="0" borderspacing="0"><tr><td>
<table width="100%" bgcolor="#EDEDED" cellpadding="4" cellspacing="2">
<tr><td align="right"><b>Feed:</b></td>
<td width="100%"><a href="http://planet.debian.org/">
<b>Planet Debian</b>
</a>
</td></tr><tr><td align="right"><b>Item:</b></td>
<td width="100%"><a href="http://people.skolelinux.org/pere/blog/How_to_find_a_browser_plugin_supporting_a_given_MIME_type.html"><b>Petter Reinholdtsen: How to find a browser plugin supporting a given MIME type</b>
</a>
</td></tr></table></td></tr></table>

<p>Some times I try to figure out which Iceweasel browser plugin to
install to get support for a given MIME type.  Thanks to
<a href="https://wiki.ubuntu.com/MozillaTeam/Plugins">specifications
done by Ubuntu</a> and Mozilla, it is possible to do this in Debian.
Unfortunately, not very many packages provide the needed meta
information, Anyway, here is a small script to look up all browser
plugin packages announcing ther MIME support using this specification:</p>

<pre>#!/usr/bin/python
import sys
import apt
def pkgs_handling_mimetype(mimetype):
    cache = apt.Cache()
    cache.open(None)
    thepkgs = []
    for pkg in cache:
        version = pkg.candidate
        if version is None:
            version = pkg.installed
        if version is None:
            continue
        record = version.record
        if not record.has_key('Npp-MimeType'):
            continue
        mime_types = record['Npp-MimeType'].split(',')
        for t in mime_types:
            t = t.rstrip().strip()
            if t == mimetype:
                thepkgs.append(pkg.name)
    return thepkgs
mimetype = "audio/ogg"
if 1 &lt; len(sys.argv):
    mimetype = sys.argv[1]
print "Browser plugin packages supporting %s:" % mimetype
for pkg in pkgs_handling_mimetype(mimetype):
    print "  %s" %pkg
</pre>

<p>It can be used like this to look up a given MIME type:</p>

<pre>% ./apt-find-browserplug-for-mimetype 
Browser plugin packages supporting audio/ogg:
  gecko-mediaplayer
% ./apt-find-browserplug-for-mimetype application/x-shockwave-flash
Browser plugin packages supporting application/x-shockwave-flash:
  browser-plugin-gnash
%
</pre>

<p>In Ubuntu this mechanism is combined with support in the browser
itself to query for plugins and propose to install the needed
packages.  It would be great if Debian supported such feature too.  Is
anyone working on adding it?</p>

<p><strong>Update 2013-01-18 14:20</strong>: The Debian BTS
request for icweasel support for this feature is
<a href="http://bugs.debian.org/484010">#484010</a> from 2008 (and
<a href="http://bugs.debian.org/698426">#698426</a> from today).  Lack
of manpower and wish for a different design is the reason thus feature
is not yet in iceweasel from Debian.</p>
<hr width="100%"/>
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td align="right"><font color="#ababab">Date:</font>&nbsp;&nbsp;</td><td><font color="#ababab">Thu Jan 17 23:40:00 -1000 2013</font></td></tr>
</table>

--=-1358520190-304430-5848-6847-3-=--

