2 * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
3 * Copyright (C) 2008 Nuanti Ltd.
4 * Copyright (C) 2008 Collabora Ltd.
5 * Copyright (C) 2008 Holger Hans Peter Freyther
6 * Copyright (C) 2009 Jan Michael Alonzo
7 * Copyright (C) 2009 Movial Creative Technologies Inc.
8 * Copyright (C) 2009 Igalia S.L.
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
20 * You should have received a copy of the GNU Library General Public License
21 * along with this library; see the file COPYING.LIB. If not, write to
22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
27 #include "webkitwebsettings.h"
29 #include "EditingBehavior.h"
30 #include "FileSystem.h"
32 #include "PluginDatabase.h"
33 #include "webkitenumtypes.h"
34 #include "webkitglobalsprivate.h"
35 #include "webkitversion.h"
36 #include "webkitwebsettingsprivate.h"
38 #include <wtf/text/CString.h>
39 #include <wtf/text/StringConcatenate.h>
40 #include <glib/gi18n-lib.h>
43 #include <sys/utsname.h>
47 * SECTION:webkitwebsettings
48 * @short_description: Control the behaviour of a #WebKitWebView
50 * #WebKitWebSettings can be applied to a #WebKitWebView to control text encoding,
51 * color, font sizes, printing mode, script support, loading of images and various other things.
52 * After creation, a #WebKitWebSettings object contains default settings.
54 * <informalexample><programlisting>
55 * /<!-- -->* Create a new websettings and disable java script *<!-- -->/
56 * WebKitWebSettings *settings = webkit_web_settings_new ();
57 * g_object_set (G_OBJECT(settings), "enable-scripts", FALSE, NULL);
59 * /<!-- -->* Apply the result *<!-- -->/
60 * webkit_web_view_set_settings (WEBKIT_WEB_VIEW(my_webview), settings);
61 * </programlisting></informalexample>
64 using namespace WebCore;
66 G_DEFINE_TYPE(WebKitWebSettings, webkit_web_settings, G_TYPE_OBJECT)
68 struct _WebKitWebSettingsPrivate {
69 gchar* default_encoding;
70 gchar* cursive_font_family;
71 gchar* default_font_family;
72 gchar* fantasy_font_family;
73 gchar* monospace_font_family;
74 gchar* sans_serif_font_family;
75 gchar* serif_font_family;
76 guint default_font_size;
77 guint default_monospace_font_size;
78 guint minimum_font_size;
79 guint minimum_logical_font_size;
80 gboolean enforce_96_dpi;
81 gboolean auto_load_images;
82 gboolean auto_shrink_images;
83 gboolean print_backgrounds;
84 gboolean enable_scripts;
85 gboolean enable_plugins;
86 gboolean resizable_text_areas;
87 gchar* user_stylesheet_uri;
89 gboolean enable_developer_extras;
90 gboolean enable_private_browsing;
91 gboolean enable_spell_checking;
92 gchar* spell_checking_languages;
93 GSList* enchant_dicts;
94 gboolean enable_caret_browsing;
95 gboolean enable_html5_database;
96 gboolean enable_html5_local_storage;
97 gboolean enable_xss_auditor;
98 gboolean enable_spatial_navigation;
99 gboolean enable_frame_flattening;
101 gboolean javascript_can_open_windows_automatically;
102 gboolean javascript_can_access_clipboard;
103 gboolean enable_offline_web_application_cache;
104 WebKitEditingBehavior editing_behavior;
105 gboolean enable_universal_access_from_file_uris;
106 gboolean enable_file_access_from_file_uris;
107 gboolean enable_dom_paste;
108 gboolean tab_key_cycles_through_elements;
109 gboolean enable_default_context_menu;
110 gboolean enable_site_specific_quirks;
111 gboolean enable_page_cache;
112 gboolean auto_resize_window;
113 gboolean enable_java_applet;
114 gboolean enable_hyperlink_auditing;
115 gboolean enable_fullscreen;
118 #define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))
123 PROP_DEFAULT_ENCODING,
124 PROP_CURSIVE_FONT_FAMILY,
125 PROP_DEFAULT_FONT_FAMILY,
126 PROP_FANTASY_FONT_FAMILY,
127 PROP_MONOSPACE_FONT_FAMILY,
128 PROP_SANS_SERIF_FONT_FAMILY,
129 PROP_SERIF_FONT_FAMILY,
130 PROP_DEFAULT_FONT_SIZE,
131 PROP_DEFAULT_MONOSPACE_FONT_SIZE,
132 PROP_MINIMUM_FONT_SIZE,
133 PROP_MINIMUM_LOGICAL_FONT_SIZE,
135 PROP_AUTO_LOAD_IMAGES,
136 PROP_AUTO_SHRINK_IMAGES,
137 PROP_PRINT_BACKGROUNDS,
140 PROP_RESIZABLE_TEXT_AREAS,
141 PROP_USER_STYLESHEET_URI,
143 PROP_ENABLE_DEVELOPER_EXTRAS,
144 PROP_ENABLE_PRIVATE_BROWSING,
145 PROP_ENABLE_SPELL_CHECKING,
146 PROP_SPELL_CHECKING_LANGUAGES,
147 PROP_ENABLE_CARET_BROWSING,
148 PROP_ENABLE_HTML5_DATABASE,
149 PROP_ENABLE_HTML5_LOCAL_STORAGE,
150 PROP_ENABLE_XSS_AUDITOR,
151 PROP_ENABLE_SPATIAL_NAVIGATION,
152 PROP_ENABLE_FRAME_FLATTENING,
154 PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY,
155 PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD,
156 PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
157 PROP_EDITING_BEHAVIOR,
158 PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS,
159 PROP_ENABLE_FILE_ACCESS_FROM_FILE_URIS,
160 PROP_ENABLE_DOM_PASTE,
161 PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS,
162 PROP_ENABLE_DEFAULT_CONTEXT_MENU,
163 PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
164 PROP_ENABLE_PAGE_CACHE,
165 PROP_AUTO_RESIZE_WINDOW,
166 PROP_ENABLE_JAVA_APPLET,
167 PROP_ENABLE_HYPERLINK_AUDITING,
168 PROP_ENABLE_FULLSCREEN
171 // Create a default user agent string
172 // This is a liberal interpretation of http://www.mozilla.org/build/revised-user-agent-strings.html
173 // See also http://developer.apple.com/internet/safari/faq.html#anchor2
174 static String webkitPlatform()
177 DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("X11")));
179 DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Windows")));
181 DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Macintosh")));
182 #elif defined(GDK_WINDOWING_DIRECTFB)
183 DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("DirectFB")));
185 DEFINE_STATIC_LOCAL(const String, uaPlatform, (String("Unknown")));
191 static String webkitOSVersion()
193 // FIXME: platform/version detection can be shared.
197 DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("Intel Mac OS X")));
199 DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("PPC Mac OS X")));
203 DEFINE_STATIC_LOCAL(String, uaOSVersion, (String()));
205 if (!uaOSVersion.isEmpty())
209 if (uname(&name) != -1)
210 uaOSVersion = makeString(name.sysname, ' ', name.machine);
212 uaOSVersion = String("Unknown");
214 DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("Windows")));
216 DEFINE_STATIC_LOCAL(const String, uaOSVersion, (String("Unknown")));
222 String webkitUserAgent()
224 // We mention Safari since many broken sites check for it (OmniWeb does this too)
225 // We re-use the WebKit version, though it doesn't seem to matter much in practice
227 DEFINE_STATIC_LOCAL(const String, uaVersion, (makeString(String::number(WEBKIT_USER_AGENT_MAJOR_VERSION), '.', String::number(WEBKIT_USER_AGENT_MINOR_VERSION), '+')));
228 DEFINE_STATIC_LOCAL(const String, staticUA, (makeString("Mozilla/5.0 (", webkitPlatform(), "; U; ", webkitOSVersion(), "; ", defaultLanguage(), ") AppleWebKit/", uaVersion) +
229 makeString(" (KHTML, like Gecko) Version/5.0 Safari/", uaVersion)));
234 static void webkit_web_settings_finalize(GObject* object);
236 static void webkit_web_settings_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec);
238 static void webkit_web_settings_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec);
240 static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
242 GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
243 gobject_class->finalize = webkit_web_settings_finalize;
244 gobject_class->set_property = webkit_web_settings_set_property;
245 gobject_class->get_property = webkit_web_settings_get_property;
249 GParamFlags flags = (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT);
251 g_object_class_install_property(gobject_class,
252 PROP_DEFAULT_ENCODING,
255 _("Default Encoding"),
256 _("The default encoding used to display text."),
260 g_object_class_install_property(gobject_class,
261 PROP_CURSIVE_FONT_FAMILY,
263 "cursive-font-family",
264 _("Cursive Font Family"),
265 _("The default Cursive font family used to display text."),
269 g_object_class_install_property(gobject_class,
270 PROP_DEFAULT_FONT_FAMILY,
272 "default-font-family",
273 _("Default Font Family"),
274 _("The default font family used to display text."),
278 g_object_class_install_property(gobject_class,
279 PROP_FANTASY_FONT_FAMILY,
281 "fantasy-font-family",
282 _("Fantasy Font Family"),
283 _("The default Fantasy font family used to display text."),
287 g_object_class_install_property(gobject_class,
288 PROP_MONOSPACE_FONT_FAMILY,
290 "monospace-font-family",
291 _("Monospace Font Family"),
292 _("The default font family used to display monospace text."),
296 g_object_class_install_property(gobject_class,
297 PROP_SANS_SERIF_FONT_FAMILY,
299 "sans-serif-font-family",
300 _("Sans Serif Font Family"),
301 _("The default Sans Serif font family used to display text."),
305 g_object_class_install_property(gobject_class,
306 PROP_SERIF_FONT_FAMILY,
309 _("Serif Font Family"),
310 _("The default Serif font family used to display text."),
314 g_object_class_install_property(gobject_class,
315 PROP_DEFAULT_FONT_SIZE,
318 _("Default Font Size"),
319 _("The default font size used to display text."),
323 g_object_class_install_property(gobject_class,
324 PROP_DEFAULT_MONOSPACE_FONT_SIZE,
326 "default-monospace-font-size",
327 _("Default Monospace Font Size"),
328 _("The default font size used to display monospace text."),
332 g_object_class_install_property(gobject_class,
333 PROP_MINIMUM_FONT_SIZE,
336 _("Minimum Font Size"),
337 _("The minimum font size used to display text."),
341 g_object_class_install_property(gobject_class,
342 PROP_MINIMUM_LOGICAL_FONT_SIZE,
344 "minimum-logical-font-size",
345 _("Minimum Logical Font Size"),
346 _("The minimum logical font size used to display text."),
351 * WebKitWebSettings:enforce-96-dpi:
353 * Enforce a resolution of 96 DPI. This is meant for compatibility
354 * with web pages which cope badly with different screen resolutions
355 * and for automated testing.
356 * Web browsers and applications that typically display arbitrary
357 * content from the web should provide a preference for this.
361 g_object_class_install_property(gobject_class,
363 g_param_spec_boolean(
366 _("Enforce a resolution of 96 DPI"),
370 g_object_class_install_property(gobject_class,
371 PROP_AUTO_LOAD_IMAGES,
372 g_param_spec_boolean(
374 _("Auto Load Images"),
375 _("Load images automatically."),
379 g_object_class_install_property(gobject_class,
380 PROP_AUTO_SHRINK_IMAGES,
381 g_param_spec_boolean(
382 "auto-shrink-images",
383 _("Auto Shrink Images"),
384 _("Automatically shrink standalone images to fit."),
388 g_object_class_install_property(gobject_class,
389 PROP_PRINT_BACKGROUNDS,
390 g_param_spec_boolean(
392 _("Print Backgrounds"),
393 _("Whether background images should be printed."),
397 g_object_class_install_property(gobject_class,
399 g_param_spec_boolean(
402 _("Enable embedded scripting languages."),
406 g_object_class_install_property(gobject_class,
408 g_param_spec_boolean(
411 _("Enable embedded plugin objects."),
415 g_object_class_install_property(gobject_class,
416 PROP_RESIZABLE_TEXT_AREAS,
417 g_param_spec_boolean(
418 "resizable-text-areas",
419 _("Resizable Text Areas"),
420 _("Whether text areas are resizable."),
424 g_object_class_install_property(gobject_class,
425 PROP_USER_STYLESHEET_URI,
426 g_param_spec_string("user-stylesheet-uri",
427 _("User Stylesheet URI"),
428 _("The URI of a stylesheet that is applied to every page."),
433 * WebKitWebSettings:zoom-step:
435 * The value by which the zoom level is changed when zooming in or out.
439 g_object_class_install_property(gobject_class,
443 _("Zoom Stepping Value"),
444 _("The value by which the zoom level is changed when zooming in or out."),
445 0.0f, G_MAXFLOAT, 0.1f,
449 * WebKitWebSettings:enable-developer-extras:
451 * Whether developer extensions should be enabled. This enables,
452 * for now, the Web Inspector, which can be controlled using the
453 * #WebKitWebInspector instance held by the #WebKitWebView this
454 * setting is enabled for.
458 g_object_class_install_property(gobject_class,
459 PROP_ENABLE_DEVELOPER_EXTRAS,
460 g_param_spec_boolean(
461 "enable-developer-extras",
462 _("Enable Developer Extras"),
463 _("Enables special extensions that help developers"),
468 * WebKitWebSettings:enable-private-browsing:
470 * Whether to enable private browsing mode. Private browsing mode prevents
471 * WebKit from updating the global history and storing any session
472 * information e.g., on-disk cache, as well as suppressing any messages
473 * from being printed into the (javascript) console.
475 * This is currently experimental for WebKitGtk.
479 g_object_class_install_property(gobject_class,
480 PROP_ENABLE_PRIVATE_BROWSING,
481 g_param_spec_boolean(
482 "enable-private-browsing",
483 _("Enable Private Browsing"),
484 _("Enables private browsing mode"),
489 * WebKitWebSettings:enable-spell-checking:
491 * Whether to enable spell checking while typing.
495 g_object_class_install_property(gobject_class,
496 PROP_ENABLE_SPELL_CHECKING,
497 g_param_spec_boolean(
498 "enable-spell-checking",
499 _("Enable Spell Checking"),
500 _("Enables spell checking while typing"),
505 * WebKitWebSettings:spell-checking-languages:
507 * The languages to be used for spell checking, separated by commas.
509 * The locale string typically is in the form lang_COUNTRY, where lang
510 * is an ISO-639 language code, and COUNTRY is an ISO-3166 country code.
511 * For instance, sv_FI for Swedish as written in Finland or pt_BR
512 * for Portuguese as written in Brazil.
514 * If no value is specified then the value returned by
515 * gtk_get_default_language will be used.
519 g_object_class_install_property(gobject_class,
520 PROP_SPELL_CHECKING_LANGUAGES,
522 "spell-checking-languages",
523 _("Languages to use for spell checking"),
524 _("Comma separated list of languages to use for spell checking"),
529 * WebKitWebSettings:enable-caret-browsing:
531 * Whether to enable caret browsing mode.
535 g_object_class_install_property(gobject_class,
536 PROP_ENABLE_CARET_BROWSING,
537 g_param_spec_boolean("enable-caret-browsing",
538 _("Enable Caret Browsing"),
539 _("Whether to enable accessibility enhanced keyboard navigation"),
543 * WebKitWebSettings:enable-html5-database:
545 * Whether to enable HTML5 client-side SQL database support. Client-side
546 * SQL database allows web pages to store structured data and be able to
547 * use SQL to manipulate that data asynchronously.
551 g_object_class_install_property(gobject_class,
552 PROP_ENABLE_HTML5_DATABASE,
553 g_param_spec_boolean("enable-html5-database",
554 _("Enable HTML5 Database"),
555 _("Whether to enable HTML5 database support"),
560 * WebKitWebSettings:enable-html5-local-storage:
562 * Whether to enable HTML5 localStorage support. localStorage provides
563 * simple synchronous storage access.
567 g_object_class_install_property(gobject_class,
568 PROP_ENABLE_HTML5_LOCAL_STORAGE,
569 g_param_spec_boolean("enable-html5-local-storage",
570 _("Enable HTML5 Local Storage"),
571 _("Whether to enable HTML5 Local Storage support"),
575 * WebKitWebSettings:enable-xss-auditor
577 * Whether to enable the XSS Auditor. This feature filters some kinds of
578 * reflective XSS attacks on vulnerable web sites.
582 g_object_class_install_property(gobject_class,
583 PROP_ENABLE_XSS_AUDITOR,
584 g_param_spec_boolean("enable-xss-auditor",
585 _("Enable XSS Auditor"),
586 _("Whether to enable the XSS auditor"),
590 * WebKitWebSettings:enable-spatial-navigation
592 * Whether to enable the Spatial Navigation. This feature consists in the ability
593 * to navigate between focusable elements in a Web page, such as hyperlinks and
594 * form controls, by using Left, Right, Up and Down arrow keys. For example, if
595 * an user presses the Right key, heuristics determine whether there is an element
596 * he might be trying to reach towards the right, and if there are multiple elements,
597 * which element he probably wants.
601 g_object_class_install_property(gobject_class,
602 PROP_ENABLE_SPATIAL_NAVIGATION,
603 g_param_spec_boolean("enable-spatial-navigation",
604 _("Enable Spatial Navigation"),
605 _("Whether to enable Spatial Navigation"),
609 * WebKitWebSettings:enable-frame-flattening
611 * Whether to enable the Frame Flattening. With this setting each subframe is expanded
612 * to its contents, which will flatten all the frames to become one scrollable page.
613 * On touch devices, it is desired to not have any scrollable sub parts of the page as
614 * it results in a confusing user experience, with scrolling sometimes scrolling sub parts
615 * and at other times scrolling the page itself. For this reason iframes and framesets are
616 * barely usable on touch devices.
620 g_object_class_install_property(gobject_class,
621 PROP_ENABLE_FRAME_FLATTENING,
622 g_param_spec_boolean("enable-frame-flattening",
623 _("Enable Frame Flattening"),
624 _("Whether to enable Frame Flattening"),
628 * WebKitWebSettings:user-agent:
630 * The User-Agent string used by WebKitGtk.
632 * This will return a default User-Agent string if a custom string wasn't
633 * provided by the application. Setting this property to a NULL value or
634 * an empty string will result in the User-Agent string being reset to the
639 g_object_class_install_property(gobject_class, PROP_USER_AGENT,
640 g_param_spec_string("user-agent",
642 _("The User-Agent string used by WebKitGtk"),
643 webkitUserAgent().utf8().data(),
647 * WebKitWebSettings:javascript-can-open-windows-automatically
649 * Whether JavaScript can open popup windows automatically without user
654 g_object_class_install_property(gobject_class,
655 PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY,
656 g_param_spec_boolean("javascript-can-open-windows-automatically",
657 _("JavaScript can open windows automatically"),
658 _("Whether JavaScript can open windows automatically"),
663 * WebKitWebSettings:javascript-can-access-clipboard
665 * Whether JavaScript can access Clipboard.
669 g_object_class_install_property(gobject_class,
670 PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD,
671 g_param_spec_boolean("javascript-can-access-clipboard",
672 _("JavaScript can access Clipboard"),
673 _("Whether JavaScript can access Clipboard"),
678 * WebKitWebSettings:enable-offline-web-application-cache
680 * Whether to enable HTML5 offline web application cache support. Offline
681 * Web Application Cache ensures web applications are available even when
682 * the user is not connected to the network.
686 g_object_class_install_property(gobject_class,
687 PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
688 g_param_spec_boolean("enable-offline-web-application-cache",
689 _("Enable offline web application cache"),
690 _("Whether to enable offline web application cache"),
696 * WebKitWebSettings:editing-behavior
698 * This setting controls various editing behaviors that differ
699 * between platforms and that have been combined in two groups,
700 * 'Mac' and 'Windows'. Some examples:
702 * 1) Clicking below the last line of an editable area puts the
703 * caret at the end of the last line on Mac, but in the middle of
704 * the last line on Windows.
706 * 2) Pushing down the arrow key on the last line puts the caret
707 * at the end of the last line on Mac, but does nothing on
708 * Windows. A similar case exists on the top line.
712 g_object_class_install_property(gobject_class,
713 PROP_EDITING_BEHAVIOR,
714 g_param_spec_enum("editing-behavior",
715 _("Editing behavior"),
716 _("The behavior mode to use in editing mode"),
717 WEBKIT_TYPE_EDITING_BEHAVIOR,
718 WEBKIT_EDITING_BEHAVIOR_UNIX,
722 * WebKitWebSettings:enable-universal-access-from-file-uris
724 * Whether to allow files loaded through file:// URIs universal access to
729 g_object_class_install_property(gobject_class,
730 PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS,
731 g_param_spec_boolean("enable-universal-access-from-file-uris",
732 _("Enable universal access from file URIs"),
733 _("Whether to allow universal access from file URIs"),
738 * WebKitWebSettings:enable-dom-paste
740 * Whether to enable DOM paste. If set to %TRUE, document.execCommand("Paste")
741 * will correctly execute and paste content of the clipboard.
745 g_object_class_install_property(gobject_class,
746 PROP_ENABLE_DOM_PASTE,
747 g_param_spec_boolean("enable-dom-paste",
748 _("Enable DOM paste"),
749 _("Whether to enable DOM paste"),
753 * WebKitWebSettings:tab-key-cycles-through-elements:
755 * Whether the tab key cycles through elements on the page.
757 * If @flag is %TRUE, pressing the tab key will focus the next element in
758 * the @web_view. If @flag is %FALSE, the @web_view will interpret tab
759 * key presses as normal key presses. If the selected element is editable, the
760 * tab key will cause the insertion of a tab character.
764 g_object_class_install_property(gobject_class,
765 PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS,
766 g_param_spec_boolean("tab-key-cycles-through-elements",
767 _("Tab key cycles through elements"),
768 _("Whether the tab key cycles through elements on the page."),
773 * WebKitWebSettings:enable-default-context-menu:
775 * Whether right-clicks should be handled automatically to create,
776 * and display the context menu. Turning this off will make
777 * WebKitGTK+ not emit the populate-popup signal. Notice that the
778 * default button press event handler may still handle right
779 * clicks for other reasons, such as in-page context menus, or
780 * right-clicks that are handled by the page itself.
784 g_object_class_install_property(gobject_class,
785 PROP_ENABLE_DEFAULT_CONTEXT_MENU,
786 g_param_spec_boolean(
787 "enable-default-context-menu",
788 _("Enable Default Context Menu"),
789 _("Enables the handling of right-clicks for the creation of the default context menu"),
794 * WebKitWebSettings::enable-site-specific-quirks
796 * Whether to turn on site-specific hacks. Turning this on will
797 * tell WebKitGTK+ to use some site-specific workarounds for
798 * better web compatibility. For example, older versions of
799 * MediaWiki will incorrectly send WebKit a css file with KHTML
800 * workarounds. By turning on site-specific quirks, WebKit will
801 * special-case this and other cases to make the sites work.
805 g_object_class_install_property(gobject_class,
806 PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
807 g_param_spec_boolean(
808 "enable-site-specific-quirks",
809 _("Enable Site Specific Quirks"),
810 _("Enables the site-specific compatibility workarounds"),
815 * WebKitWebSettings:enable-page-cache:
817 * Enable or disable the page cache. Disabling the page cache is
818 * generally only useful for special circumstances like low-memory
819 * scenarios or special purpose applications like static HTML
820 * viewers. This setting only controls the Page Cache, this cache
821 * is different than the disk-based or memory-based traditional
822 * resource caches, its point is to make going back and forth
823 * between pages much faster. For details about the different types
824 * of caches and their purposes see:
825 * http://webkit.org/blog/427/webkit-page-cache-i-the-basics/
829 g_object_class_install_property(gobject_class,
830 PROP_ENABLE_PAGE_CACHE,
831 g_param_spec_boolean("enable-page-cache",
832 _("Enable page cache"),
833 _("Whether the page cache should be used"),
838 * WebKitWebSettings:auto-resize-window:
840 * Web pages can request to modify the size and position of the
841 * window containing the #WebKitWebView through various DOM methods
842 * (resizeTo, moveTo, resizeBy, moveBy). By default WebKit will not
843 * honor this requests, but you can set this property to %TRUE if
844 * you'd like it to do so. If you wish to handle this manually, you
845 * can connect to the notify signal for the
846 * #WebKitWebWindowFeatures of your #WebKitWebView.
850 g_object_class_install_property(gobject_class,
851 PROP_AUTO_RESIZE_WINDOW,
852 g_param_spec_boolean("auto-resize-window",
853 _("Auto Resize Window"),
854 _("Automatically resize the toplevel window when a page requests it"),
859 * WebKitWebSettings:enable-file-access-from-file-uris:
861 * Boolean property to control file access for file:// URIs. If this
862 * option is enabled every file:// will have its own security unique domain.
866 g_object_class_install_property(gobject_class,
867 PROP_ENABLE_FILE_ACCESS_FROM_FILE_URIS,
868 g_param_spec_boolean("enable-file-access-from-file-uris",
869 "Enable file access from file URIs",
870 "Controls file access for file:// URIs.",
875 * WebKitWebSettings:enable-java-applet:
877 * Enable or disable support for the Java <applet> tag. Keep in
878 * mind that Java content can be still shown in the page through
879 * <object> or <embed>, which are the preferred tags for this task.
883 g_object_class_install_property(gobject_class,
884 PROP_ENABLE_JAVA_APPLET,
885 g_param_spec_boolean("enable-java-applet",
886 _("Enable Java Applet"),
887 _("Whether Java Applet support through <applet> should be enabled"),
892 * WebKitWebSettings:enable-hyperlink-auditing:
894 * Enable or disable support for <a ping>.
898 g_object_class_install_property(gobject_class,
899 PROP_ENABLE_HYPERLINK_AUDITING,
900 g_param_spec_boolean("enable-hyperlink-auditing",
901 _("Enable Hyperlink Auditing"),
902 _("Whether <a ping> should be able to send pings"),
906 /* Undocumented for now */
907 g_object_class_install_property(gobject_class,
908 PROP_ENABLE_FULLSCREEN,
909 g_param_spec_boolean("enable-fullscreen",
910 _("Enable Fullscreen"),
911 _("Whether the Mozilla style API should be enabled."),
915 g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
918 static void webkit_web_settings_init(WebKitWebSettings* web_settings)
920 web_settings->priv = G_TYPE_INSTANCE_GET_PRIVATE(web_settings, WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate);
923 static EnchantBroker* get_enchant_broker()
925 static EnchantBroker* broker = 0;
927 broker = enchant_broker_init();
932 static void free_spell_checking_language(gpointer data, gpointer user_data)
934 EnchantDict* dict = static_cast<EnchantDict*>(data);
935 EnchantBroker* broker = get_enchant_broker();
937 enchant_broker_free_dict(broker, dict);
940 static void webkit_web_settings_finalize(GObject* object)
942 WebKitWebSettings* web_settings = WEBKIT_WEB_SETTINGS(object);
943 WebKitWebSettingsPrivate* priv = web_settings->priv;
945 g_free(priv->default_encoding);
946 g_free(priv->cursive_font_family);
947 g_free(priv->default_font_family);
948 g_free(priv->fantasy_font_family);
949 g_free(priv->monospace_font_family);
950 g_free(priv->sans_serif_font_family);
951 g_free(priv->serif_font_family);
952 g_free(priv->user_stylesheet_uri);
953 g_free(priv->spell_checking_languages);
955 g_slist_foreach(priv->enchant_dicts, free_spell_checking_language, 0);
956 g_slist_free(priv->enchant_dicts);
958 g_free(priv->user_agent);
960 G_OBJECT_CLASS(webkit_web_settings_parent_class)->finalize(object);
963 static void getAvailableDictionariesCallback(const char* const languageTag, const char* const, const char* const, const char* const, void* data)
965 Vector<CString>* dicts = static_cast<Vector<CString>*>(data);
967 dicts->append(languageTag);
970 static void webkit_web_settings_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
972 WebKitWebSettings* web_settings = WEBKIT_WEB_SETTINGS(object);
973 WebKitWebSettingsPrivate* priv = web_settings->priv;
974 EnchantBroker* broker;
976 GSList* spellDictionaries = 0;
979 case PROP_DEFAULT_ENCODING:
980 g_free(priv->default_encoding);
981 priv->default_encoding = g_strdup(g_value_get_string(value));
983 case PROP_CURSIVE_FONT_FAMILY:
984 g_free(priv->cursive_font_family);
985 priv->cursive_font_family = g_strdup(g_value_get_string(value));
987 case PROP_DEFAULT_FONT_FAMILY:
988 g_free(priv->default_font_family);
989 priv->default_font_family = g_strdup(g_value_get_string(value));
991 case PROP_FANTASY_FONT_FAMILY:
992 g_free(priv->fantasy_font_family);
993 priv->fantasy_font_family = g_strdup(g_value_get_string(value));
995 case PROP_MONOSPACE_FONT_FAMILY:
996 g_free(priv->monospace_font_family);
997 priv->monospace_font_family = g_strdup(g_value_get_string(value));
999 case PROP_SANS_SERIF_FONT_FAMILY:
1000 g_free(priv->sans_serif_font_family);
1001 priv->sans_serif_font_family = g_strdup(g_value_get_string(value));
1003 case PROP_SERIF_FONT_FAMILY:
1004 g_free(priv->serif_font_family);
1005 priv->serif_font_family = g_strdup(g_value_get_string(value));
1007 case PROP_DEFAULT_FONT_SIZE:
1008 priv->default_font_size = g_value_get_int(value);
1010 case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
1011 priv->default_monospace_font_size = g_value_get_int(value);
1013 case PROP_MINIMUM_FONT_SIZE:
1014 priv->minimum_font_size = g_value_get_int(value);
1016 case PROP_MINIMUM_LOGICAL_FONT_SIZE:
1017 priv->minimum_logical_font_size = g_value_get_int(value);
1019 case PROP_ENFORCE_96_DPI:
1020 priv->enforce_96_dpi = g_value_get_boolean(value);
1022 case PROP_AUTO_LOAD_IMAGES:
1023 priv->auto_load_images = g_value_get_boolean(value);
1025 case PROP_AUTO_SHRINK_IMAGES:
1026 priv->auto_shrink_images = g_value_get_boolean(value);
1028 case PROP_PRINT_BACKGROUNDS:
1029 priv->print_backgrounds = g_value_get_boolean(value);
1031 case PROP_ENABLE_SCRIPTS:
1032 priv->enable_scripts = g_value_get_boolean(value);
1034 case PROP_ENABLE_PLUGINS:
1035 priv->enable_plugins = g_value_get_boolean(value);
1037 case PROP_RESIZABLE_TEXT_AREAS:
1038 priv->resizable_text_areas = g_value_get_boolean(value);
1040 case PROP_USER_STYLESHEET_URI:
1041 g_free(priv->user_stylesheet_uri);
1042 priv->user_stylesheet_uri = g_strdup(g_value_get_string(value));
1044 case PROP_ZOOM_STEP:
1045 priv->zoom_step = g_value_get_float(value);
1047 case PROP_ENABLE_DEVELOPER_EXTRAS:
1048 priv->enable_developer_extras = g_value_get_boolean(value);
1050 case PROP_ENABLE_PRIVATE_BROWSING:
1051 priv->enable_private_browsing = g_value_get_boolean(value);
1053 case PROP_ENABLE_CARET_BROWSING:
1054 priv->enable_caret_browsing = g_value_get_boolean(value);
1056 case PROP_ENABLE_HTML5_DATABASE:
1057 priv->enable_html5_database = g_value_get_boolean(value);
1059 case PROP_ENABLE_HTML5_LOCAL_STORAGE:
1060 priv->enable_html5_local_storage = g_value_get_boolean(value);
1062 case PROP_ENABLE_SPELL_CHECKING:
1063 priv->enable_spell_checking = g_value_get_boolean(value);
1065 case PROP_SPELL_CHECKING_LANGUAGES:
1066 g_free(priv->spell_checking_languages);
1067 priv->spell_checking_languages = g_strdup(g_value_get_string(value));
1069 broker = get_enchant_broker();
1070 if (priv->spell_checking_languages) {
1071 char** langs = g_strsplit(priv->spell_checking_languages, ",", -1);
1072 for (int i = 0; langs[i]; i++) {
1073 if (enchant_broker_dict_exists(broker, langs[i])) {
1074 dict = enchant_broker_request_dict(broker, langs[i]);
1075 spellDictionaries = g_slist_append(spellDictionaries, dict);
1080 const char* language = pango_language_to_string(gtk_get_default_language());
1081 if (enchant_broker_dict_exists(broker, language)) {
1082 dict = enchant_broker_request_dict(broker, language);
1083 spellDictionaries = g_slist_append(spellDictionaries, dict);
1085 // No dictionaries selected, we get one from the list
1086 Vector<CString> allDictionaries;
1087 enchant_broker_list_dicts(broker, getAvailableDictionariesCallback, &allDictionaries);
1088 if (!allDictionaries.isEmpty()) {
1089 dict = enchant_broker_request_dict(broker, allDictionaries[0].data());
1090 spellDictionaries = g_slist_append(spellDictionaries, dict);
1094 g_slist_foreach(priv->enchant_dicts, free_spell_checking_language, 0);
1095 g_slist_free(priv->enchant_dicts);
1096 priv->enchant_dicts = spellDictionaries;
1098 case PROP_ENABLE_XSS_AUDITOR:
1099 priv->enable_xss_auditor = g_value_get_boolean(value);
1101 case PROP_ENABLE_SPATIAL_NAVIGATION:
1102 priv->enable_spatial_navigation = g_value_get_boolean(value);
1104 case PROP_ENABLE_FRAME_FLATTENING:
1105 priv->enable_frame_flattening = g_value_get_boolean(value);
1107 case PROP_USER_AGENT:
1108 g_free(priv->user_agent);
1109 if (!g_value_get_string(value) || !strlen(g_value_get_string(value)))
1110 priv->user_agent = g_strdup(webkitUserAgent().utf8().data());
1112 priv->user_agent = g_strdup(g_value_get_string(value));
1114 case PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY:
1115 priv->javascript_can_open_windows_automatically = g_value_get_boolean(value);
1117 case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
1118 priv->javascript_can_access_clipboard = g_value_get_boolean(value);
1120 case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
1121 priv->enable_offline_web_application_cache = g_value_get_boolean(value);
1123 case PROP_EDITING_BEHAVIOR:
1124 priv->editing_behavior = static_cast<WebKitEditingBehavior>(g_value_get_enum(value));
1126 case PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS:
1127 priv->enable_universal_access_from_file_uris = g_value_get_boolean(value);
1129 case PROP_ENABLE_FILE_ACCESS_FROM_FILE_URIS:
1130 priv->enable_file_access_from_file_uris = g_value_get_boolean(value);
1132 case PROP_ENABLE_DOM_PASTE:
1133 priv->enable_dom_paste = g_value_get_boolean(value);
1135 case PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS:
1136 priv->tab_key_cycles_through_elements = g_value_get_boolean(value);
1138 case PROP_ENABLE_DEFAULT_CONTEXT_MENU:
1139 priv->enable_default_context_menu = g_value_get_boolean(value);
1141 case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
1142 priv->enable_site_specific_quirks = g_value_get_boolean(value);
1144 case PROP_ENABLE_PAGE_CACHE:
1145 priv->enable_page_cache = g_value_get_boolean(value);
1147 case PROP_AUTO_RESIZE_WINDOW:
1148 priv->auto_resize_window = g_value_get_boolean(value);
1150 case PROP_ENABLE_JAVA_APPLET:
1151 priv->enable_java_applet = g_value_get_boolean(value);
1153 case PROP_ENABLE_HYPERLINK_AUDITING:
1154 priv->enable_hyperlink_auditing = g_value_get_boolean(value);
1156 case PROP_ENABLE_FULLSCREEN:
1157 priv->enable_fullscreen = g_value_get_boolean(value);
1160 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
1165 static void webkit_web_settings_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
1167 WebKitWebSettings* web_settings = WEBKIT_WEB_SETTINGS(object);
1168 WebKitWebSettingsPrivate* priv = web_settings->priv;
1171 case PROP_DEFAULT_ENCODING:
1172 g_value_set_string(value, priv->default_encoding);
1174 case PROP_CURSIVE_FONT_FAMILY:
1175 g_value_set_string(value, priv->cursive_font_family);
1177 case PROP_DEFAULT_FONT_FAMILY:
1178 g_value_set_string(value, priv->default_font_family);
1180 case PROP_FANTASY_FONT_FAMILY:
1181 g_value_set_string(value, priv->fantasy_font_family);
1183 case PROP_MONOSPACE_FONT_FAMILY:
1184 g_value_set_string(value, priv->monospace_font_family);
1186 case PROP_SANS_SERIF_FONT_FAMILY:
1187 g_value_set_string(value, priv->sans_serif_font_family);
1189 case PROP_SERIF_FONT_FAMILY:
1190 g_value_set_string(value, priv->serif_font_family);
1192 case PROP_DEFAULT_FONT_SIZE:
1193 g_value_set_int(value, priv->default_font_size);
1195 case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
1196 g_value_set_int(value, priv->default_monospace_font_size);
1198 case PROP_MINIMUM_FONT_SIZE:
1199 g_value_set_int(value, priv->minimum_font_size);
1201 case PROP_MINIMUM_LOGICAL_FONT_SIZE:
1202 g_value_set_int(value, priv->minimum_logical_font_size);
1204 case PROP_ENFORCE_96_DPI:
1205 g_value_set_boolean(value, priv->enforce_96_dpi);
1207 case PROP_AUTO_LOAD_IMAGES:
1208 g_value_set_boolean(value, priv->auto_load_images);
1210 case PROP_AUTO_SHRINK_IMAGES:
1211 g_value_set_boolean(value, priv->auto_shrink_images);
1213 case PROP_PRINT_BACKGROUNDS:
1214 g_value_set_boolean(value, priv->print_backgrounds);
1216 case PROP_ENABLE_SCRIPTS:
1217 g_value_set_boolean(value, priv->enable_scripts);
1219 case PROP_ENABLE_PLUGINS:
1220 g_value_set_boolean(value, priv->enable_plugins);
1222 case PROP_RESIZABLE_TEXT_AREAS:
1223 g_value_set_boolean(value, priv->resizable_text_areas);
1225 case PROP_USER_STYLESHEET_URI:
1226 g_value_set_string(value, priv->user_stylesheet_uri);
1228 case PROP_ZOOM_STEP:
1229 g_value_set_float(value, priv->zoom_step);
1231 case PROP_ENABLE_DEVELOPER_EXTRAS:
1232 g_value_set_boolean(value, priv->enable_developer_extras);
1234 case PROP_ENABLE_PRIVATE_BROWSING:
1235 g_value_set_boolean(value, priv->enable_private_browsing);
1237 case PROP_ENABLE_CARET_BROWSING:
1238 g_value_set_boolean(value, priv->enable_caret_browsing);
1240 case PROP_ENABLE_HTML5_DATABASE:
1241 g_value_set_boolean(value, priv->enable_html5_database);
1243 case PROP_ENABLE_HTML5_LOCAL_STORAGE:
1244 g_value_set_boolean(value, priv->enable_html5_local_storage);
1246 case PROP_ENABLE_SPELL_CHECKING:
1247 g_value_set_boolean(value, priv->enable_spell_checking);
1249 case PROP_SPELL_CHECKING_LANGUAGES:
1250 g_value_set_string(value, priv->spell_checking_languages);
1252 case PROP_ENABLE_XSS_AUDITOR:
1253 g_value_set_boolean(value, priv->enable_xss_auditor);
1255 case PROP_ENABLE_SPATIAL_NAVIGATION:
1256 g_value_set_boolean(value, priv->enable_spatial_navigation);
1258 case PROP_ENABLE_FRAME_FLATTENING:
1259 g_value_set_boolean(value, priv->enable_frame_flattening);
1261 case PROP_USER_AGENT:
1262 g_value_set_string(value, priv->user_agent);
1264 case PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY:
1265 g_value_set_boolean(value, priv->javascript_can_open_windows_automatically);
1267 case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
1268 g_value_set_boolean(value, priv->javascript_can_access_clipboard);
1270 case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
1271 g_value_set_boolean(value, priv->enable_offline_web_application_cache);
1273 case PROP_EDITING_BEHAVIOR:
1274 g_value_set_enum(value, priv->editing_behavior);
1276 case PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS:
1277 g_value_set_boolean(value, priv->enable_universal_access_from_file_uris);
1279 case PROP_ENABLE_FILE_ACCESS_FROM_FILE_URIS:
1280 g_value_set_boolean(value, priv->enable_file_access_from_file_uris);
1282 case PROP_ENABLE_DOM_PASTE:
1283 g_value_set_boolean(value, priv->enable_dom_paste);
1285 case PROP_TAB_KEY_CYCLES_THROUGH_ELEMENTS:
1286 g_value_set_boolean(value, priv->tab_key_cycles_through_elements);
1288 case PROP_ENABLE_DEFAULT_CONTEXT_MENU:
1289 g_value_set_boolean(value, priv->enable_default_context_menu);
1291 case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
1292 g_value_set_boolean(value, priv->enable_site_specific_quirks);
1294 case PROP_ENABLE_PAGE_CACHE:
1295 g_value_set_boolean(value, priv->enable_page_cache);
1297 case PROP_AUTO_RESIZE_WINDOW:
1298 g_value_set_boolean(value, priv->auto_resize_window);
1300 case PROP_ENABLE_JAVA_APPLET:
1301 g_value_set_boolean(value, priv->enable_java_applet);
1303 case PROP_ENABLE_HYPERLINK_AUDITING:
1304 g_value_set_boolean(value, priv->enable_hyperlink_auditing);
1306 case PROP_ENABLE_FULLSCREEN:
1307 g_value_set_boolean(value, priv->enable_fullscreen);
1310 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
1316 * webkit_web_settings_new:
1318 * Creates a new #WebKitWebSettings instance with default values. It must
1319 * be manually attached to a WebView.
1321 * Returns: a new #WebKitWebSettings instance
1323 WebKitWebSettings* webkit_web_settings_new()
1325 return WEBKIT_WEB_SETTINGS(g_object_new(WEBKIT_TYPE_WEB_SETTINGS, NULL));
1329 * webkit_web_settings_copy:
1331 * Copies an existing #WebKitWebSettings instance.
1333 * Returns: (transfer full): a new #WebKitWebSettings instance
1335 WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings)
1337 WebKitWebSettingsPrivate* priv = web_settings->priv;
1339 WebKitWebSettings* copy = WEBKIT_WEB_SETTINGS(g_object_new(WEBKIT_TYPE_WEB_SETTINGS,
1340 "default-encoding", priv->default_encoding,
1341 "cursive-font-family", priv->cursive_font_family,
1342 "default-font-family", priv->default_font_family,
1343 "fantasy-font-family", priv->fantasy_font_family,
1344 "monospace-font-family", priv->monospace_font_family,
1345 "sans-serif-font-family", priv->sans_serif_font_family,
1346 "serif-font-family", priv->serif_font_family,
1347 "default-font-size", priv->default_font_size,
1348 "default-monospace-font-size", priv->default_monospace_font_size,
1349 "minimum-font-size", priv->minimum_font_size,
1350 "minimum-logical-font-size", priv->minimum_logical_font_size,
1351 "auto-load-images", priv->auto_load_images,
1352 "auto-shrink-images", priv->auto_shrink_images,
1353 "print-backgrounds", priv->print_backgrounds,
1354 "enable-scripts", priv->enable_scripts,
1355 "enable-plugins", priv->enable_plugins,
1356 "resizable-text-areas", priv->resizable_text_areas,
1357 "user-stylesheet-uri", priv->user_stylesheet_uri,
1358 "zoom-step", priv->zoom_step,
1359 "enable-developer-extras", priv->enable_developer_extras,
1360 "enable-private-browsing", priv->enable_private_browsing,
1361 "enable-spell-checking", priv->enable_spell_checking,
1362 "spell-checking-languages", priv->spell_checking_languages,
1363 "enable-caret-browsing", priv->enable_caret_browsing,
1364 "enable-html5-database", priv->enable_html5_database,
1365 "enable-html5-local-storage", priv->enable_html5_local_storage,
1366 "enable-xss-auditor", priv->enable_xss_auditor,
1367 "enable-spatial-navigation", priv->enable_spatial_navigation,
1368 "enable-frame-flattening", priv->enable_frame_flattening,
1369 "user-agent", webkit_web_settings_get_user_agent(web_settings),
1370 "javascript-can-open-windows-automatically", priv->javascript_can_open_windows_automatically,
1371 "javascript-can-access-clipboard", priv->javascript_can_access_clipboard,
1372 "enable-offline-web-application-cache", priv->enable_offline_web_application_cache,
1373 "editing-behavior", priv->editing_behavior,
1374 "enable-universal-access-from-file-uris", priv->enable_universal_access_from_file_uris,
1375 "enable-file-access-from-file-uris", priv->enable_file_access_from_file_uris,
1376 "enable-dom-paste", priv->enable_dom_paste,
1377 "tab-key-cycles-through-elements", priv->tab_key_cycles_through_elements,
1378 "enable-default-context-menu", priv->enable_default_context_menu,
1379 "enable-site-specific-quirks", priv->enable_site_specific_quirks,
1380 "enable-page-cache", priv->enable_page_cache,
1381 "auto-resize-window", priv->auto_resize_window,
1382 "enable-java-applet", priv->enable_java_applet,
1383 "enable-hyperlink-auditing", priv->enable_hyperlink_auditing,
1384 "enable-fullscreen", priv->enable_fullscreen,
1391 * webkit_web_settings_add_extra_plugin_directory:
1392 * @web_view: a #WebKitWebView
1393 * @directory: the directory to add
1395 * Adds the @directory to paths where @web_view will search for plugins.
1399 void webkit_web_settings_add_extra_plugin_directory(WebKitWebView* webView, const gchar* directory)
1401 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
1403 PluginDatabase::installedPlugins()->addExtraPluginDirectory(filenameToString(directory));
1407 * webkit_web_settings_get_user_agent:
1408 * @web_settings: a #WebKitWebSettings
1410 * Returns the User-Agent string currently used by the web view(s) associated
1411 * with the @web_settings.
1415 G_CONST_RETURN gchar* webkit_web_settings_get_user_agent(WebKitWebSettings* webSettings)
1417 g_return_val_if_fail(WEBKIT_IS_WEB_SETTINGS(webSettings), NULL);
1419 WebKitWebSettingsPrivate* priv = webSettings->priv;
1421 return priv->user_agent;
1424 GSList* webkitWebViewGetEnchantDicts(WebKitWebView* webView)
1426 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
1428 WebKitWebSettings* settings = webkit_web_view_get_settings(webView);
1430 return settings->priv->enchant_dicts;
1435 WebCore::EditingBehaviorType core(WebKitEditingBehavior type)
1437 return (WebCore::EditingBehaviorType)type;