]> khamidou — GitHub mirrors - electron.git/commitdiff
npapi: warn users loading npapi plugins on unsupported platform
authorRobo <hop2deep@gmail.com>
Thu, 26 Mar 2015 22:44:01 +0000 (04:14 +0530)
committerRobo <hop2deep@gmail.com>
Thu, 26 Mar 2015 22:44:01 +0000 (04:14 +0530)
atom/browser/native_window.cc

index b01c9a4d4ed1a42183753c56049c6bb40e6f2d2a..7520ac2dd888968762c8d7ca85a53d4842e93d34 100644 (file)
@@ -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";
   }
 }