From: Cheng Zhao Date: Fri, 27 Mar 2015 08:29:14 +0000 (+0800) Subject: Improve #1317 X-Git-Tag: v0.22.3~18 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=21a09d3ae862d5234597c2373c0fbf842a453993;p=electron.git Improve #1317 --- diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index d1bf51d3..7d54af02 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -459,14 +459,13 @@ void NativeWindow::OverrideWebkitPrefs(const GURL& url, prefs->experimental_webgl_enabled = b; if (web_preferences_.Get("webaudio", &b)) prefs->webaudio_enabled = b; - - 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"; + if (web_preferences_.Get("extra-plugin-dirs", &list)) { + if (content::PluginService::GetInstance()->NPAPIPluginsSupported()) { + 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"; + } } }