From: Robo Date: Thu, 26 Mar 2015 22:44:01 +0000 (+0530) Subject: npapi: warn users loading npapi plugins on unsupported platform X-Git-Tag: v0.22.3~19^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=c677a4468855013527c668788b294e5f3468090a;p=electron.git npapi: warn users loading npapi plugins on unsupported platform --- diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index b01c9a4d..7520ac2d 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -458,9 +458,14 @@ void NativeWindow::OverrideWebkitPrefs(const GURL& url, prefs->experimental_webgl_enabled = b; if (web_preferences_.Get("webaudio", &b)) prefs->webaudio_enabled = b; - if (web_preferences_.Get("extra-plugin-dirs", &list)) { + + auto isSupported = content::PluginService::GetInstance() + ->NPAPIPluginsSupported(); + if (web_preferences_.Get("extra-plugin-dirs", &list) && isSupported) { for (size_t i = 0; i < list.size(); ++i) content::PluginService::GetInstance()->AddExtraPluginDir(list[i]); + } else { + LOG(WARNING) << "NPAPI plugins not supported on this platform"; } }