Пример #1
0
// Disables majority of toggleable settings.
func (s *Settings) DisableToggleableSettings() {
	C.webkit_settings_set_auto_load_images(s.settings, gboolean(false))
	C.webkit_settings_set_enable_frame_flattening(s.settings, gboolean(false))
	C.webkit_settings_set_enable_html5_database(s.settings, gboolean(false))
	C.webkit_settings_set_enable_html5_local_storage(s.settings, gboolean(false))
	C.webkit_settings_set_enable_hyperlink_auditing(s.settings, gboolean(false))
	C.webkit_settings_set_enable_java(s.settings, gboolean(false))
	C.webkit_settings_set_enable_javascript(s.settings, gboolean(false))
	C.webkit_settings_set_enable_offline_web_application_cache(s.settings, gboolean(false))
	C.webkit_settings_set_enable_plugins(s.settings, gboolean(false))
	C.webkit_settings_set_enable_xss_auditor(s.settings, gboolean(false))
	C.webkit_settings_set_javascript_can_open_windows_automatically(s.settings, gboolean(false))
	C.webkit_settings_set_enable_private_browsing(s.settings, gboolean(false))
	C.webkit_settings_set_enable_developer_extras(s.settings, gboolean(false))
	C.webkit_settings_set_enable_resizable_text_areas(s.settings, gboolean(false))
	C.webkit_settings_set_enable_tabs_to_links(s.settings, gboolean(false))
	C.webkit_settings_set_enable_dns_prefetching(s.settings, gboolean(false))
	C.webkit_settings_set_enable_caret_browsing(s.settings, gboolean(false))
	C.webkit_settings_set_enable_fullscreen(s.settings, gboolean(false))
	C.webkit_settings_set_print_backgrounds(s.settings, gboolean(false))
	C.webkit_settings_set_enable_webaudio(s.settings, gboolean(false))
	C.webkit_settings_set_enable_webgl(s.settings, gboolean(false))
	C.webkit_settings_set_allow_modal_dialogs(s.settings, gboolean(false))
	C.webkit_settings_set_javascript_can_access_clipboard(s.settings, gboolean(false))
	C.webkit_settings_set_enable_page_cache(s.settings, gboolean(false))
	C.webkit_settings_set_enable_smooth_scrolling(s.settings, gboolean(false))
	C.webkit_settings_set_enable_accelerated_2d_canvas(s.settings, gboolean(false))
	C.webkit_settings_set_enable_media_stream(s.settings, gboolean(false))
	C.webkit_settings_set_enable_spatial_navigation(s.settings, gboolean(false))
	C.webkit_settings_set_enable_mediasource(s.settings, gboolean(false))
}
Пример #2
0
// SetEnableWebgl sets the "enable-webgl" property.
//
// See also: webkit_settings_set_enable_webgl at
// http://webkitgtk.org/reference/webkit2gtk/unstable/WebKitSettings.html#webkit-settings-set-enable-webgl
func (s *Settings) SetEnableWebgl(enabled bool) {
	C.webkit_settings_set_enable_webgl(s.settings, gboolean(enabled))
}