Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setCapture deprecated #1610

Open
PexMor opened this issue Nov 23, 2021 · 2 comments
Open

setCapture deprecated #1610

PexMor opened this issue Nov 23, 2021 · 2 comments
Labels
Milestone

Comments

@PexMor
Copy link

PexMor commented Nov 23, 2021

JS setCapture()

The setCapture is deprecated in Firefox at least.

Firefox in console gives hint:

Element.setCapture() is deprecated. Use Element.setPointerCapture() instead.
For more help https://developer.mozilla.org/docs/Web/API/Element/setPointerCapture events.js:66:15
Document.releaseCapture() is deprecated. Use Element.releasePointerCapture() instead.
For more help https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture

To Reproduce

Open noVNC client in Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:94.0) Gecko/20100101 Firefox/94.0 browser.

Expected behavior

The replacement functions are called and Firefox does not complain.

Client (please complete the following information):

  • OS: MacOS BigSur
  • Browser: Firefox
  • Browser version: 94

Server (please complete the following information):

  • noVNC version: 1.3.0
  • VNC server: QEMU
  • WebSocket proxy: websockify
@samhed
Copy link
Member

samhed commented Nov 24, 2021

👍
Microsoft Edge on Windows 10 also complains in a similar way.

@samhed samhed added the bug label Nov 24, 2021
@samhed samhed added this to the v1.4.0 milestone Nov 24, 2021
@samhed samhed modified the milestones: v1.4.0, v1.5.0 Mar 24, 2023
@samhed samhed modified the milestones: v1.5.0, v1.6.0 May 31, 2024
@marc-legendre
Copy link

I'm pretty sure this is also the source of behavior differences between browsers, since the function exists mainly in Firefox, and is emulated for other browsers.

For example, in Chrome, clicking inside the canvas results in mouseleave events being fired on the RFB container when a mouse button is released. This issue does not happen with Firefox. (I have not tested other browsers.)

This difference can be demonstrated in the app with a simple change like

diff --git i/app/ui.js w/app/ui.js
index 39d28a3..fee531c 100644
--- i/app/ui.js
+++ w/app/ui.js
@@ -114,6 +114,8 @@ const UI = {
         UI.initFullscreen();
 
         // Setup event handlers
+        document.getElementById("noVNC_container")
+            .addEventListener('mouseleave', console.log);
         UI.addControlbarHandlers();
         UI.addTouchSpecificHandlers();
         UI.addExtraKeysHandlers();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants