After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 401079 - Enable/disable mime-types/plugins using config files
Enable/disable mime-types/plugins using config files
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Browser plugin (obsolete)
unspecified
Other Linux
: Normal normal
: ---
Assigned To: totem-browser-maint
totem-browser-maint
Depends on:
Blocks:
 
 
Reported: 2007-01-26 17:56 UTC by Bastien Nocera
Modified: 2007-05-14 13:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
totem-disable-plugins.patch (2.78 KB, patch)
2007-04-16 17:28 UTC, Bastien Nocera
none Details | Review
totem-disable-plugins.patch (3.88 KB, patch)
2007-04-16 17:54 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2007-01-26 17:56:23 UTC
See:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216280#c11

We should be able (like QuickTime allows on Windows/MacOS X) to disable certain plugins or mime-types using GConf, so that even though installed, plugins can be disabled.

An example is the "Complex" plugin taking over a Real/Helix plugin installed. We should be able to disable the Complex plugin, or certain mime-types it allows.

This might mean that the proper plugins would have to use GConf. Any other ways to do this without adding deps to the plugin?
Comment 1 Christian Persch 2007-01-31 14:16:23 UTC
I'm not sure adding a gconf dependency is the right thing here...

Maybe using the gecko prefs system? Or a conf-file somewhere in ~/.config ?
Comment 2 Bastien Nocera 2007-01-31 15:03:56 UTC
(In reply to comment #1)
> I'm not sure adding a gconf dependency is the right thing here...
> 
> Maybe using the gecko prefs system? Or a conf-file somewhere in ~/.config ?

The point is having admins be able to disable it system-wide. Config files don't have that ability... Maybe we could call a small helper that would depend on GConf itself?
Comment 3 Bastien Nocera 2007-04-16 09:51:08 UTC
We'd need to disable it at the Mozilla level, as otherwise the pluginreg.dat won't be updated, and the mime-type will still be registered.

I still can't find how to disable a specific mime-type programmatically in a plugin.
Comment 4 Bastien Nocera 2007-04-16 10:29:22 UTC
The solution might be in nsPluginHostImpl.h, where we'd use UnMark(NS_PLUGIN_FLAG_ENABLED) on the PluginTag.
Comment 5 Christian Persch 2007-04-16 11:54:12 UTC
I don't have the bug ref handy right now, but there are bug(s) filed on b.m.o about that mime type caching.
Comment 6 Bastien Nocera 2007-04-16 17:28:46 UTC
Created attachment 86442 [details] [review]
totem-disable-plugins.patch

Disable the plugins based on a couple of key files.

---8<---
[Plugins]
audio/mpeg.disabled=true
video/mpeg.disabled=false
---8<---

In the system-wide .ini file (/etc/totem/browser-plugins.ini), explicitely mentioned plugins will be forcibly disabled/enabled for all users. The user can then disable specific plugins by using the same syntax in ~/.gnome2/Totem/browser-plugins.ini.
Comment 7 Bastien Nocera 2007-04-16 17:30:15 UTC
I forgot to mention that you'd need to remove your browser's pluginreg.dat for this to work...
Comment 8 Bastien Nocera 2007-04-16 17:49:58 UTC
Comment on attachment 86442 [details] [review]
totem-disable-plugins.patch

>Index: totemPluginGlue.cpp
<snip>
>+					  "browser-plugins.ini"

And there's a comma missing here.
Comment 9 Bastien Nocera 2007-04-16 17:54:49 UTC
Created attachment 86444 [details] [review]
totem-disable-plugins.patch

Fixes build
Comment 10 Bastien Nocera 2007-05-14 13:32:56 UTC
2007-05-14  Bastien Nocera  <hadess@hadess.net>

        * README: upd
        * browser-plugin/Makefile.am:
        * browser-plugin/README: move to...
        * browser-plugin/README.browser-plugin: ...this file,
        and add details on how to disable specific mime-types
        * browser-plugin/totemPluginGlue.cpp:
        Allow to disable specific mime-types, using a .ini style
        file, as documented in README.browser-plugin
        (Closes: #401079)