aboutsummaryrefslogtreecommitdiff
path: root/files/el/tools/about_colon_debugging/index.html
blob: 8cc9fc9fb3e8fa0e7ba03df23c398ffa9207546a (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
---
title: about:debugging
slug: Tools/about:debugging
translation_of: Tools/about:debugging
original_slug: Εργαλεία/about:debugging
---
<p>{{ToolsSidebar}}</p>

<p>The <code>about:debugging</code> page provides a single place from which you can attach the Firefox Developer Tools to a number of debugging targets. At the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers.</p>

<h2 id="Opening_the_aboutdebugging_page">Opening the about:debugging page</h2>

<p>There are two ways to open <code>about:debugging</code>:</p>

<ul>
 <li>Type <code>about:debugging</code> in the Firefox URL bar.</li>
 <li>In the <strong>Tools</strong> &gt; <strong>Web Developer</strong> menu, click <strong>Remote Debugging</strong>.</li>
</ul>

<p>When about:debugging opens, on the left-hand side, you'll see a sidebar with two options and information about your remote debugging setup:</p>

<dl>
 <dt>Setup</dt>
 <dd>Use the Setup tab to configure the connection to your remote device.</dd>
 <dt>This Firefox</dt>
 <dd>Provides information about temporary extensions you have loaded for debugging, extensions that are installed in Firefox, the tabs that you currently have open, and service workers running on Firefox.</dd>
</dl>

<p><img alt="" src="https://mdn.mozillademos.org/files/16650/about_debugging_setup.png" style="border: 1px solid black; display: block; height: 751px; margin: 0px auto; width: 918px;"></p>

<p>If your <code>about:debugging</code> page is different from the one displayed here, go to <code>about:config</code>, find and set the option <code>devtools.aboutdebugging.new-enabled</code> to <strong>true</strong>.</p>

<h2 id="Setup_tab">Setup tab</h2>

<h3 id="Connecting_to_a_remote_device">Connecting to a remote device</h3>

<p>Firefox supports debugging over USB with Android devices, using the about:debugging page.</p>

<p>Before you connect:</p>

<ol>
 <li>Enable Developer settings on your Android device.</li>
 <li>Enable USB debugging in the Android Developer settings.</li>
 <li>Enable <strong>Remote Debugging via USB</strong> in the Advanced Settings in Firefox on the Android device.</li>
 <li>Connect the Android device to your computer using a USB cable.</li>
</ol>

<p>If your device doesn't appear in the lefthand side of the about:debugging page, try clicking the <strong>Refresh devices</strong> button.</p>

<p><strong>If it still doesn't appear</strong>, it may be because the link between your Android device and your computer is not authorized yet. First make sure you have installed <a href="https://developer.android.com/studio/command-line/adb.html">Android Debug Bridge</a> from Android Tools on your computer in order for it to be able to connect to your device. Next, disable every debugging setting already activated and repeat the steps described before. Your device should show a popup to authorize your computer to connect to it — accept this and then click the <strong>Refresh devices</strong> button again. The device should appear.</p>

<div class="blockIndicator note">
<p><strong>Note</strong>: You do not need to install the full Android Studio SDK. Only adb is needed.</p>
</div>

<p>To start a debugging session, first open the page that you wish to debug and then click <strong>Connect</strong> next to the device name to open a connection to it. If the connection was successful, you can now click the name of the device to switch to a tab with information about the device.</p>

<p><img alt="Screenshot of the debugging page for an Android device" src="https://mdn.mozillademos.org/files/16915/device_information.png" style="border: 1px solid black; display: block; margin: 0 auto;"></p>

<p>The information on this page is the same as the information on the <strong>This Firefox</strong> tab, but instead of displaying information for your computer, it displays the information for the remote device with the addition of a <strong>Tabs</strong> section with an entry for each of the tabs open on the remote device.</p>

<p>Note: If the version of Firefox on your remote device is more than one major version older than the version running on your computer, you may see a message like the following:</p>

<p><img alt="" src="https://mdn.mozillademos.org/files/16917/version_warning.png" style="display: block; margin: 0 auto;"></p>

<p>In the image above, there are three tabs open: <strong>Network or cache Recipe</strong>, <strong>Nightly Home</strong>, and <strong>About Nightly</strong>. To debug the contents of one of these tabs, click the <strong>Inspect</strong> button next to its title. When you do, the Developer Tools open in a new tab.</p>

<p><img alt="" src="https://mdn.mozillademos.org/files/16916/remote_debugger.png" style="border: 1px solid black; display: block; margin: 0 auto;"></p>

<p>Above the usual list of tools, you can see information about the device you are connected to, including the fact that you are connected (in this example) via USB, to Mozilla Firefox Nightly, on a Moto G(5), as well as the title of the page that you are debugging, and the address of the page.</p>

<h3 id="Connecting_over_the_Network">Connecting over the Network</h3>

<p>You can connect to a Firefox Debug server on your network, or on your debugging machine using the <strong>Network Location</strong> settings of the about:debugging page.</p>

<p><img alt="" src="https://mdn.mozillademos.org/files/16942/network_location.png" style="display: block; margin: 0px auto;"></p>

<p>Enter the location and port on which the debugger server is running. When you do, it is added to the Network locations list along with the devices, as shown below:</p>

<p><img alt="" src="https://mdn.mozillademos.org/files/16943/connect_network_location.png" style="display: block; margin: 0 auto;"></p>

<h2 id="This_Firefox">This Firefox</h2>

<p>The <strong>This Firefox</strong> tab combines the features of Extensions, Tabs, and Workers into a single tab with the following sections:</p>

<dl>
 <dt>Temporary Extensions</dt>
 <dd>Displays a list of the extensions that you have loaded using the <strong>Load Temporary Add-on</strong> button.</dd>
 <dt>Extensions</dt>
 <dd>This section lists information about the extensions that you have installed on your system.</dd>
 <dt>Service Workers, Shared Workers, and Other Workers</dt>
 <dd>There are three sections on this page that deal with Service Workers, Shared Workers, and Other Workers.</dd>
</dl>

<p><img alt="" src="https://mdn.mozillademos.org/files/16654/about_debugging_this_firefox.png" style="border: 1px solid black; display: block; height: 867px; margin: 0px auto; width: 1138px;"></p>

<p>Whether internal extensions appear in the list on this page depends on the setting of the <code>devtools.aboutdebugging.showHiddenAddons</code> preference. If you need to see these extensions, navigate to <code>about:config</code> and make sure that the preference is set to <code>true</code>.</p>

<h2 id="Extensions">Extensions</h2>

<h3 id="Loading_a_temporary_extension">Loading a temporary extension</h3>

<p>With the <strong>Load Temporary Add-on</strong> button you can temporarily load a web extension from a directory on disk. Click the button, navigate to the directory containing the add-on and select its manifest file. The temporary extension is then displayed under the <strong>Temporary Extensions</strong> header.</p>

<p>You don't have to package or sign the extension before loading it, and it stays installed until you restart Firefox.</p>

<p>The major advantages of this method, compared with installing an add-on from an XPI, are:</p>

<ul>
 <li>You don't have to rebuild an XPI and reinstall when you change the add-on's code;</li>
 <li>You can load an add-on without signing it and without needing to disable signing.</li>
</ul>

<p>Once you have loaded a temporary extension, you can see information about it and perform operations on it.</p>

<p><img alt="Screenshot of the debugging information panel for a temporary extension" src="https://mdn.mozillademos.org/files/16652/temporary_extension.png" style="display: block; height: 322px; margin: 0 auto; width: 680px;"></p>

<p>You can use the following buttons:</p>

<dl>
 <dt>Inspect</dt>
 <dd>Loads the extension in the debugger.</dd>
 <dt>Reload</dt>
 <dd>Reloads the temporary extension. This is handy when you have made changes to the extension.</dd>
 <dt>Remove</dt>
 <dd>Unloads the temporary extension.</dd>
</dl>

<p>Other information about the extension is displayed:</p>

<dl>
 <dt>Location</dt>
 <dd>The location of the extension's source code on your local system.</dd>
 <dt>Extension ID</dt>
 <dd>The temporary ID assigned to the extension.</dd>
 <dt>Internal UUID</dt>
 <dd>The internal UUID assigned to the extension.</dd>
 <dt>Manifest URL</dt>
 <dd>If you click the link, the manifest for this extension is loaded in a new tab.</dd>
</dl>

<h3 id="Updating_a_temporary_extension">Updating a temporary extension</h3>

<p>If you install an extension in this way, what happens when you update the extension?</p>

<ul>
 <li>If you change files that are loaded on demand, like <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts">content scripts</a> or <a href="/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Browser_actions_2">popups</a>, then changes you make are picked up automatically, and you'll see them the next time the content script is loaded or the popup is shown.</li>
 <li>For other changes, click the <strong>Reload</strong> button. This does what it says:
  <ul>
   <li>Reloads any persistent scripts, such as <a href="/en-US/Add-ons/WebExtensions/Anatomy_of_a_WebExtension#Background_scripts">background scripts</a></li>
   <li>Parses the <code>manifest.json</code> file again, so changes to <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">permissions</a></code>, <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts">content_scripts</a></code>, <code><a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></code> or any other keys take effect</li>
  </ul>
 </li>
</ul>

<h3 id="Installed_Extensions">Installed Extensions</h3>

<p>The permanently installed extensions are listed in the next section, <strong>Extensions</strong>. For each one, you see something like the following:</p>

<p><img alt="Screenshot of the debugging information panel for an installed extension" src="https://mdn.mozillademos.org/files/16651/installed_extension.png" style="display: block; margin: 0 auto;"></p>

<p>The <strong>Inspect</strong> button, and the <strong>Extension ID</strong> and <strong>Internal UUID</strong> fields are the same as for temporary extensions.</p>

<p>Just as it does with temporarily loaded extensions, the link next to <strong>Manifest URL</strong> opens the loaded manifest in a new tab.</p>

<div class="note">
<p><strong>Note: </strong>It's recommended that you use the Browser Toolbox, not the Add-on Debugger, for debugging WebExtensions. See <a href="/en-US/Add-ons/WebExtensions/Debugging">Debugging WebExtensions</a> for all the details.</p>
</div>

<p>The Add-ons section in about:debugging lists all web extensions that are currently installed. Next to each entry is a button labeled <strong>Inspect</strong>.</p>

<div class="blockIndicator note">
<p><strong>Note: </strong>This list may include add-ons that came preinstalled with Firefox.</p>
</div>

<p>If you click <strong>Inspect</strong>, the <a href="/en-US/docs/Mozilla/Add-ons/Add-on_Debugger">Add-on Debugger</a> will start in a new tab.</p>

<p>{{EmbedYouTube("efCpDNuNg_c")}}</p>

<p>See the page on the <a href="/en-US/docs/Mozilla/Add-ons/Add-on_Debugger">Add-on Debugger</a> for all the things you can do with this tool.</p>

<h2 id="Workers">Workers</h2>

<p>The Workers page shows your workers, categorised as follows:</p>

<ul>
 <li>All registered <a href="/en-US/docs/Web/API/Service_Worker_API">Service Workers</a></li>
 <li>All registered <a href="/en-US/docs/Web/API/SharedWorker">Shared Workers</a></li>
 <li>Other workers, including <a href="/en-US/docs/Web/API/ChromeWorker">Chrome Workers</a> and <a href="/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Dedicated_workers">Dedicated Workers</a></li>
</ul>

<p>You can connect the developer tools to each worker, and send push notifications to service workers.</p>

<p><img alt="" src="https://mdn.mozillademos.org/files/16657/about_debugging_workers.png" style="border: 1px solid black; display: block; height: 642px; margin-left: auto; margin-right: auto; width: 567px;"></p>

<h3 id="Service_worker_state">Service worker state</h3>

<p>The list of service workers shows the state of the service worker in its <a href="https://developers.google.com/web/fundamentals/instant-and-offline/service-worker/lifecycle">lifecycle</a>. Three states are possible:</p>

<ul>
 <li><em>Registering</em>: this covers all states between the service worker's initial registration, and its assuming control of pages. That is, it subsumes the <em>installing</em>, <em>activating</em>, and <em>waiting</em> states.</li>
 <li><em>Running</em>: the service worker is currently running. It's installed and activated, and is currently handling events.</li>
 <li><em>Stopped</em>: the service worker is installed and activated, but has been terminated after being idle.</li>
</ul>

<p><img alt="Screenshot of the debugging panel for a service worker that is in the Running state" src="https://mdn.mozillademos.org/files/16659/sample_service_worker.png" style="display: block; height: 237px; margin-left: auto; margin-right: auto; width: 556px;"></p>

<div class="note">
<p>This section uses a simple ServiceWorker demo, hosted at <a href="https://serviceworke.rs/push-simple/">https://serviceworke.rs/push-simple/</a>.</p>
</div>

<h3 id="Unregistering_service_workers">Unregistering service workers</h3>

<p>Click the <strong>Unregister</strong> button to unregister the service worker.</p>

<h3 id="Sending_push_events_to_service_workers">Sending push events to service workers</h3>

<p>To debug push notifications, you can set a breakpoint in the <a href="/en-US/docs/Web/API/PushEvent">push event</a> listener. However, you can also debug push notifications locally, without needing the server. Click the <strong>Push</strong> button to send a push event to the service worker.</p>

<h3 id="Service_workers_not_compatible">Service workers not compatible</h3>

<div>
<p>A warning message is displayed at the top of the <strong>This Firefox</strong> tab if service workers are incompatible with the current browser configuration, and therefore cannot be used or debugged.</p>

<p><img alt="" src="https://mdn.mozillademos.org/files/16655/worker_warning.png" style="display: block; height: 44px; margin: 0px auto; width: 551px;"></p>
</div>

<p>Service workers can be unavailable if the <code>dom.serviceWorkers.enable</code> preference is set to false in <code>about:config</code>.</p>