From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- files/id/tools/accessibility_inspector/index.html | 196 +++++++++ files/id/tools/debugger/index.html | 49 +++ files/id/tools/index.html | 189 +++++++++ files/id/tools/page_inspector/how_to/index.html | 13 + files/id/tools/page_inspector/index.html | 53 +++ files/id/tools/remote_debugging/index.html | 34 ++ files/id/tools/webide/index.html | 458 ++++++++++++++++++++++ files/id/tools/webide/troubleshooting/index.html | 117 ++++++ 8 files changed, 1109 insertions(+) create mode 100644 files/id/tools/accessibility_inspector/index.html create mode 100644 files/id/tools/debugger/index.html create mode 100644 files/id/tools/index.html create mode 100644 files/id/tools/page_inspector/how_to/index.html create mode 100644 files/id/tools/page_inspector/index.html create mode 100644 files/id/tools/remote_debugging/index.html create mode 100644 files/id/tools/webide/index.html create mode 100644 files/id/tools/webide/troubleshooting/index.html (limited to 'files/id/tools') diff --git a/files/id/tools/accessibility_inspector/index.html b/files/id/tools/accessibility_inspector/index.html new file mode 100644 index 0000000000..ded237c344 --- /dev/null +++ b/files/id/tools/accessibility_inspector/index.html @@ -0,0 +1,196 @@ +--- +title: Accessibility Inspector +slug: Tools/Accessibility_inspector +tags: + - Aksesibilitas + - Alat + - DevTools + - Inspektur Aksesibilitas + - Panduan +translation_of: Tools/Accessibility_inspector +--- +
{{ToolsSidebar}}
+ +

The Accessibility Inspector (Inspektur Akesibilitas) menyediakan sebuah sarana untuk mengakses informasi penting terbuka untuk teknologi bantu di dalam halaman ini lewat pohon aksesibilitas, memperbolehkan anda untuk cek apa yang hilang atau jika tidak butuh perhatian. Artikel ini membawamu melewati fitur utama dari Accessibility Inspector (Inspektur Aksesibilitas) dan bagaimana menggunakannya.

+ +

Sebuah panduan yang (sangat) singkat untuk aksesibilitas

+ +

Accessibility (Aksesibilitas) adalah latihan untuk membuat website anda dapat digunakan oleh sebanyak mungkin orang . Ini berarti mencoba yang terbaik dari kamu untuk tidak mengunci siapapun untuk mengakses informasi karena kecacatan yang mungkin mereka miliki, atau keadaan pribadi seperti perangkat yang mereka gunakan, kecepatan dari koneksi jaringan mereka, atau geografis lokasi mereka atau lokal. Kamu dapat mencari informasi lebih luas di dalam bagian Accessibility (Aksesibilitas)  dalam Dokumen Web MDN.

+ +

Di sini kita terutama berbicara tentang mengekspos informasi kepada orang-orang dengan cacat visual - ini dilakukan melalui accessibility APIs (API aksesibilitas) yang tersedia di dalam web browser, yang memaparkan informasi tentang peran elemen-elemen yang berbeda di halaman Anda (misalnya, apakah mereka hanya teks, atau apakah mereka tombol, tautan, elemen formulir, dll?).

+ +

Semantic DOM elements have roles assigned to them by default that hint at what their purpose is. Sometimes, however, you need to use some non-semantic markup (e.g., {{htmlelement("div")}}s) to build a complex custom control, and the control won't have a default role that reflects its purpose. In such a situation, you can use WAI-ARIA role attributes to provide your own roles.

+ +

Roles and other information exposed by browser accessibility APIs are presented in a hierarchical structure called the accessibility tree. This is a bit like the DOM tree, except that it contains a more limited set of elements and slightly different information about them.

+ +

Assistive technologies like screenreaders use this information to find out what's on a web page, tell their users what's there, and enable them to interact with the page. The Accessibility Inspector also uses this information to provide valuable accessibility debugging capabilities in the DevTools.

+ +

Accessing the Accessibility Inspector

+ +

The Accessibility Inspector is available by default since Firefox 63:

+ +

Accessibility tab in firefox devtools, turned off, with a button labeled Turn On Accessibility Features

+ +

Initially, the DevTools accessibility features are turned off (unless you've already got them turned on in another browser tab, or got the Firefox accessibility engine started already, e.g., you might be a screenreader user or tester). This is because the accessibility engine runs in the background when the accessibility features are turned on. While it’s running, it slows performance and takes up memory; therefore it interferes with the metrics from other panels such as Memory and Performance as well as overall browser performance. For this reason, you should keep it turned off when you aren't specifically using it.

+ +

You can turn the features on using the Turn On Accessibility Features button.

+ +

Once the panel content loads, you can then turn it off again using the Turn Off Accessibility Features button available in the top-left corner, unless you have the accessibility engine running previously to operate a screenreader, in which case this button will be disabled.

+ +
+

Note: If you are using the accessibility features in multiple tabs, turning them off in one tab turns them off in all tabs.

+
+ +

Features of the Accessibility panel

+ +

The enabled accessibility panel looks like so:

+ +

Accessibility tab in firefox devtools, turned on, showing two information panels plus a button labelled Turn Off Accessibility Features

+ +

On the left-hand side, there is a tree diagram representing all the items in the accessibility tree for the current page. Items with nested children have arrows that can be clicked to reveal the children, so you can move deeper into the hierarchy. Each item has two properties listed:

+ + + +

On the right-hand side, you can see further information about the currently selected item. The listed properties are as follows:

+ + + +
+

Note: The exposed information is the same across all platforms — the inspector exposes Gecko's accessibility tree, rather than information from the platform accessibility layer.

+
+ +

Keyboard controls

+ +

The Accessibility tab is fully keyboard-accessible:

+ + + + + +

You can print the contents of the accessibility tree to json by right-clicking on an entry in the Accessibility tab and selecting Print to JSON:

+ +

+ +

When you do, you will get a new tab with the selected accessibility tree loaded into the JSON viewer:

+ +

+ +

Once opened, you can save or copy the data as necessary. The JSON viewer can also show you the raw JSON data on a separate tab in the viewer.

+ +

Check for accessibility issues

+ +

You can check for accessibility issues by clicking the drop-down menu next to: Check for issues. The available menu items include:

+ + + +

When you one of the menu items, Firefox scans your document for the type of issues you selected. Depending on the size and complexity of your document, this may take a few seconds. When the scan is complete, the left side of the Accessibility Inspector panel displays only the items that have that type of issue. In the right side of the panel, the Checks subpanel lists the specific issue with the selected node. For each type of issue, there is a Learn more link to further information on MDN Web Docs about the issue.

+ +

Check for "all" issues, with "contrast" and "text labels" selected

+ +

The menu items act as toggles. Select the item to view that type of issue; select the item again to clear the display of issues of that type.

+ +

Issues with a particular item are always displayed in the Checks subpanel as you browse the tree. The Check for issues buttons are a quick way to view all and only those items that have issues.

+ + + +

When the accessibility features are turned on, there are a number of useful additional features available in the DevTools, which are detailed below:

+ +

Context menu options

+ +

An extra context menu option is added, both for the general context menu on the web page when right/Ctrl + clicking a UI feature, and the HTML pane of the page inspector when right/Ctrl + clicking a DOM element:

+ +

context menu in the browser viewport, with a highlighted option: Inspect Accessibility Properties

+ +

context menu in the DOM inspector, with a highlighted option: Show Accessibility Properties

+ +

When you choose the Inspect Accessibility Properties/Show Accessibility Properties context menu options, the Accessibility tab is immediately opened to show the corresponding accessibility tree item and its properties.

+ +
+

Note: Some DOM elements do not have accessibility properties — in that case, the Inspect Accessibility Properties/Show Accessibility Properties context menu item is grayed out.

+
+ +

Highlighting of UI items

+ +

In the Accessibility tab, when the mouse hovers over accessibility items, you can see a semi-transparent highlight appear over the UI items they relate to, if appropriate. The role and name of the item will be shown in a small information bar along with color contrast information if appropriate. This is useful for determining how the items in the accessibility tree relate to the UI items on the actual page.

+ +

In the following example, you can see that the image has been highlighted and its role, graphic, name, "Road, Asphalt, Sky, Clouds, Fall", and the color contrast ratio, 3.46, appears in the information bar above it.

+ +

+ +

Color contrast

+ +

Contrast ratio information is particularly useful when you are designing the color palette for your website because if the contrast is not sufficient, readers with visual impairments such as low vision or color blindness will be unable to read the text. See Color contrast for details about recommended contrast ratios.

+ +

For example:

+ +

A screenshot of colour contrast highlighter where text contrast if below the AA WCAG threshold.

+ +

The color contrast in the image above is 2.86, so potentially not enough contrast to make it easy to read. Notice the warning symbol that indicates that the contrast fails to meet the acceptable contrast ratio.

+ +

As of Firefox 65, viewing this information for some foreground text that has a complex background image (e.g. a gradient) gives you a range of color contrast values. For example:

+ +

A screenshot of colour contrast highlighter where for text over gradient background with contrast satisfying the AAA WCAG guidelines.

+ +

In this example, the contrast ranges from 4.72 to 5.98. The numbers are followed by AAA and a checkmark in green, indicating that the large text has a contrast ratio of 4.5:1 or more, meeting the criteria for enhanced contrast, or Level AAA.

+ +

See Color contrast for more information on color contrast.

+ +

Accessibility picker

+ +

Like the element picker button on the Page Inspector, the Accessibility tab's element picker button allows you to hover and select UI items on the current page  highlight objects in the accessibility tree.

+ +

The accessibility tab element picker looks slightly different from the Page Inspector HTML pane picker, as shown below:

+ +

highlighted dom inspector picker button, with a tooltip saying Pick an element from the page

+ +

highlighted accessibility inspector button, with a tooltip saying Pick accessible object from the page

+ +

When you "perform a pick", you see the accessibility object highlighted in the accessibility tree, and the picker is then deactivated. Note, however, that if you hold the Shift key down when "performing a pick", you can "preview" the accessibility object in the tree (and its properties in the right-hand pane), but then continue picking as many times as you like (the picker does not get cancelled) until you release the Shift key.

+ +

When the picker is activated, you can also deactivate it by pressing the picker button a second time, or pressing the Esc key.

+ +

Typical use cases

+ +

The Accessibility Inspector is very useful for spotting accessibility problems at a glance. For a start, you can investigate items that don't have a proper text equivalent — images without alt text and form elements without proper labels have a name property of null, for example.

+ +

A form input highlighted in the UI, with information about it shown in the accessibility inspector to reveal that it has no label — it has a name property of null

+ +

It is also very handy for verifying semantics — you can use the Inspect Accessibility Properties context menu option to quickly see whether an item has the correct role set on it (e.g., whether a button is really a button, or a link is really a link).

+ +

A UI element that looks like a button, with information about it shown in the accessibility inspector to reveal that it isn't a button, it is a section element. It has a name property of null

+ +

See also

+ + diff --git a/files/id/tools/debugger/index.html b/files/id/tools/debugger/index.html new file mode 100644 index 0000000000..c1f0d2c11e --- /dev/null +++ b/files/id/tools/debugger/index.html @@ -0,0 +1,49 @@ +--- +title: Debugger +slug: Tools/Debugger +translation_of: Tools/Debugger +--- +
{{ToolsSidebar}}

The JavaScript Debugger enables you to step through JavaScript code and examine or modify its state to help track down bugs.

+ +

You can use it to debug code running locally in Firefox or running remotely, for example in a Firefox OS device or Firefox on Android. See remote debugging to learn how to connect the debugger to a remote target.

+ +

{{EmbedYouTube("sK8KU8oiF8s")}}

+ +
+

User Interface Tour

+ +

To find your way around the debugger, here's a quick tour of the UI.

+ +
+

How to

+ +

To find out what you can do with the debugger, see the following how-to guides:

+ +
+ +
+ +
+

Reference

+ +
+ +
diff --git a/files/id/tools/index.html b/files/id/tools/index.html new file mode 100644 index 0000000000..1b8f7b5fa8 --- /dev/null +++ b/files/id/tools/index.html @@ -0,0 +1,189 @@ +--- +title: Alat +slug: Tools +tags: + - Mengembangkan Mozilla + - Panduan + - Pengembangan Web + - 'Pengmbang Web: Alat' +translation_of: Tools +--- +

Uji, ubah, dan debug HTML, CSS, dan JavaScript di desktop dan di ponsel.

+ + + +
+
+
+ +
+

+ +

Untuk alat dan fitur terbaru, cobalah Firefox Edisi Pengembang, Cobalah Firefox Developer Edition.

+ +

Unduh Firefox Developer Edition

+
+
+ +

Peralatan Inti

+ +
+
+

Pemeriksa Laman

+ +

The all-new Inspector panel in Firefox 57.

+ +

Lihat dan ubah konten dan tata letak laman. Visualisasikan banyak aspek laman termasuk box model, animasi dan tata letak grid.

+
+ +
+

Konsol Web

+ +

The all-new Console in Firefox 57.

+ +

Lihat pesan yang dicatat oleh laman web dan interaksi dengan laman menggunaan JavaScript.

+
+
+ +
+
+

Pen-debug   JavaScript

+ +

The all-new Firefox 57 Debugger.html

+ +

Berhenti, melangkah melalui, uji, dan modifikasi JavaScript yang berjalan dalam sebuah laman.

+
+ +
+

Monitor Jaringan

+ +

The Network panel in Firefox 57 DevTools.

+ +

Lihat permintaan jaringan yang dibuat ketika sebuah laman dimuat.

+
+
+ +
+
+

Alat Kinerja

+ +

+ +

Analisa kinerja responsif, JavaScript, dan tata letak situs Anda.

+
+ +
+

Mode Desain Responsif

+ +

Responsive Design mode in Firefox 57.

+ +

Lihat bagaimana situs atau aplikasi Anda akan terlihat dan berperilaku pada perangkat dan jenis jaringan yang berbeda.

+
+
+ +
+

Alat Lainnya

+ +

Alat pengembang ini juga dibuat ke dalam Firefox. Tidak seperti "Alat Inti" di atas, mungkin Anda tidak menggunakannya setiap hari.

+ +
+
+
Memori
+
Cari tahu objek mana yang sedang menyimpan memori yang digunakan.
+
Pemeriksa Penyimpanan
+
Memeriksa kuki, penyimpan lokal, indexedDB, dan Inspect cookies, local storage, indexedDB, dan penyimpanan sesi kini pada sebuah laman.
+
DOM Property Viewer
+
Memeriksa properti DOM laman, fungsi, dan lain-lain.
+
Toolbar Pengembang
+
Sebuah antarmuka command-line untuk alat pengembang.
+
Eyedropper
+
Memilih warna dari laman.
+
Scratchpad
+
Sebuah editor teks yang dibuat ke dalam Firefox yang  memungkinkan Anda menulis dan menjalankan JavaScript
+
Editor Gaya
+
Tinjau dan ubah gaya CSS untuk halaman saat ini.
+
Shader Editor
+
Tinjau dan edit vertex dan fragment shaders yang digunakan oleh WebGL.
+
Editor Audio Web
+
Periksa grafik dari node audio dalam kontek audio, dan modifikasi parameternya.
+
Mengambil tangkapan layar
+
Mengambil sebuah tangkapan layar dari keseluruhan laman atau dari sebuah elemen tunggal.
+
Mengukur sebagian laman
+
Mengukur area tertentu pada sebuah laman web.
+
Rulers (Penggaris)
+
Penggaris sepanjang horizontal dan vertikal pada sebuah laman web.
+
+
+ +
+

Menghubungkan Alat Pengembang

+ +

Jika Anda membuka alat pengembang menggunakan pintasan keyboard atau or item menu yang sama, mereka akan menargetkan dokumen yang telah di-host oleh tab yang sedang aktif. Tetapi Anda bisa memasang alat ke berbagai target lain, juga di dalam peramban saat ini dan di berbagai peramban atau bahkan perangkat yang berbeda.

+ +
+
+
about:debugging
+
Men-debug pengayas, tab konten, dan pekerja yang berjalan di peramban.
+
Menghubungan ke Firefox untuk Android
+
Menghubungkan alat pengembang ke sebuah instance dari Firefox yang berjalan pada sebuah perangkat Android.
+
Menghubungkan ke iframes
+
Menghubungkan alat pengembang ke sebuah iframe tertentu pada laman saat ini
+
Menghubungkan ke peramban lain
+
Menghubungkan alat pengembang ke Chrome pada Android dan Safari pada iOS.
+
+
+ +
+

Men-debug peramban

+ +

Secara default, alat pengembang dilampirkan ke laman web atau aplikasi web. Tetapi Anda bisa juga menghubungkan mereka ke peramban secara keseluruhan. Ini berguna untuk pengembangan peramban dan pengayas.

+ +
+
+
Konsol Peramban
+
Lihat pesan yang dicatat oelh peramban itu dan oleh pengaya, dan jalankan kode JavaScript di linkup peramban.
+
Kotak Perkakas Peramban
+
Menyematkan alat pengembang ke peramban itu sendiri.
+
+
+ +
+

Memperluas  devtools

+ +

Alat pengembang dirancang agar dapat diperluas. Pengaya Firefox dapat mengakses alat pengembang dan komponen yang mereka gunakan untuk memperluas alat yang ada dan menambahkan alat yang baru. Dengan protokol men-debug jarak jauh, Anda dapat menerapkan men-debug klien dan server Anda sendiri, memungkinkan Anda men-debug situs web menggunakan alat Anda sendiri atau untuk men-debug berbagai sasaran menggunakan alat Firefox.

+ +
+
+
Contoh pengaya alat pengembang
+
Gunakan contoh-contoh ini untuk memahami bagaimana untuk menerapkan pengaya alat pengembang.
+
Menambah sebuah panel baru ke alat pengembang
+
Menulis sebuah pengaya yang menambah sebuah panel baru ke Kotak perkakas.
+
Protokol Men-debug Jarak Jauh
+
Protokol digunakan untuk mengkoneksi Alat Firefox Developer Tools untuk sebuah target men-debug seperti instance dari perangkat Firefox atau Firefox OS.
+
Peubah Sumber
+
Sebuah editor kode di buat kedalam Firefox yang bisa disematkan ke pengaya Anda.
+
Antarmuka Debugger
+
Sebuah API yang memungkinkan kode JavaScript mengemati eksekusi dari kode JavaScript yang lain. Alat Pengembang Firefox menggunakan API untuk menerapakan pen-debug JavaScript.
+
Konsol Web keluaran kustom
+
Bagaimana memperluas keluaran dari Konsol Web dan Konsol Peramban.
+
+
+ +
+

Migrasi dari Firebug

+ +

Firebug akan sampai pada akhir masa pakainya (lihat Firebug tinggal di Firefox DevTools untuk lebih jelasnya mengapa), dan kita menghargai bahwa beberapa orang akan merasa migrasi ke set alat pengembang yang kurang terkenal akan menjadi menantang. Untuk memudahkan transisi dari Firebug ke alat pengembang Firefox, kami telah menulis panduan praktis — Migrasi dari Firebug.

+ +
+

Kontribusi

+ +

Jika Anda ingin untuk membantu mengembangkan alat pengembang, sumber daya ini akan membantu Anda untuk memulai.

+ +
+
+
Ikut Terlibat
+
Halaman wiki Mozilla menjelaskan bagaimana caranya untuk terlibat.
+
firefox-dev.tools
+
Sebuah alat yang membantu mencari bugs untuk dikerjakan.
+
+
diff --git a/files/id/tools/page_inspector/how_to/index.html b/files/id/tools/page_inspector/how_to/index.html new file mode 100644 index 0000000000..2f18038ec9 --- /dev/null +++ b/files/id/tools/page_inspector/how_to/index.html @@ -0,0 +1,13 @@ +--- +title: How to +slug: Tools/Page_Inspector/How_to +tags: + - NeedsTranslation + - TopicStub +translation_of: Tools/Page_Inspector/How_to +--- +
{{ToolsSidebar}}

Links for various HOW TO's can be found here. These links describe in depth the HOW TO techniques.

+ +

{{ ListSubpages () }}

+ +

 

diff --git a/files/id/tools/page_inspector/index.html b/files/id/tools/page_inspector/index.html new file mode 100644 index 0000000000..68f6b614ec --- /dev/null +++ b/files/id/tools/page_inspector/index.html @@ -0,0 +1,53 @@ +--- +title: Page Inspector +slug: Tools/Page_Inspector +tags: + - CSS + - HTML + - Tools + - Web Development +translation_of: Tools/Page_Inspector +--- +
{{ToolsSidebar}}

Gunakan peninjau halaman untuk melihat dan memodifikasi HTML dan CSS dari sebuah halaman.

+ +

Anda bisa melihat atau memeriksa halaman yang telah dimuat pada salinan lokal di firefox, atau pada remote target seperti pada perangkat Firefox OS atau firefox untuk android. Lihat remote debugging untuk mempelajari bagaimana cara menghubungkan developer tools pada sebuah remote target.

+ +
+

Mempelajari Antarmuka Pengguna

+ +

Untuk mengetahui cara menggunakan inspector/Peninjau, berikut tur singkat dari UI.

+ +
+

Paduan

+ +

Untuk mengetahui apasaja yang anda bisa lakukan dengan inspector, lihat paduan berikut:

+ +
+ +
+ +
+

Referensi

+ +
+ +
diff --git a/files/id/tools/remote_debugging/index.html b/files/id/tools/remote_debugging/index.html new file mode 100644 index 0000000000..a917c007b1 --- /dev/null +++ b/files/id/tools/remote_debugging/index.html @@ -0,0 +1,34 @@ +--- +title: Remote Debugging +slug: Tools/Remote_Debugging +tags: + - NeedsTranslation + - TopicStub +translation_of: Tools/Remote_Debugging +--- +
{{ToolsSidebar}}

You can use the Firefox developer tools on your desktop to debug code running remotely: in a different process on the same device or on a completely different device. To do this you use Firefox to attach the Toolbox to the remote process, and the Toolbox is then launched in its own window. At the moment the following tools support remote debugging:

+ + + +

Firefox for Android

+ +

Remotely debugging Firefox for Android describes how to connect to Firefox on an Android device over USB.

+ +

Firefox for Metro

+ +

Remotely debugging Firefox for Metro describes how to use desktop Firefox to debug code running in Windows 8 (Metro-style) Firefox.

+ +

Firefox OS

+ +

Using the App Manager includes instructions for connecting the Firefox developer tools to the Firefox OS simulator or to a Firefox OS device.

+ +

Thunderbird

+ +

Remotely debugging Thunderbird explains how a combination of Firefox and Thunderbird can be used to debug code running in Thunderbird.

diff --git a/files/id/tools/webide/index.html b/files/id/tools/webide/index.html new file mode 100644 index 0000000000..3cf3b7bf2b --- /dev/null +++ b/files/id/tools/webide/index.html @@ -0,0 +1,458 @@ +--- +title: WebIDE +slug: Tools/WebIDE +translation_of: Archive/WebIDE +--- +
{{ToolsSidebar}}
+

WebIDE is available from Firefox 34 onwards.

+
+ +
+

WebIDE is the replacement for the App Manager. Like the App Manager, it enables you to run and debug Firefox OS apps using the Firefox OS Simulator or a real Firefox OS device.

+ +

However, it also provides an editing environment for you to create and develop Firefox OS apps, including a tree view of all the files in your app with the ability to edit and save them, and two app templates to help you get started.

+ +

Finally, WebIDE enables you to connect the Firefox Developer Tools to a number of other browsers, including Firefox for Android, Chrome on Android, and Safari on iOS. See the Remote Debugging page for instructions on how to connect to a specific browser.

+
+ +

With WebIDE, you first set up one or more runtimes. A runtime is an environment in which you'll run and debug the app. A runtime could be a Firefox OS device connected to the desktop over USB, or it could be a Firefox OS Simulator installed on the desktop itself.

+ +

Next, you create an app, or open an existing app. If you're creating a new app you start with a template that includes the directory structure and the minimum boilerplate you need to get started, or a more complete template that shows how to use a privileged API. WebIDE shows your app's files in a tree, and you can edit and save them using a built-in source editor. Of course, you don't have to use the built-in editor: you can develop your app entirely outside WebIDE, and only use it for debugging.

+ +

Finally, you can install the app in one of the runtimes and run it. You can then open the usual suite of developer tools - the Inspector, Console, JavaScript Debugger and so on - to examine and modify the running app.

+ +

System requirements

+ +

To develop and debug apps using WebIDE, all you need is Firefox version 33 or later. To test on a real Firefox OS device, you need a device running Firefox OS 1.2 or later, and a USB cable.

+ +

You can only use WebIDE for Firefox OS if you're targeting Firefox OS 1.2 or later.

+ +

Opening WebIDE

+ +

There are three ways to open WebIDE:

+ + + +

+ +

Here's what the WebIDE looks like:The dropdown on the left labeled "Open App" lets you open existing apps or create new ones. The dropdown on the right labeled "Select Runtime" lets you select a runtime or set up a new runtime.

+ +

The buttons in the middle run, stop, and debug the app: they are only enabled when you have opened an app and selected a runtime.

+ +

From Firefox 36, you can change the font size throughout WebIDE using the standard keyboard shortcuts (use Command instead of Control on OS X):

+ + + +

Setting up runtimes

+ +

Under the "Select Runtime" dropdown, runtimes are grouped into three types:

+ + + +

The first time you click the dropdown, you might not see any runtimes here:

+ +

The rest of this section describes how you can add some runtimes.

+ +

Connecting a Firefox OS device

+ +

Before you can connect a Firefox OS device, there's some setup you have to go through:

+ + + +
+

Linux only:

+ + +
+ +
+

Windows only:

+ + +
+ +

If there are any other Android devices connected to your computer, disconnect them. Now connect the device to the computer using USB. You should see the device appear under "USB DEVICES":

+ +

+ +

If you don't see your device, see the Troubleshooting page.

+ +

Connecting to Firefox for Android

+ +

From Firefox 36 onwards Android devices connected over USB and running Firefox for Android appear as a runtime under "USB devices". See the article on connecting to Firefox for Android from WebIDE.

+ +

Before Firefox 36, you can connect to Firefox for Android without using WebIDE at all, or can use WebIDE by setting up a custom remote runtime.

+ +

Adding a Simulator

+ +

The Firefox OS Simulator is a version of the higher layers of Firefox OS that simulates a Firefox OS device, but runs on the desktop. It runs in a window the same size as a Firefox OS device, includes the Firefox OS user interface and built-in apps, and simulates many of the Firefox OS device APIs.

+ +

This means that in many cases, you don't need a real device to test and debug your app.

+ +

The Simulator is big, so it doesn't ship inside Firefox but as a Firefox add-on. If you click "Install Simulator" in the Runtimes dropdown menu, you will go to a page from which you can install Simulators for various versions of Firefox OS.

+ +

You can install as many as you like. Be patient, though: the Simulator is large and may take a few minutes to download. Once you've installed some Simulators you can close this "Extra Components" window, and the Simulators you've installed appear as options in the Runtimes dropdown menu:

+ +

To learn more about the Simulator, see its documentation page.

+ +

Custom runtimes

+ +

Remote runtime

+ +

With a custom remote runtime you can use an arbitrary hostname and port to connect to the remote device.

+ +

Under the hood, Firefox OS devices and Android devices connect to the desktop using a program called the Android Debug Bridge, or ADB. By default, WebIDE uses an add-on called the ADB Helper: this simplifies the process for you by installing ADB and setting up port forwarding so the Firefox desktop tools can exchange messages with the device.

+ +

This is convenient in most cases, but sometimes you might want to use ADB outside of WebIDE: for example, you might be running ADB directly from the command line. In that case you'll connect to the device by specifying a host and port using the adb forward command (example: adb forward tcp:6000 localfilesystem:/data/local/debugger-socket).
+
+ If you then want to use WebIDE to connect as well, you should disable the ADB Helper add-on and connect WebIDE using the Custom runtime option, entering the host and port that you passed to adb forward (example: localhost:6000).

+ +

Also, before Firefox 36, the ADB Helper does not yet support connecting to Firefox for Android, so if you want to connect WebIDE to Firefox for Android, you'll need to set up your own port forwarding and use a custom runtime. See more about connecting to Firefox for Android using ADB prior to Firefox 36.

+ +

Valence-enabled runtimes

+ +

If you have the Valence add-on installed, you'll see three additional runtimes:

+ + + +

For instructions on how to connect to these runtimes, see the relevant entry in the Remote Debugging page.

+ +

Selecting a runtime

+ +

Once you've set up a runtime you can select it using the "Select Runtime" menu.

+ + + +

Now the "play" button in the center of the WebIDE toolbar is enabled: click it to install and run the app in the selected runtime.

+ +

Runtime menu items

+ +

When a runtime is selected, the Runtimes dropdown menu has up to five extra items:

+ +
+
Runtime Info
+
Information on the current runtime
+
Permissions Table
+
A table summarising app permissions for the current runtime, indicating, for each API and each app type, whether access is allowed (✓), denied (✗), or whether the user is prompted (!)
+
+ +
+
Device Preferences
+
A table listing, and letting you edit, the preferences that are made available in the runtime via the Preferences service. These are platform-level configuration values exposing the same set of data as Firefox's about:config (but for the device). Because these preferences are highly security-sensitive, you need to disable the DevTools restricted privileges setting before you can modify them.
+
Device Settings (new in Firefox 38/Firefox OS 3)
+
A table listing, and letting you edit, the settings that can be controlled in the Firefox OS Settings app. Most things on the device which have a UI control to change (volume, alarm, etc.) are found in Device Settings. Because these settings are less sensitive than the device preferences, you can modify them without removing the restricted privileges setting. However, since this feature is new in Gecko 38 you need the WebIDE in Firefox 38 and a nightly build of Firefox OS or the Simulator.
+
Screenshot
+
A command to take a screenshot from the runtime.
+
+ +

+ +

 

+ +

Creating and opening apps

+ +

Under the "Open App" menu you get three options: create a new app, open a packaged app, and open a hosted app:

+ +

+ +

Create a new app

+ +

Select "New App..." to create a new app. You'll see a dialog offering you a choice between two templates, "Privileged Empty App" and "Privileged App".

+ +

+ +

Both templates are from Mozilla's app template collection, and provide you with the basic structure you need to get started. The "Privileged App" shows how an app can use permissions to load cross-origin content.

+ +

Once you've selected a template you'll be asked to name the app and select a directory to store the files, and then the new app is opened in the project editor.

+ +

Open a packaged app

+ +

Select "Open Packaged App..." to open a packaged app. You'll be asked to select a directory containing the app's manifest, and the app will be opened in the project editor.

+ +

Open a hosted app

+ +

Select "Open Hosted App..." to open a hosted app. You'll be asked to enter a URL pointing to the app's manifest, and the app will be opened in the project editor.

+ +

Editing apps

+ +

The project editor provides an environment for editing apps. There's a tree view on the left of all the files in the app: you can add and delete files here using a context menu. There's an editor pane on the right.

+ +

The app summary page

+ +

When you first open or create an app, the editor pane is occupied by the app summary page, which is shown below:

+ +

+ +

You can always get back to the app summary page by clicking on the root of the tree on the left.

+ +

Manifest validation

+ +

WebIDE automatically checks the manifest for certain common problems. If it finds a problem it indicates that the app is invalid and describes the problem in the app's summary:

+ +

+ +

Of course, you can edit the manifest.webapp file right in the project editor as well.

+ +

The source editor

+ +

WebIDE uses the CodeMirror source editor.

+ +

Source editor shortcuts

+ +

{{ Page ("en-US/docs/tools/Keyboard_shortcuts", "source-editor") }}

+ +

Code completion

+ +

When editing CSS and JavaScript, the editor provides autocomplete suggestions. CSS autocompletion is always enabled:

+ +

To display autocomplete suggestions in JavaScript press Control + Space:

+ +

+ +

Inline documentation

+ +

The editor also shows inline documentation for JavaScript. Press Shift + Space to see a popup containing documentation for the symbol your cursor is on:

+ +

+ +

Clicking the [docs] link in the popup will take you to the MDN page for the symbol.

+ +

Saving files

+ +

For changes to your files to take effect you need to save them. Files with unsaved changes get an asterisk next to their name in the tree view, and you can save files using the menu or Control+S (Command+S on Mac OS X).

+ +

Removing projects

+ +

To remove an app from WebIDE, go to the app summary page and click "Remove Project".

+ +

Running a custom build step

+ +
+

New in Firefox 37.

+
+ +

For some use cases you need to run a custom command before pushing your app to the device. For example, you might want to satisfy JavaScript dependencies or minify CSS, or use WebIDE to develop Gaia apps or Cordova apps, both of which require a custom build step.

+ +

From Firefox 37 you can do this by including a file called "package.json" in the root of your app. This is the same file that's used to package a node.js library, so you might already have one in the root of your project. If you don't, you can create one for this purpose.

+ +

Inside package.json, WebIDE looks for a property called "webide". The table below summarises the syntax of "webide":

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
webide   +

Object containing instructions for WebIDE.

+ +

This may contain two properties, both optional: "prepackage" and "packageDir".

+
 prepackage  +

Specifies a command-line command for WebIDE to run before pushing the app to the runtime.

+ +

This may be a string, in which case the command is just executed as-is, or may be an object which must contain "command", and may contain any of "env", "args", and "cwd".

+
  command +

The command to execute in the command shell.

+ +

For example: "echo".

+
  env +

Any environment variables to set.

+ +

This is specified as an array of strings in the form "NAME=value". For example: ["NAME=world"]

+
  args +

Any arguments to pass along with the command.

+ +

This is specified as an array of strings.

+
  cwd +

The directory from which to run the command.

+ +

This may be absolute or relative to the current directory.

+
 packageDir  +

The directory from which WebIDE should look for the app to push to the runtime.

+ +

Use this if you want the project in WebIDE to be the source from which to build a packaged app. The build step specified in prepackage would place the built app in an output directory, you will specify the output directory in packageDir, and WebIDE will install the app from that output directory rather than the project directory.

+ +

This property is optional, and if it's omitted WebIDE will package the app from the project root, just as if package.json was omitted.

+
+ +

Examples

+ +

A "package.json" to build a Gaia app:

+ +
{
+  "webide": {
+    "prepackage": {
+      "command": "make",
+      "env": ["APP=settings"],
+      "cwd": "../.."
+    },
+    "packageDir": "../../build_stage/settings/"
+  }
+}
+ +

A "package.json" for working with Cordova:

+ +
{
+  "webide": {
+    "prepackage": "cordova prepare",
+    "packageDir": "./platforms/firefoxos/www"
+  }
+}
+ +

Running and debugging apps

+ +

When you're ready to run the app, you need to select a runtime from the "Select Runtime" dropdown menu. If you don't have any available runtimes here, find out how to add some in Setting up runtimes.

+ +

The "play" button in the center of the WebIDE toolbar is now enabled: click it to install and run the app in the selected runtime:

+ +

To debug the app, click the "Pause" button and the Developer Tools Toolbox appears, connected to your app:

+ +

+ +
+

From Firefox 36 onwards, the "Pause" button is replaced with a wrench icon.

+
+ +

Exactly which tools you'll have available depends on the runtime, but you will at least have the basics: the Inspector, Console, JavaScript Debugger, Style Editor, Profiler and Scratchpad. Just as in a web page, any changes you make in the tools are visible immediately in the app, but are not persistent. Conversely, any changes you make in the editor pane can be saved straight back to disk, but are not visible without restarting the app.

+ +

Unrestricted app debugging (including certified apps, main process, etc.)

+ +

You can run the debugger against the simulator, b2g desktop, or a real device.

+ +

With the Simulator, if you click on the app dropdown menu while the runtime is selected, you can see and debug not only your app but all apps running in that runtime, including certified apps:

+ +

+ +


+ However, when connecting to a real device we have a security policy in force:

+ + + +

To remove this restriction:

+ + + +

To disable DevTools restricted privileges, connect to the runtime, and then, in the menu, go to Runtime > Runtime Info. The path then differs depending on what you are debugging against:

+ + + +

Now (or after a restart of the B2G desktop client) in WebIDE you should see all the apps on the device.

+ +
+

Note: As indicated above, to enable unrestricted privileges on a real device through WebIDE you'll need a rooted device. There is however a developer setting available in Firefox OS 2.2 onwards called Reset and enable full DevTools — when activated this will wipe all user data (for security reasons), reset the device, and enable unrestricted priviledges on any device.

+
+ +

Monitoring performance

+ +

If you're interested in the performance of your apps, there are a few ways to measure their impact on the runtime in WebIDE:

+ + + +

Troubleshooting

+ +

If you have any problems working with WebIDE, see the Troubleshooting page.

+ +

 

+ +

 

diff --git a/files/id/tools/webide/troubleshooting/index.html b/files/id/tools/webide/troubleshooting/index.html new file mode 100644 index 0000000000..d39320049b --- /dev/null +++ b/files/id/tools/webide/troubleshooting/index.html @@ -0,0 +1,117 @@ +--- +title: WebIDE +slug: Tools/WebIDE/Troubleshooting +tags: + - Indonesia +translation_of: Archive/WebIDE/Troubleshooting +--- +
{{ToolsSidebar}}

Connecting a Firefox OS device over USB

+ +

If you're trying to connect a Firefox OS device to WebIDE and it doesn't show up, here are some things you can try:

+ + + +

Connecting a Firefox OS device over Wi-Fi

+ + + +

Connecting to Firefox for Android

+ +

If you're trying to connect to a Firefox instance running on the Android OS and it doesn't show up, here are some things you can try:

+ + + +

Connecting to other browsers (Chrome, Safari)

+ +

WebIDE makes use of Valence (formerly Firefox Tools Adapter) to reach other browsers, like Chrome and Safari. 

+ +

If you are having trouble connecting to these other browsers, check the setup steps and other notes for those browsers on the Valence page.

+ +

Can't debug some apps

+ +

If you are finding that you can't debug certified apps, built-in apps, or apps already installed on a real device, then you may be coming across WebIDE's restricted privileges security policy. To find out more, see the section on Unrestricted app debugging (including certified apps, main process, etc.).

+ +

Unable to load project list

+ +

If you open WebIDE in one version of Firefox, and then downgrade to a previous Firefox version with the same profile, you may see the error "Unable to load project list" when opening WebIDE in the earlier Firefox version.

+ +

This can occur when the storage system that WebIDE uses (IndexedDB) needs to move or restructure its internal files for the newer Firefox version. The project list then becomes effectively inaccessible to older versions of Firefox.

+ +

No data has been lost, but you will need to keep using the newest version of Firefox that was used with your profile to get the project list back.

+ +

If really want to use the older version of Firefox, you can attempt to delete just the project list in the following way, but this is unsupported and could result in the further problems or additional data loss:

+ +
    +
  1. Close Firefox
  2. +
  3. Find your Firefox profile directory
  4. +
  5. Find the storage folder inside the profile directory
  6. +
  7. Under some part of this file tree, there should be files and/or directories that start with 4268914080AsptpcPerjo (a hashed name of the database)
  8. +
  9. Remove any such files and directories
  10. +
  11. Start Firefox and WebIDE again
  12. +
+ +

Enable logging

+ +

You can also enable verbose logging to gather diagnostics:

+ +
    +
  1. Open about:config, and add a new preference called extensions.adbhelper@mozilla.org.sdk.console.logLevel, with the string value all, and set extensions.adbhelper@mozilla.org.debug to true.
  2. +
  3. In the Add-ons Manager, disable and then re-enable the ADB Helper add-on.
  4. +
  5. Open the Browser Console and you'll now see console messages prefixed with adb. If the messages don't mean anything to you, ask for help.
  6. +
+ +

Get help

+ +

Go to the #devtools room on IRC and we will try to help.

-- cgit v1.2.3-54-g00ecf