Bug 844533 - Add a pref which controls whether we load plugins from the root appdir, default to off, r=glandium

This commit is contained in:
Benjamin Smedberg 2013-03-05 09:45:28 -05:00
parent 9bbbc377b8
commit 9972ba828c
2 changed files with 12 additions and 1 deletions

View File

@ -1784,6 +1784,7 @@ pref("dom.archivereader.enabled", false);
// resolved.
pref("hangmonitor.timeout", 0);
pref("plugins.load_appdir_plugins", false);
// If true, plugins will be click to play
pref("plugins.click_to_play", false);

View File

@ -719,9 +719,19 @@ nsXREDirProvider::GetFilesInternal(const char* aProperty,
rv = NS_NewArrayEnumerator(aResult, directories);
}
else if (!strcmp(aProperty, NS_APP_PLUGINS_DIR_LIST)) {
static const char *const kAppendPlugins[] = { "plugins", nullptr };
nsCOMArray<nsIFile> directories;
if (mozilla::Preferences::GetBool("plugins.load_appdir_plugins", false)) {
nsCOMPtr<nsIFile> appdir;
rv = XRE_GetBinaryPath(gArgv[0], getter_AddRefs(appdir));
if (NS_SUCCEEDED(rv)) {
appdir->SetNativeLeafName(NS_LITERAL_CSTRING("plugins"));
directories.AppendObject(appdir);
}
}
static const char *const kAppendPlugins[] = { "plugins", nullptr };
// The root dirserviceprovider does quite a bit for us: we're mainly
// interested in xulapp and extension-provided plugins.
LoadDirsIntoArray(mAppBundleDirectories,