From c1e726577d8ee24e0e50abbb6345e5355e8729e4 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 16 Nov 2020 09:17:39 -0500 Subject: [PATCH] Include lookup of `redirect=` options in built-in benchmark The built-in benchmark in current dev build contains the lookup of `redirect=` option, and thus the results of the benchmark in recent versions of uBO can't be meaningfully compared with the results of the built-in benchmark in 1.30.8. This commit fixes this by adding the workload of looking up `redirect=` options for blocked network requests, such that the results of the built-in benchmark can be compared to the latest dev build (and subsequent stable releases). --- src/js/static-net-filtering.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index ede3d0117..5167c5fb6 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -3548,8 +3548,12 @@ FilterContainer.prototype.benchmark = async function(action, target) { print(`\turl=${fctxt.url}`); print(`\tdocOrigin=${fctxt.getDocOrigin()}`); } - if ( fctxt.type === 'main_frame' || fctxt.type === 'sub_frame' ) { - this.matchAndFetchData(fctxt, 'csp'); + if ( r !== 1 ) { + if ( fctxt.type === 'main_frame' || fctxt.type === 'sub_frame' ) { + this.matchAndFetchData(fctxt, 'csp'); + } + } else { + fctxt.redirectURL = µb.redirectEngine.toURL(fctxt); } } const t1 = self.performance.now();