summaryrefslogtreecommitdiffstats
path: root/src/webengine/doc/src/qtwebengine-debugging.qdoc
blob: e929fabeb5bf377412b294e826e77945f35f242c (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
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \page qtwebengine-debugging.html
    \title Qt WebEngine Debugging and Profiling

    \section1 Console Logging

    JavaScript executed inside Qt WebEngine can use the
    \l{Chrome console API} to log information to a console. The logging messages
    are forwarded to Qt's logging facilities inside a \c js
    \l{QLoggingCategory}{logging category}. However, only warning and fatal
    messages are printed by default. To change this, you either have to set custom
    rules for the \c js category, or provide custom message handlers
    by reimplementing \l{QWebEnginePage::javaScriptConsoleMessage()}, or
    connecting to \l{WebEngineView::javaScriptConsoleMessage()}.

    All messages can also be accessed through the Qt WebEngine developer
    tools.

    \section1 Qt WebEngine Developer Tools

    The Qt WebEngine module provides web developer tools that make it easy
    to inspect and debug layout and performance issues of any web content.

    The developer tools are accessed as a local web page using a Chromium or
    Qt WebEngine based browser, such as the Chrome browser.

    To activate the developer tools, start an application that uses Qt
    WebEngine with the command-line arguments:

    \badcode
    --remote-debugging-port=<port_number>
    \endcode

    Where \c <port_number> refers to a local network port. The web developer
    tools can then be accessed by launching a browser at the address
    \c http://localhost:<port_number>.

    Alternatively, the environment variable QTWEBENGINE_REMOTE_DEBUGGING
    can be set. It can be set as either just a port working similarly to
    \c --remote-debugging-port or given both a host address and a port. The
    latter can be used to control which network interface to export the
    interface on, so that you can access the developer tools from a remote
    device.

    For a detailed explanation of the capabilities of developer tools, see the
    \l {Chrome DevTools} page.
*/