将指针锁定到vscode扩展网络浏览面板中的元素引发错误
我正在构建一个创建WebView面板的VSCODE扩展程序。该面板使用三js渲染3D场景 - 这成功发生了。 可以使用场景和WebView开发人员工具控制台锁定画布,每当我请求popointerlock()时,我都会看到此消息。
不幸的是,无论我尝试什么,我都无法获取指针, 元素对于指针锁定无效。
此 -pointer -lock“ - 如下所述/104169 - 所以我认为这不是问题。
我已经摆弄了几个小时,试图让这种工作工作,或者至少要得到一个答案,说明为什么它不起作用/不支持,但没有取得任何进展。有人在将指针锁定在其扩展中与WebView面板一起工作有任何成功吗?
I am building a vscode extension that creates a webview panel. This panel uses threejs to render a 3d scene - this happens successfully. Unfortunately, no matter what I try, I cannot get the pointer to lock to the canvas with the scene and in the webview developer tools console, I see this message whenever I requestPointerLock()
"Uncaught (in promise) DOMException: The root document of this element is not valid for pointer lock"
This took me into the world of iframes which webview panels use to create the html document however all the iframes (when I look at the elements) that are created as part of the webview panel have "allow-pointer-lock" - as mentioned here https://github.com/microsoft/vscode/issues/104169 - so I don't think that is the problem.
I have been fiddling for hours trying to get this working or at least get an answer as to why it doesn't work/isn't supported but have made no progress. Has anyone had any success with getting pointer lock to work with a webview panel in their extensions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论