From 6446cf04c7b44c3d419dc450a73b60bcaf5cdf02 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Fri, 24 Apr 2015 13:53:54 +0100 Subject: Always initialise event listeners early The event listeners were registered late, potentially allowing the page to get priority over us for key events, etc., when: * the original URL was disabled by an exclusion rule * the URL was changed - without a page load (by history.pushState or modifying location.hash), and - the new URL isn't (completely) disabled by any exclusion rules. This forces the event listeners to be registered even when the current URL is disabled, to avoid this problem. --- tests/dom_tests/dom_tests.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee index f81982ac..59970d7c 100644 --- a/tests/dom_tests/dom_tests.coffee +++ b/tests/dom_tests/dom_tests.coffee @@ -1,6 +1,6 @@ # Install frontend event handlers. -initializeWhenEnabled() +initializeWithState() installListener = (element, event, callback) -> element.addEventListener event, (-> callback.apply(this, arguments)), true -- cgit v1.2.3