英文:
How to modify the title of remote debug url in CefSharp?
问题
我在WinForm中使用CefSharp创建了一个浏览器,根据用户的配置,浏览器会显示不同的内容。当打开远程调试(http://localhost:9999)时,URL链接始终显示标题为test page
。如果我创建两个实例,我无法区分它们。
如何在代码中修改标题?是否有任何CefSharp配置可以添加以修改远程调试页面的标题?
[{
"description": "",
"devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9999/devtools/page/5D72AFB9FF36FE8389138F51ED9A9735",
"id": "5D72AFB9FF36FE8389138F51ED9A9735",
"title": "test page",
"type": "page",
"webSocketDebuggerUrl": "ws://localhost:9999/devtools/page/5D72AFB9FF36FE8389138F51ED9A9735"
}]
英文:
I made a browser using cefsharp in winform, the browser will show different content based on user's configuration. When open remote debug(http://localhost:9999), the url link always show the title test page
. If I create two instances, I could not tell them apart.
How to modify the title in code? Is there any CefSharp configuration I can add to modify the title in remote debugging page?
[ {
"description": "",
"devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9999/devtools/page/5D72AFB9FF36FE8389138F51ED9A9735",
"id": "5D72AFB9FF36FE8389138F51ED9A9735",
"title": "test page",
"type": "page",
"webSocketDebuggerUrl": "ws://localhost:9999/devtools/page/5D72AFB9FF36FE8389138F51ED9A9735"
}]
答案1
得分: 1
没有配置选项可以修改远程调试中显示的 title
。 title
应该与您的网页的 <title>
完全一致。如果您希望在开发工具中区分它们,您需要为每个页面提供唯一的标题。
如果需要,您可以执行JavaScript来更改您的网页标题(或者只需更改您的HTML)。
英文:
There's no configuration option for modifying the title
show in remote debugging. The title
should exactly reflect the <title>
of your web page. You need to give you pages unique titles if you want them to be distinguished in devtools.
You can execute JavaScript to change your web page title if needed (or simply change your html).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论