From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../debugging_firefox_desktop/index.html | 84 ++++++++++++ .../firefox_for_android/index.html | 146 +++++++++++++++++++++ files/ru/tools/remote_debugging/index.html | 46 +++++++ 3 files changed, 276 insertions(+) create mode 100644 files/ru/tools/remote_debugging/debugging_firefox_desktop/index.html create mode 100644 files/ru/tools/remote_debugging/firefox_for_android/index.html create mode 100644 files/ru/tools/remote_debugging/index.html (limited to 'files/ru/tools/remote_debugging') diff --git a/files/ru/tools/remote_debugging/debugging_firefox_desktop/index.html b/files/ru/tools/remote_debugging/debugging_firefox_desktop/index.html new file mode 100644 index 0000000000..89fc9d3890 --- /dev/null +++ b/files/ru/tools/remote_debugging/debugging_firefox_desktop/index.html @@ -0,0 +1,84 @@ +--- +title: Отладка Firefox Desktop +slug: Tools/Remote_Debugging/Debugging_Firefox_Desktop +tags: + - Debug + - Debugging + - Guide + - Tools + - Отладка +translation_of: Tools/Remote_Debugging/Debugging_Firefox_Desktop +--- +
{{ToolsSidebar}}

Это руководство объясняет, как использовать Инструменты разработчика Firefox для отладки различных версий десктопного Firefox, запущенного на том же компьютере. В этом документе экземпляр Firefox, который будет отлаживаться, назовём отлаживаемый(debuggee), а тот, с которого производится отладка - отлаживающий (debugger, отладчик).

+ +

Включение удалённой отладки

+ +

Во-первых, убедитесь, что в обоих Firefox (отлаживаемый и отлаживающий) установлены галочки "Включить удалённую отладку" (Enable remote debugging) и "Включить инструменты отладки browser chrome и дополнений" (Enable chrome and add-on debugging), которые находятся в настройках Инструментов разработчика Firefox. Если у вас используется Firefox Developer Edition, то галочки уже установлены по умолчанию.

+ +

Это потребуется сделать только однажды. После перезагрузки настройки сохранятся.

+ +

Запуск сервера отладчика

+ +

Далее нужно стартовать сервер отладчика в отлаживаемом Firefox.

+ +

До Firefox 37

+ +

До Firefox 37: открыть Панель разработчика и введите команду:

+ +
listen 6000
+ +

Это укажет отлаживаемому прослушивать клиентов-отладчиков на порту 6000. Кроме этого нигде больше не используйте порт 6000.

+ +

После перезагрузки нужно будет ввести команду заново.

+ +

После Firefox 37

+ +

Начиная с Firefox 37 и далее описанный метод работает, но есть другой: запустите отлаживаемый из командной строки, передав ему параметр --start-debugger-server:

+ +
/path/to/firefox --start-debugger-server
+ +

Без аргументов  параметр --start-debugger-server запустит прослушивание сервером 6000 порта. Для использования другого порта передайте его номер:

+ +
/path/to/firefox --start-debugger-server 1234
+ +

Отметьте: в Windows вызов start-debugger-server записывается с одним "минусом":

+ +
firefox.exe -start-debugger-server 1234
+ +
+

Примечание: По умолчанию и по соображениям безопасности включена (через about:config) опция devtools.debugger.force-local. Если нужно отлаживать Firefox с другого компьютера, то измените её, но только в безопасной сети или за файерволом, чтобы предотвратить несанкционированный доступ.

+
+ +

Подключение

+ +

Есть два способа подключения: "Экран подключения" и "WebIDE".

+ +

Экран подключения

+ +

На отлаживающем Firefox в меню "Разработка" есть пункт "Соединиться...". Кликните его и увидите страницу:

+ +

+ +

Введите номер порта,  заданный для отлаживаемого и нажмите "Connect". В отлаживаемом увидите диалог для подтверждения подключения:

+ +

Нажмите"OK" и вернитесь в отладчик. Появится такая страница:

+ +

+ + + +

WebIDE

+ +

На отлаживающем Firefox откройте WebIDE кликните "Select Runtime"/"Remote Runtime" (Удалённый Runtime):

+ +

Вас попросят предоставить имя компьютера и порт. Введите "localhost:6000" или другой номер порта, если прислушивается иной порт (смотря какой вы указали).

+ +

На отлаживаемом Firefox появится предупреждение:

+ +

Кликните OK. WebIDE подключится к главному процессу. Если вы захотите подключиться к вкладке, то в списке слева выберите нужную вкладку, которую будете отлаживать.

+ +

diff --git a/files/ru/tools/remote_debugging/firefox_for_android/index.html b/files/ru/tools/remote_debugging/firefox_for_android/index.html new file mode 100644 index 0000000000..6bcd7b2b47 --- /dev/null +++ b/files/ru/tools/remote_debugging/firefox_for_android/index.html @@ -0,0 +1,146 @@ +--- +title: Remotely debugging Firefox for Android +slug: Tools/Remote_Debugging/Firefox_for_Android +translation_of: Tools/Remote_Debugging/Firefox_for_Android +--- +
{{ToolsSidebar}}

This guide explains how to use remote debugging to inspect or debug code running in Firefox for Android over USB.

+ +
+

Мы недавно сильно упростили процесс подключения инструментов разработки к Firefox для Android. Если вы работаете с Firefox Desktop 36 или новее, и Firefox для Android 35 или новее, то попробуйте новый процесс вместо этого.

+
+ +

+ +

This guide's split into two parts: the first part, "Prerequisites" covers stuff you only need to do once, while the second part, "Connecting", covers stuff you need to do each time you connect the device. 

+ +

Prerequisites

+ +

First, you'll need:

+ + + +

ADB setup

+ +

Next, you'll need to get the desktop and the Android device talking to each other using the adb command-line tool.

+ +

On the Android device

+ + + +

On the desktop

+ + + +

To check it worked, open up a command shell on the desktop and type:

+ +
adb devices
+ +

You should see some output like:

+ +
List of devices attached
+51800F220F01564 device
+
+ +

(The long hex string will be different.)

+ +

If you do, then adb has found your device and you've successfully set up ADB.

+ +

Enable remote debugging

+ +

Next, you need to enable remote debugging on both the Android device and the desktop.

+ +

Firefox for Android 24 and earlier

+ +

To enable remote debugging on the device, you need to set the devtools.debugger.remote-enabled preference to true.

+ +

Go to about:config in Firefox for Android, type "devtools" into the search box and press the Search key. You'll see all the devtools preferences. Find the devtools.debugger.remote-enabled preference, and press "Toggle".

+ +

+ +

Firefox for Android 25 and later

+ +

On Firefox for Android 25 and later, there's a menu item to enable remote debugging. Open the menu, select "Settings", then "Developer tools" (on some Android devices you may need to select "More" to see the "Settings" option). Check the "Remote debugging" box:

+ +

+ +

The browser will display a notification reminding you to set up port forwarding, which we'll do later on.

+ +

On the desktop

+ +

On the desktop, remote debugging is enabled by a setting in the Toolbox. Open the Toolbox, click the "Settings" button in the toolbar, and check "Enable remote debugging" in the Settings tab:

+ +

+ +
If you're using a version of Firefox older than 27, you'll need to restart the browser for the setting to take effect.
+ +

You'll then see a new option in the Web Developer menu labeled "Connect...":

+ +

+ +

Connecting

+ +

Now you can connect the remote debugging tools to the device. First, attach the device to the desktop with a USB cable, if you haven't already.

+ +

On the desktop

+ +

For Firefox for Android 35 and later, go to a command prompt, and type:

+ +
adb forward tcp:6000 localfilesystem:/data/data/org.mozilla.firefox/firefox-debugger-socket
+ +

For Firefox for Android builds in other channels, the org.mozilla.firefox part should be changed to:

+ + + +

For Firefox for Android 34 and earlier, type:

+ +
adb forward tcp:6000 tcp:6000
+ +

(If you've changed the value the Android device uses for a debugging port, you'll need to adjust this accordingly.)

+ +

For Firefox OS, type:

+ +
adb forward tcp:6000 localfilesystem:/data/local/debugger-socket
+ +

You'll need to reissue this command each time you physically attach desktop and device with the USB cable.

+ +

Then go to the Web Developer menu on Firefox, and select "Connect...". You'll see a page that looks like this:

+ +

Unless you've changed the port numbers, choose 6000 and press the "Connect" button.

+ +

On the Android device

+ +

Next you'll see a dialog on the Android device asking you to confirm the connection:

+ +

Press "OK". The desktop waits for a few seconds to give you time to acknowledge this dialog: if it times out, just press "Connect" in the desktop dialog again.

+ +

On the desktop

+ +

Next, the desktop shows you a dialog that looks something like this:

+ +

This is asking whether you want to debug web content running in a browser tab, or to debug the browser code itself.

+ + + +

Let's choose to attach to the mozilla.org website. The Toolbox will open in its own window, attached to the Firefox for Android tab that's currently hosting mozilla.org:

+ +

+ +

The Toolbox, and the tools it hosts, work in just the same way as they do when attached to local content.

diff --git a/files/ru/tools/remote_debugging/index.html b/files/ru/tools/remote_debugging/index.html new file mode 100644 index 0000000000..85483004df --- /dev/null +++ b/files/ru/tools/remote_debugging/index.html @@ -0,0 +1,46 @@ +--- +title: Отладка удалённых скриптов +slug: Tools/Remote_Debugging +tags: + - Tools + - 'l10n:priority' + - Отладка + - инструменты +translation_of: Tools/Remote_Debugging +--- +
{{ToolsSidebar}}

Вы можете использовать Инструменты разработчика Firefox на вашем компьютере для отладки веб-сайтов и веб-приложений, запущенных в других браузерах или программах. Другие браузеры могут быть на том же устройстве, где запущены Инструменты, или же на другом, например, на телефоне, подключенном через USB.

+ +

Конкретные инструкции по подключению Инструментов специфичны для каждой из сред.

+ +

Среды выполнения, основанные на Gecko

+ +

В первую очередь можете подключить Инструмены разработчика к Gecko-программам, таких как Firefox Desktop, Firefox для Android, Firefox OS или Thunderbird.

+ + + +

Другие варианты сред

+ +

Экспериментальное дополнение Valence позволяет отлаживать веб-сайты в средах выполнения отличных от Gecko, например, Google Chrome Desktop, Chrome для Android или Safari на iOS.

+ +

Valence по умолчанию включен в Firefox Developer Edition.

+ + -- cgit v1.2.3-54-g00ecf