Set our WebKit preferences.

This commit is contained in:
Cheng Zhao 2013-04-12 20:48:02 +08:00
parent 26d6df7852
commit 44b3aa6a2f
2 changed files with 29 additions and 0 deletions

View file

@ -5,6 +5,7 @@
#include "browser/atom_browser_client.h"
#include "browser/atom_browser_main_parts.h"
#include "webkit/glue/webpreferences.h"
namespace atom {
@ -14,6 +15,29 @@ AtomBrowserClient::AtomBrowserClient() {
AtomBrowserClient::~AtomBrowserClient() {
}
void AtomBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* render_view_host,
const GURL& url,
webkit_glue::WebPreferences* prefs) {
prefs->javascript_enabled = true;
prefs->web_security_enabled = false;
prefs->javascript_can_open_windows_automatically = true;
prefs->plugins_enabled = false;
prefs->dom_paste_enabled = true;
prefs->java_enabled = false;
prefs->allow_scripts_to_close_windows = true;
prefs->uses_page_cache = false;
prefs->javascript_can_access_clipboard = true;
prefs->local_storage_enabled = true;
prefs->databases_enabled = true;
prefs->application_cache_enabled = true;
prefs->allow_universal_access_from_file_urls = true;
prefs->allow_file_access_from_file_urls = true;
prefs->experimental_webgl_enabled = false;
prefs->allow_running_insecure_content = true;
prefs->enable_scroll_animator = false;
}
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
const content::MainFunctionParams&) {
return new AtomBrowserMainParts;

View file

@ -14,6 +14,11 @@ public:
AtomBrowserClient();
~AtomBrowserClient();
protected:
virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
const GURL& url,
webkit_glue::WebPreferences* prefs) OVERRIDE;
private:
virtual brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
const content::MainFunctionParams&) OVERRIDE;