Description: Ensure that new plugins are reloaded Author: Alexander Sack Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=460917 Forwarded: https://bugzilla.mozilla.org/attachment.cgi?id=350845 --- browser/base/content/browser.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -6780,7 +6780,11 @@ var gPluginHandler = { if (notification) notificationBox.removeNotification(notification); - // reload the browser to make the new plugin show. + // reload plugins + var pm = Components.classes["@mozilla.org/plugin/manager;1"] + .getService(Components.interfaces.nsIPluginManager); + pm.reloadPlugins(false); + // ... and reload the browser to activate new plugins available browser.reload(); }, @@ -6791,9 +6795,17 @@ var gPluginHandler = { var pluginInfo = getPluginInfo(plugin); missingPluginsArray[pluginInfo.mimetype] = pluginInfo; + gBrowser.selectedBrowser.addEventListener("NewPluginInstalled", + gPluginHandler.newPluginInstalled, + false); + openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul", "PFSWindow", "chrome,centerscreen,resizable=yes", {plugins: missingPluginsArray, browser: gBrowser.selectedBrowser}); + + gBrowser.selectedBrowser.removeEventListener("NewPluginInstalled", + gPluginHandler.newPluginInstalled, + false); }, // Callback for user clicking on a disabled plugin @@ -6855,11 +6867,17 @@ var gPluginHandler = { function showPluginsMissing() { // get the urls of missing plugins var missingPluginsArray = gBrowser.selectedBrowser.missingPlugins; + gBrowser.selectedBrowser.addEventListener("NewPluginInstalled", + gPluginHandler.newPluginInstalled, + false); if (missingPluginsArray) { openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul", "PFSWindow", "chrome,centerscreen,resizable=yes", {plugins: missingPluginsArray, browser: gBrowser.selectedBrowser}); } + gBrowser.selectedBrowser.removeEventListener("NewPluginInstalled", + gPluginHandler.newPluginInstalled, + false); } #ifdef XP_MACOSX