-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Avoid exception when cursor was removed from DOM already #1834
Avoid exception when cursor was removed from DOM already #1834
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable. Thank you for the thorough explanation!
I assume you tested your changes?
Thank you for the quick response!
Yes, I used |
I think it's a bit rude of Turbo to remove everything from the body element, but this seems like a reasonable handling of that.
|
@CendioOssman I do not know how browsers implement Simply using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need anything particularly special. We just want to clean up after ourselves as best we can. So we probably don't need to dig too deep in to this. :)
I tested this by using the following steps:
Following the same steps but with your patch, disconnecting works well and does not produce an error. Looks good - Merging. |
Hi,
we were getting a
NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node
from this call because the cursor had already been removed from the DOM.This happens in our case because we use noVNC together with Turbo. This is a library / framework that replaces parts of the page or the entire document with server side rendered content.
So when leaving the page with the connected noVNC on it, we need to call
rfb.disconnect()
to close the connection, since we remain in the same JS context. By the time we do that, the DOM is already replaced though, so the canvas is no longer indocument
and the error occurs.Since this line in noVNC is intended to remove the element from the DOM, we argue, that it is not an error if it was not in the DOM in the first place.
Thank you for your time and effort!