From dcd98f4efa7876ae5d37bd0588082f6aecd08a30 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 16 Jul 2018 09:30:36 -0400 Subject: [PATCH] fix load-time race condition for high-generic cosmetic filters potentially causing high-generic cosmetic filters to not be applied because the MRU cache contains an empty list of high-generic filters when there is a query from a content script for cosmetic filters before they are fully loaded and ready. --- src/js/cosmetic-filtering.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/cosmetic-filtering.js b/src/js/cosmetic-filtering.js index d378b2569..58d56ffe1 100644 --- a/src/js/cosmetic-filtering.js +++ b/src/js/cosmetic-filtering.js @@ -554,7 +554,9 @@ FilterContainer.prototype.freeze = function() { } } this.highlyGeneric.simple.str = Array.from(this.highlyGeneric.simple.dict).join(',\n'); + this.highlyGeneric.simple.mru.reset(); this.highlyGeneric.complex.str = Array.from(this.highlyGeneric.complex.dict).join(',\n'); + this.highlyGeneric.complex.mru.reset(); this.frozen = true; };