Firefox Developer Tools
Firefox开发人员工具是Firefox中内置的Web开发人员工具集。您可以使用它们来检查,编辑和调试HTML,CSS和JavaScript。
This section contains detailed guides to all of the tools as well as information on how to debug Firefox for Android, how to extend DevTools, and how to debug the browser as a whole.
If you have any feedback on DevTools or want to contribute to the project, you canjoin the DevTools community.
Note: If you are just getting started with web development and using developer tools, ourlearning文档将帮助您 - 查看Getting started with the Web和什么是浏览器开发人员工具?for good starting points.
The Core Tools
您可以通过选择菜单打开Firefox开发人员工具Tools>Web Developer>Web Developer Tools或使用键盘快捷键Ctrl+Shift+I或者F12on Windows and Linux, orCmd+Opt+Ion macOS.
The ellipsis menu on the right-hand side of Developer Tools contains several commands that let you perform actions or change tool settings.
This button only appears when there are multiple iframes on a page. Click it to display a list of the iframes on the current page and select the one with which you want to work. | |
Click this button to take a screenshot of the current page. (Note:This feature is not turned on by default and must be enabled in settings before the icon will appear.) | |
Toggles Responsive Design Mode. | |
Opens the menu that includes docking options, the ability to show or hide the split console, and Developer Tools settings. The menu also includes links to the documentation for Firefox Web Tools and the Mozilla Community. | |
Closes the Developer Tools |
页面检查员
View and edit page content and layout. Visualize many aspects of the page including the box model, animations, and grid layouts.
可访问性inspector
Provides a means to access the page's accessibility tree, allowing you to check what's missing or otherwise needs attention.
Application panel
Provides tools for inspecting and debugging modern web apps (also known asProgressive Web Apps). This includes inspection ofservice workers和web app manifests.
Note: The collective term for the UI inside which the DevTools all live is theToolbox.
More Tools
这些开发人员工具也内置在Firefox中。与上面的“核心工具”不同,您可能不会每天使用它们。
- 内存
- 找出哪些对象保持内存使用。
- 存储检查员
- Inspect cookies, local storage, indexedDB, and session storage present in a page.
- DOM属性查看器
- Inspect the page's DOM properties, functions, etc.
- Eyedropper
- Select a color from the page.
- Style Editor
- 查看和编辑当前页面的CSS样式。
- Taking screenshots
- Take a screenshot of the entire page or of a single element.
- Measure a portion of the page
- Measure a specific area of a web page.
- Rulers
- 网页上的覆盖水平和垂直标尺
对于最新的开发人员工具和功能,请尝试Firefox开发人员版。
连接开发人员工具
如果您使用开发人员工具使用keyboard shortcuts或者the equivalent menu items, they'll target the document hosted by the currently active tab. But you can attach the tools to a variety of other targets, too, both within the current browser and in different browsers or even different devices.
- 关于:调试
- Debug add-ons, content tabs, and workers running in the browser.
- 连接到Android的Firefox
- 将开发人员工具连接到在Android设备上运行的Firefox实例。
- 连接到iframes
- 将开发人员工具连接到当前页面中的特定iframe。
- 连接到其他浏览器
- Connect the developer tools to Chrome on Android and Safari on iOS.
Debugging the browser
By default, the developer tools are attached to a web page or web app. But you can also connect them to the browser as a whole. This is useful for browser and add-on development.
- 浏览器控制台
- See messages logged by the browser itself and by add-ons, and run JavaScript code in the browser's scope.
- Browser Toolbox
- 将开发人员工具附加到浏览器本身。
扩展DevTools
有关扩展Firefox Devtools的信息,请参阅Extending the developer tools在Browser ExtensionsMDN部分。
Migrating from Firebug
Firebug has come to the end of its lifespan (seeFirebug lives on in Firefox DevToolsfor details of why), and we appreciate that some people will find migrating to another less familiar set of DevTools to be challenging. To ease a transition from Firebug to the Firefox developer tools, we have written a handy guide —Migrating from Firebug.
Contribute
If you want to help improve the developer tools, these resources will get you started.
- Get Involved
- 我们的社区网站解释了如何参与。
- bugs.firefox-dev.tools
- 一个工具,有助于查找错误的错误。