[tor-commits] [meek/master] Use an event loop technique to block without a dialog.
dcf at torproject.org
dcf at torproject.org
Thu Apr 10 15:18:01 UTC 2014
commit 2f753a57ea2fb8db0a1a0cc7d401a4db59f4ab98
Author: David Fifield <david at bamsoftware.com>
Date: Thu Apr 10 00:51:35 2014 -0700
Use an event loop technique to block without a dialog.
---
firefox/components/main.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/firefox/components/main.js b/firefox/components/main.js
index 43979e3..cff6ef0 100644
--- a/firefox/components/main.js
+++ b/firefox/components/main.js
@@ -68,9 +68,10 @@ MeekHTTPHelper.prototype = {
dump("meek-http-helper: listen 127.0.0.1:" + serverSocket.port + "\n");
// Block forever.
- var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
- prompts.confirm(null, "Query", "Get down, get funky?");
+ // https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Threads#Waiting_for_a_background_task_to_complete
+ var thread = Components.classes["@mozilla.org/thread-manager;1"].getService().currentThread;
+ while (true)
+ thread.processNextEvent(true);
} finally {
var app = Components.classes["@mozilla.org/toolkit/app-startup;1"]
.getService(Components.interfaces.nsIAppStartup);
More information about the tor-commits
mailing list