summaryrefslogtreecommitdiffstats
path: root/src/core/doc/src/qwebenginesettings_lgpl.qdoc
blob: cd7ff8e8c0d406bb9d2e85f66096cb07c026757c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
// Copyright (C) 2022 The Qt Company Ltd.
// Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

// The documentation in this file was imported from QtWebKit and is thus constrained
// by its LGPL license. Documentation written from scratch for new methods should be
// placed inline in the code as usual.

/*!
    \class QWebEngineSettings
    \since 5.4
    \brief The QWebEngineSettings class provides an object to store the settings used
    by QWebEnginePage.

    \inmodule QtWebEngineCore

    QWebEngineSettings allows configuration of browser properties, such as font sizes and
    families, and generic attributes, such as JavaScript support.
    Individual attributes are set using the setAttribute() function. The
    \l{QWebEngineSettings::WebAttribute}{WebAttribute} enum further describes each attribute.

    Each QWebEnginePage object has its own QWebEngineSettings object, which configures the
    settings for that page. If a setting is not configured for a web engine
    page, it is looked up in the settings of the profile the page belongs to.

    \sa QWebEnginePage::settings(), QWebEngineView::settings()
*/

/*!
    \enum QWebEngineSettings::FontFamily

    This enum describes the generic font families defined by CSS 2.
    For more information see the
    \l{http://www.w3.org/TR/REC-CSS2/fonts.html#generic-font-families}{CSS standard}.

    \value StandardFont
    \value FixedFont
    \value SerifFont
    \value SansSerifFont
    \value CursiveFont
    \value FantasyFont
    \value PictographFont
           (added in Qt 5.7, deprecated Qt 6.4)
*/

/*!
    \enum QWebEngineSettings::FontSize

    This enum describes the font sizes configurable through QWebEngineSettings:

    \value MinimumFontSize The hard minimum font size.
    \value MinimumLogicalFontSize The minimum logical font size that is applied
        when zooming out.
    \value DefaultFontSize The default font size for regular text.
    \value DefaultFixedFontSize The default font size for fixed-pitch text.
*/

/*!
    \enum QWebEngineSettings::WebAttribute

    This enum type specifies settings for web pages:

    \value  AutoLoadImages
            Automatically dowloads images for web pages. When this setting is
            disabled, images are loaded from the cache. Enabled by default.
    \value  JavascriptEnabled
            Enables the running of JavaScript programs in the
            \l{QWebEngineScript::MainWorld}{MainWorld}. Enabled by default.
    \value  JavascriptCanOpenWindows
            Allows JavaScript programs to open popup windows without user
            interaction. Enabled by default.
    \value  JavascriptCanAccessClipboard
            Allows JavaScript programs to read from and write to the clipboard.
            Writing to the clipboard is always allowed if it is specifically requested by the user.
            See JavascriptCanPaste to also allow pasting the content of the clipboard content from
            JavaScript. Since unrestricted clipboard access is a potential security concern, it is
            recommended that applications leave this disabled and instead respond to
            \l{QWebEnginePage::ClipboardReadWrite}{ClipboardReadWrite} feature permission requests.
            Disabled by default.
    \value  LinksIncludedInFocusChain
            Includes hyperlinks in the keyboard focus chain. Enabled by default.
    \value  LocalStorageEnabled
            Enables support for the HTML 5 local storage feature. Enabled by default.
    \value  LocalContentCanAccessRemoteUrls
            Allows local origin documents to access remote resources that would normally be blocked.
            Disabled by default. Note DnsPrefetchEnabled below operates independently of this setting,
            and can if enabled, cause remote accesses from local content.
    \value  XSSAuditingEnabled
            Obsolete and has no effect.
    \value  SpatialNavigationEnabled
            Enables the Spatial Navigation feature, which means the ability to navigate between
            focusable elements, such as hyperlinks and form controls, on a web page by using the
            Left, Right, Up and Down arrow keys. For example, if a user presses the
            Right key, heuristics determine whether there is an element they might be
            trying to reach towards the right and which element they probably want.
            Disabled by default.
    \value  LocalContentCanAccessFileUrls
            Allows locally loaded documents to access other local URLs. Disabling this makes QtWebEngine
            behave more like Chrome and Firefox does by default. Enabled by default.
    \value  HyperlinkAuditingEnabled
            Enables support for the \c ping attribute for hyperlinks. Disabled by default.
    \value  ScrollAnimatorEnabled
            Enables animated scrolling. Disabled by default.
    \value  ErrorPageEnabled
            Enables displaying the built-in error pages of Chromium. Enabled by default.
    \value  PluginsEnabled
            Enables support for Pepper plugins, such as the Flash player. Disabled by default.
            See also \l{Pepper Plugin API}. (Added in Qt 5.6)
    \value  FullScreenSupportEnabled
            Enables fullscreen support in an application. Disabled by default. (Added in Qt 5.6)
    \value  ScreenCaptureEnabled
            Enables screen capture in an application. Disabled by default. (Added in Qt 5.7)
    \value  WebGLEnabled
            Enables support for HTML 5 WebGL. Enabled by default if available. (Added in Qt 5.7)
    \value  Accelerated2dCanvasEnabled
            Specifies whether the HTML5 2D canvas should be a OpenGL framebuffer.
            This makes many painting operations faster, but slows down pixel access. Enabled by default if available. (Added in Qt 5.7)
    \value  AutoLoadIconsForPage
            Automatically downloads icons for web pages. Enabled by default. (Added in Qt 5.7)
    \value  TouchIconsEnabled
            Enables support for touch icons and precomposed touch icons
            Disabled by default. (Added in Qt 5.7)
    \value  FocusOnNavigationEnabled
            Gives focus to the view associated with the page, whenever a navigation operation occurs
            (load, stop, reload, reload and bypass cache, forward, backward, set content, and so
            on).
            Disabled by default. (Added in Qt 5.8)
    \value  PrintElementBackgrounds
            Turns on printing of CSS backgrounds when printing a web page.
            Enabled by default. (Added in Qt 5.8)
    \value  AllowRunningInsecureContent
            By default, HTTPS pages cannot run JavaScript, CSS, plugins or
            web-sockets from HTTP URLs. This provides an override to get
            the old insecure behavior.
            Disabled by default. (Added in Qt 5.8)
    \value  AllowGeolocationOnInsecureOrigins
            Since Qt 5.7, only secure origins such as HTTPS have been able to request
            Geolocation features. This provides an override to allow non secure
            origins to access Geolocation again.
            Disabled by default. (Added in Qt 5.9)
    \value  AllowWindowActivationFromJavaScript
            Allows activating windows by using the window.focus() JavaScript
            method. Disabled by default.
            (Added in Qt 5.10)
    \value  ShowScrollBars
            Shows scroll bars.
            Enabled by default. (Added in Qt 5.10)
    \value  PlaybackRequiresUserGesture
            Inhibits playback of media content until the user interacts with
            the page. By default, WebEngine uses Chromium settings, as described
            in \l {Autoplay Policy Changes}. This is similar to how Chrome on
            Android behaves, while the default behavior when it is disabled is
            similar to Chrome on desktops. To overwrite the default behavior,
            disable this setting. (Added in Qt 5.11)
    \value  JavascriptCanPaste
            Enables JavaScript \c{execCommand("paste")}. This also requires enabling
            JavascriptCanAccessClipboard. Since unrestricted clipboard access is a potential
            security concern, it is recommended that applications leave this disabled
            and instead respond to \l{QWebEnginePage::ClipboardReadWrite}{ClipboardReadWrite}
            feature permission requests.
            Disabled by default. (Added in Qt 5.11)
    \value  WebRTCPublicInterfacesOnly
            Limits WebRTC to public IP addresses only. When disabled WebRTC may also use
            local network IP addresses, but remote hosts can also see your local network
            IP address.
            Disabled by default. (Added in Qt 5.11)
    \value DnsPrefetchEnabled Specifies whether WebEngine will try to pre-fetch DNS entries to
            speed up browsing.
            Disabled by default. (Added in Qt 5.12)
    \value PdfViewerEnabled Specifies that PDF documents will be opened in the internal PDF viewer
           instead of being downloaded.
           Enabled by default. (Added in Qt 5.13)
    \value NavigateOnDropEnabled Specifies that navigations can be triggered by dropping URLs on
           the view.
           Enabled by default. (Added in Qt 6.4)
    \value ReadingFromCanvasEnabled Specifies that reading from all canvas elements is enabled.
           This setting will have impact on all HTML5 canvas elements irrespective of origin, and can be disabled
           to prevent canvas fingerprinting.
           Enabled by default. (Added in Qt 6.6)
    \value ForceDarkMode Specifies that all web contents will be rendered using a dark theme.
           For more information, see \l{https://developer.chrome.com/blog/auto-dark-theme/}{Auto dark theme}.
           Disabled by default. (Added in Qt 6.7)
*/

/*!
    \enum QWebEngineSettings::UnknownUrlSchemePolicy
    \since Qt 5.11

    This enum describes how navigation requests to URLs with unknown schemes are handled.

    \value DisallowUnknownUrlSchemes
           Disallows all navigation requests to URLs with unknown schemes.
    \value AllowUnknownUrlSchemesFromUserInteraction
           Allows navigation requests to URLs with unknown schemes that are issued from
           user-interaction (like a mouse-click), whereas other navigation requests (for example
           from JavaScript) are suppressed.
    \value AllowAllUnknownUrlSchemes
           Allows all navigation requests to URLs with unknown schemes.
    \omitvalue InheritedUnknownUrlSchemePolicy

    \sa unknownUrlSchemePolicy setUnknownUrlSchemePolicy resetUnknownUrlSchemePolicy
*/

/*!
    \enum QWebEngineSettings::ImageAnimationPolicy
    \since Qt 6.8

    This enum describes how an image animation should be handled when the image frames
    are rendered for animation.

    \value AllowImageAnimation
           Allows image animation when the image frames are rendered.
    \value AnimateImageOnce
           Animate the image once when the image frames are rendered.
    \value DisallowImageAnimation
           Disallows image animation when the image frames are rendered.
    \omitvalue InheritedImageAnimationPolicy

    \sa imageAnimationPolicy setImageAnimationPolicy resetImageAnimationPolicy
*/

/*!
    \fn void QWebEngineSettings::setFontSize(FontSize type, int size)
    Sets the font size for \a type to \a size in pixels.
*/

/*!
    \fn int QWebEngineSettings::fontSize(FontSize type) const
    Returns the default font size for \a type in pixels.
*/

/*!
    \fn void QWebEngineSettings::resetFontSize(FontSize type)
    Resets the font size for \a type to the size specified in the profile that
    the page belongs to.
*/

/*!
    \fn void QWebEngineSettings::setDefaultTextEncoding(const QString& encoding)
    Specifies the default text encoding system.

    The value of \a encoding must be a string describing an encoding such as "utf-8" or
    "iso-8859-1". If left empty, a default value will be used. For a more
    extensive list of encoding names see \l{QTextCodec}.

    \sa defaultTextEncoding()
*/

/*!
    \fn QString QWebEngineSettings::defaultTextEncoding() const
    Returns the default text encoding.

    \sa setDefaultTextEncoding()
*/

/*!
    \fn QString QWebEngineSettings::fontFamily(FontFamily which) const
    Returns the actual font family for the specified generic font family,
    \a which.
*/

/*!
    \fn void QWebEngineSettings::resetFontFamily(FontFamily which)
    Resets the actual font family specified by \a which to the one specified
    in the profile that the page belongs to.
*/

/*!
    \fn QWebEngineSettings::UnknownUrlSchemePolicy QWebEngineSettings::unknownUrlSchemePolicy() const
    \since Qt 5.11
    Returns the currently selected policy for handling navigation requests to URLs with
    unknown schemes. Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}.
    \sa setUnknownUrlSchemePolicy resetUnknownUrlSchemePolicy
*/

/*!
    \fn void QWebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy policy)
    \since Qt 5.11
    Sets the policy for handling navigation requests to URLs with unknown schemes to \a policy.
    Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}.
    \sa unknownUrlSchemePolicy resetUnknownUrlSchemePolicy
*/

/*!
    \fn void QWebEngineSettings::resetUnknownUrlSchemePolicy()
    \since Qt 5.11
    Removes the policy for handling navigation requests to URLs with unknown schemes.
    \sa unknownUrlSchemePolicy setUnknownUrlSchemePolicy
*/

/*!
    \fn void QWebEngineSettings::setAttribute(WebAttribute attribute, bool on)

    Enables or disables the specified \a attribute feature depending on the
    value of \a on.
*/

/*!
    \fn bool QWebEngineSettings::testAttribute(WebAttribute attribute) const

    Returns \c true if \a attribute is enabled; otherwise returns \c false.
*/

/*!
    \fn void QWebEngineSettings::resetAttribute(WebAttribute attribute)

    Resets the setting of \a attribute to the value specified in the
    profile that the page belongs to.
*/

/*!
    \fn QWebEngineSettings::ImageAnimationPolicy QWebEngineSettings::imageAnimationPolicy() const
    \since Qt 6.8
    Returns the currently selected policy for handling image animation when the image frames are rendered.
    Default is \l{QWebEngineSettings::AllowImageAnimation}.
    \sa setImageAnimationPolicy resetImageAnimationPolicy
*/

/*!
    \fn void QWebEngineSettings::setImageAnimationPolicy(QWebEngineSettings::ImageAnimationPolicy policy)
    \since Qt 6.8
    Sets the policy for handling image animation when the image frames are rendered to \a policy.
    Default is \l{QWebEngineSettings::AllowImageAnimation}.
    \sa imageAnimationPolicy resetImageAnimationPolicy
*/

/*!
    \fn void QWebEngineSettings::resetImageAnimationPolicy()
    \since Qt 6.7
    Removes the policy for handling image animation.
    \sa imageAnimationPolicy setImageAnimationPolicy
*/