[tbb-commits] [torbutton/master] Bug 34250: Only listen to 'started' in noscript-control.js
gk at torproject.org
gk at torproject.org
Thu Jun 11 19:13:39 UTC 2020
commit 21e6fbd52a4b38150a56fb64475e4fd80352b92f
Author: Alex Catarineu <acat at torproject.org>
Date: Mon May 18 12:59:36 2020 +0200
Bug 34250: Only listen to 'started' in noscript-control.js
This fixes a race condition which can be hit in some cases,
such as running some marionette tests. The race condition
results in noscript not being initialized properly due to
the 'pageshow' event being received before 'started'.
---
modules/noscript-control.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/noscript-control.js b/modules/noscript-control.js
index 0383b9b5..02d5abea 100644
--- a/modules/noscript-control.js
+++ b/modules/noscript-control.js
@@ -146,7 +146,7 @@ var initialize = () => {
let messageListener = (a, b, c) => {
try {
log(3, `Message received from NoScript: ${JSON.stringify([a, b, c])}`);
- if (!["started", "pageshow"].includes(a.__meta.name)) {
+ if (a.__meta.name !== "started") {
return;
}
Services.mm.removeMessageListener("MessageChannel:Messages", listener);
More information about the tbb-commits
mailing list