[Pkg-mozext-commits] [requestpolicy] 28/257: [ref] overlay: prevent AMO's `setTimeout` warning

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:19:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit 3bd641d6e518bb6edd6a7fb7c01927396a3bec80
Author: Martin Kimmerle <dev at 256k.de>
Date:   Sun Aug 9 13:43:40 2015 +0200

    [ref] overlay: prevent AMO's `setTimeout` warning
    
    The message of the AMO Validator was:
    
    ```
    `setTimeout` called in potentially dangerous manner
    
    Warning: In order to prevent vulnerabilities, the `setTimeout`
    and `setInterval` functions should be called only with function
    expressions as their first argument.
    
    Severity for automated signing: high
    Suggestions for passing automated signing:
    
    Please do not ever call `setTimeout` or `setInterval` with
    string arguments. If you are passing a function which is not
    being correctly detected as such, please consider passing a
    closure or arrow function, which in turn calls the original
    function.
    ```
---
 src/content/ui/overlay.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/content/ui/overlay.js b/src/content/ui/overlay.js
index 08b4ee1..e15b83c 100644
--- a/src/content/ui/overlay.js
+++ b/src/content/ui/overlay.js
@@ -910,7 +910,10 @@ rpcontinued.overlay = (function() {
           return;
         }
         // call this function again in a few miliseconds.
-        setTimeout(tryAddingSHistoryListener, waitTime);
+        setTimeout(function () {
+          // Prevent the `setTimeout` warning of the AMO Validator.
+          tryAddingSHistoryListener();
+        }, waitTime);
       }
     };
     tryAddingSHistoryListener();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list