Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
MozillaFirefox.3724
mozilla-prefer_plugin_pref.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mozilla-prefer_plugin_pref.patch of Package MozillaFirefox.3724
From: Ubuntu Subject: introduce a pref to prefer certain plugins for mime-types diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -1275,17 +1275,51 @@ nsPluginHost::FindNativePluginForType(co if (aMimeType.IsEmpty()) { return nullptr; } LoadPlugins(); InfallibleTArray<nsPluginTag*> matchingPlugins; + char *preferredPluginPath = nullptr; + nsAutoCString mimetypePrefString ("modules.plugins.mimetype."); + mimetypePrefString.Append(aMimeType); + const char *mimetypePrefChar = mimetypePrefString.get(); + nsAdoptingCString pluginPath = Preferences::GetCString(mimetypePrefChar); + preferredPluginPath = (char*) pluginPath.get(); + nsPluginTag *plugin = mPlugins; + + if(preferredPluginPath) { + while (plugin) { + if (!aCheckEnabled || plugin->IsEnabled()) { + if (0 == PL_strcasecmp(plugin->FileName().get(), preferredPluginPath) || + 0 == PL_strcasecmp(plugin->mFullPath.get(), preferredPluginPath)) { + matchingPlugins.AppendElement(plugin); + } + } + plugin = plugin->mNext; + } + + // now lets search for substrings + plugin = mPlugins; + while (plugin) { + if (!aCheckEnabled || plugin->IsEnabled()) { + if (nullptr != PL_strstr(plugin->FileName().get(), preferredPluginPath) || + nullptr != PL_strstr(plugin->mFullPath.get(), preferredPluginPath)) { + matchingPlugins.AppendElement(plugin); + } + } + plugin = plugin->mNext; + } + + return FindPreferredPlugin(matchingPlugins); + } + while (plugin) { if ((!aCheckEnabled || plugin->IsActive()) && plugin->HasMimeType(aMimeType)) { matchingPlugins.AppendElement(plugin); } plugin = plugin->mNext; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor