diff --git a/modules/plugin/base/src/nsPluginHostImpl.cpp b/modules/plugin/base/src/nsPluginHostImpl.cpp index 0c73da6ca56..c6d8bc25a04 100644 --- a/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -1697,10 +1697,17 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType, // couldn't create an XPCOM plugin, try to create wrapper for a legacy plugin if (NS_FAILED(result)) { result = GetPluginFactory(mimetype, &plugin); - if(!NS_FAILED(result)){ - result = plugin->CreateInstance(NULL, kIPluginInstanceIID, (void **)&instance); + + if(!NS_FAILED(result)) + { + result = plugin->CreatePluginInstance(NULL, kIPluginInstanceIID,aMimeType, (void **)&instance); + + if (NS_FAILED(result)) + result = plugin->CreateInstance(NULL, kIPluginInstanceIID, (void**)&instance); + NS_RELEASE(plugin); } + if (NS_FAILED(result)) { NS_WITH_SERVICE(nsIPlugin, plugin, "component://netscape/blackwood/pluglet-engine",&result); if (NS_SUCCEEDED(result)) { diff --git a/modules/plugin/nglsrc/nsPluginHostImpl.cpp b/modules/plugin/nglsrc/nsPluginHostImpl.cpp index 0c73da6ca56..c6d8bc25a04 100644 --- a/modules/plugin/nglsrc/nsPluginHostImpl.cpp +++ b/modules/plugin/nglsrc/nsPluginHostImpl.cpp @@ -1697,10 +1697,17 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType, // couldn't create an XPCOM plugin, try to create wrapper for a legacy plugin if (NS_FAILED(result)) { result = GetPluginFactory(mimetype, &plugin); - if(!NS_FAILED(result)){ - result = plugin->CreateInstance(NULL, kIPluginInstanceIID, (void **)&instance); + + if(!NS_FAILED(result)) + { + result = plugin->CreatePluginInstance(NULL, kIPluginInstanceIID,aMimeType, (void **)&instance); + + if (NS_FAILED(result)) + result = plugin->CreateInstance(NULL, kIPluginInstanceIID, (void**)&instance); + NS_RELEASE(plugin); } + if (NS_FAILED(result)) { NS_WITH_SERVICE(nsIPlugin, plugin, "component://netscape/blackwood/pluglet-engine",&result); if (NS_SUCCEEDED(result)) {