Javascript - callCom method blocks animated gif and timers in Firefox
I have a Firefox extension that pops up a log-in form (it's a c++ winform, not that it matters...). It is done using callCom technique 开发者_如何学JAVA- meaning the c++ client is integrated, initializing Components.classes, then createInstance(), query interface etc.
So, in Firefox, when I call my client's log-in screen the browser is waiting for it to close synchronously and so everything gets "stuck". I mean, timers, animated gifs, etc.
How can I solve this?
Without really knowing much about your extension - the XPCOM method you are calling needs to return immediately instead of waiting for something without processing any events. The general design principle is: blocking actions on the main thread are a bad idea. Which probably means in your case: create a new thread, have this thread open the form and wait for it, allow the XPCOM method to return quickly without blocking the main thread.
精彩评论