From 8562f701443d553af7f3c2199df2f1fb36da3d59 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 1 Jan 2015 09:15:37 -0500 Subject: [PATCH] avoid potential double execution of firstRetrieveHandler (because mutations observer) --- src/js/contentscript-end.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js index e12549e04..518f83e0f 100644 --- a/src/js/contentscript-end.js +++ b/src/js/contentscript-end.js @@ -79,6 +79,9 @@ var messager = vAPI.messaging.channel('contentscript-end.js'); }, retrieveHandler ); + // https://github.com/gorhill/uBlock/issues/452 + // There is only one first.. + retrieveHandler = otherRetrieveHandler; } else { otherRetrieveHandler(null); } @@ -111,10 +114,6 @@ var messager = vAPI.messaging.channel('contentscript-end.js'); } } } - - // There is only one first.. - retrieveHandler = otherRetrieveHandler; - // Flush dead code from memory (does this work?) firstRetrieveHandler = null;