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

Uncaught TypeError: Cannot read property 'dispatchEvent' of null #779

Closed
steve13814 opened this issue Feb 23, 2017 · 4 comments
Closed

Uncaught TypeError: Cannot read property 'dispatchEvent' of null #779

steve13814 opened this issue Feb 23, 2017 · 4 comments
Assignees
Labels

Comments

@steve13814
Copy link

steve13814 commented Feb 23, 2017

I'm using novnc master branch (commit a7ca8e5). When I connect to a ubuntu vm by Chrome 53.0.2785.34 and do some mouse clicks. The "Uncaught TypeError" happend.
screenshot_20170223_180352

At first, this issue is hard to reproduce. I found that after adding some busy waiting, this bug is reproducible by keep clicking the mouse on the canvas

diff --git a/core/util.js b/core/util.js                                                                                           
index 03e6925..e374dd2 100644                                                                                                      
--- a/core/util.js                                                                                                                 
+++ b/core/util.js                                                                                                                 
@@ -564,6 +564,11 @@ Util.setCapture = function (elem) {                                                                           
             captureElem.addEventListener('touchend', Util._captureProxy);                                                         
         }                                                                                                                         
+       var date = new Date();                                                                                                     
+       var curDate = null;                                                                                                        
+       do { curDate = new Date();  }                                                                                              
+       while(curDate-date < 200);                                                                                                 
+                                                                                                                                  
         Util._captureElem = elem;                                                                                                 
         // Track cursor and get initial cursor
@CendioOssman
Copy link
Member

This should have been fixed in 1658466. Have you tried clearing your cache?

@steve13814
Copy link
Author

Hi~ I didn't use any old version of novnc.
Anyway, I just deleted chrome local storage, cookies. Open the Chrome development tool and check the option to disable the cache.
As long as I add some busying waiting code, this bug is reproducible.

@CendioOssman
Copy link
Member

Great. I'll have a look and see if I can reproduce it here as well.

@CendioOssman CendioOssman self-assigned this Feb 23, 2017
@CendioOssman
Copy link
Member

Fixed in 90ecc73.

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

2 participants