Fix potential race condition for proxyScriptLoaded event.

This commit is contained in:
FelisCatus 2017-08-05 21:15:28 -04:00
parent a7b885275c
commit 8618b405a6

View File

@ -72,7 +72,6 @@ FindProxyForURL = (function () {
}
function init() {
browser.runtime.sendMessage({event: 'proxyScriptLoaded'});
browser.runtime.onMessage.addListener(function(message) {
if (message.event === 'proxyScriptStateChanged') {
state = message.state;
@ -85,5 +84,6 @@ FindProxyForURL = (function () {
}
}
});
browser.runtime.sendMessage({event: 'proxyScriptLoaded'});
}
})();