angular - Qt QWebEngine 远程调试 : Chrome developer tools no longer work

标签 angular qt qtwebengine

最近在一些软件更新(自动 Windows 10 更新,可能还有 Chrome 自动更新)之后,用于从 Qt 的 QWebEngine 进行远程调试的开发人员工具停止工作。 JavaScript 控制台显示:

Uncaught TypeError: document.registerElement is not a function
    at Object.UI.registerCustomElement (shell.js:formatted:18064)
    at shell.js:formatted:18178
    at shell.js:formatted:18266
devtools_app.js:formatted:2606 Uncaught ReferenceError: SDK is not defined
    at devtools_app.js:formatted:2606

有问题的代码(来自 shell.js)是这样的:
UI.registerCustomElement = function(localName, typeExtension, prototype) {
    return document.registerElement(typeExtension, {
        prototype: Object.create(prototype),
        extends: localName
    });
}

什么是 shell.js,它来自哪里?这个问题的原因可能是什么?

该网页实际上是在Qt 5.12.3网络浏览器中运行的,但是我(远程)将Chrome用于开发者工具。

我也同时将 Angular 7.x 升级到 Angular 8,但不再相信这是相关的。

我的 Chrome 当前版本为 80.0.3987.116(官方版本)(64 位)。

更新
我只是尝试下载旧版本的 Chromium。 (我尝试了 77.0.3823.0 版,因为这可以追溯到 2019 年年中。)并且在那里调试有效。

最佳答案

https://developer.tizen.org/forums/web-application-development/tizen-studio-debug-tizen-web-application-blank-page-chrome-80


Chrome 80 已弃用这些开发工具使用的 WebComponents v0。
解决方案是使用额外的参数启动 Chrome 以重新启用该功能(当它仍在引擎中时):
--enable-blink-features=ShadowDOMV0,CustomElementsV0
或者使用对应于 Chrome 79.x 的 Chromium 版本,例如
Windows: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/706915/
Mac: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Mac/706915/
Linux: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/706915/
参见:Chrome devtools inspector showing blank white screen while debugging with Samsung TV Tizen Web application

关于angular - Qt QWebEngine 远程调试 : Chrome developer tools no longer work,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60292131/

相关文章:

c++ - 尝试使用 QDatastream 序列化自定义类的 QList 时出现错误 C2679

python - QtWebEngine 拦截带有自定义 URL 模式服务回复的请求

Python QWebEngineView 重定向到错误的语言页面

angular - 使用 ReactiveForms 和 NgbModal 时的 ExpressionChangedAfterItHasBeenCheckedError

c++ - 在同一台机器上编译的相同 C++ 代码表现不同

javascript - 使用 ng-container 与模板的好处?

c++ - Linux 上后台 Qt 线程中的非阻塞读取导致 EAGAIN

javascript - qt webengine 将 javascript 输出重定向到 GUI

angular - Angular 8错误-无法读取未定义的属性 'toString'

angular - 如何将表单组控件值传递给在同一表单组中使用的自定义验证器?