Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

Metro 设备上远程调试Firefox

这篇翻译不完整。请帮忙从英语翻译这篇文章

这篇文章解释了如何在在桌面版的火狐通过开发者工具使用远程调试( remote debugging) 来检查和编程Windows 8 (Merto 风格)的火狐app.

先决条件

你将要需要:

  • 运行在 触屏友好的“Metro” 风格的 Windows 8 电脑上面的的 Window 8(Metro 模式)的火狐(Windows 8 (Metro-style) Firefox)" .
  • 运行于传统“桌面”模式的Windows,Mac OS X,或者Linux ,或者一个独立的电脑或者独立配置文件

Set up Firefox for Metro

Go to about:config in Firefox for Metro, and set the following required preference:

  • devtools.debugger.remote-enabled = true

You may also want to set these optional preferences:

  • devtools.debugger.force-local = false (if you want to connect from a different machine over the network)
  • devtools.debugger.remote-host (to change the TCP hostname where Firefox will listen for connections)
  • devtools.debugger.remote-port (to change the TCP port number where Firefox will listen for connections)
  • devtools.debugger.prompt-connection = false (Allow connections without displaying a confirmation prompt.  This can be a security risk, especially if you also set the force-local preference to false.)

Set up Firefox for 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.

连接

在桌面端

在桌面端,打开开发者工具菜单,选择“连接...”,你讲会看到如下页面:

如果你在电脑上运行Metro版默认配置的Firefox,用默认的host(localhost)和端口(6000),然后点击“连接”按钮即可。

如果你在另外一台电脑上运行的Metro版的Firefox,或者是非默认端口,请输入对应的host名字和端口号,然后点击“连接”按钮。

Windows 8 (Metro) 浏览器

下一步你会看到一个对话框,询问是否确认连接。按下“OK”键继续。

提示:如果远程连接超时,按下徽标键返回到桌面检查是不是防火墙弹出了一个访问控制的提示。

桌面端

下一步,桌面端会展示一个如下的对话框:

这个是在询问debug远程连接的网页还是当前网页。

  • 你会看到You'll see one entry under "Available remote tabs" for each open tab, and clicking it will attach the debugging tools to the web content hosted by that tab. If you want to debug your web content, you'll choose the relevant content tab.
  • You'll see one entry under "Available remote processes": this is the browser process itself. You'll choose this option if you want to debug the browser's own code.

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

The Toolbox, and the tools it hosts (including the Console, Debugger, Style Editor, Profiler, etc.), work in just the same way as they do when attached to local content.

文档标签和贡献者

 此页面的贡献者: maicss, molang
 最后编辑者: maicss,