使用 chrome devtools 检查移动网页会导致黑屏

inspecting mobile web page with chrome devtools results in blank screen

在 Android (Galaxy S8) 上的 Chrome 中通过 USB 连接在最新版本的 Chrome 桌面浏览器中调试网页 运行 无法正常工作. 尝试在移动设备上检查网页 运行 会导致 blank page.

当我检查出现在桌面 Chrome 浏览器中的空白页面时,我得到 following error:

Uncaught TypeError: InspectorFrontendHost.isUnderTest is not a function
    at Object.Host.isUnderTest (inspector.js:930)
    at Main.Main._gotPreferences (inspector.js:8301)
    at DevToolsAPIImpl.embedderMessageAck (devtools_compatibility.js:33)
    at <anonymous>:1:13

同样的问题。 但我找到了解决方案。 在尝试我将在此处介绍的解决方案之前,尝试重新启动 chrome 桌面和 android,重新启动 phone。在 about://flags 上禁用一些实验性标志,因为我怀疑其中的一些。但是 none 这些步骤解决了。

然后我看到 Android 上的 Chrome 是 v65,我的桌面是 v64。

所以:

  1. 删除了 Chrome 版本 64.0.3282.186-1 dpkg -r google-chrome-stable
  2. 已从 https://www.google.com/chrome/
  3. 下载最新版本
  4. ..并使用 dpkg -i google-chrome-stable_current_amd64.deb[=33= 安装了 Chrome 版本 65.0.3325.181-1 ]

之前:

# dpkg -l | grep chrome
ii  google-chrome-stable                        64.0.3282.186-1                                     amd64        The web browser from Google

之后:

# dpkg -l | grep chrome
ii  google-chrome-stable                        65.0.3325.181-1                                     amd64        The web browser from Google

问题解决了! 现在它可以很好地检查 android 个选项卡!