From a5a447186b5a68ff606a6748ddc422e1bcbf91be Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 20 May 2020 12:38:41 -0400 Subject: [PATCH] Fix computing the path of nested lists Regression from: - https://github.com/uBlockOrigin/uBlock-issues/issues/1034 Nested lists must have their path computed from their parent list path, not from the path of the root list. --- src/js/assets.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/assets.js b/src/js/assets.js index 3c85a8837..efbb93535 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -261,7 +261,10 @@ api.fetchFilterList = async function(mainlistURL) { if ( match === null ) { break; } if ( toParsedURL(match[1]) !== undefined ) { continue; } if ( match[1].indexOf('..') !== -1 ) { continue; } - const subURL = rootDirectoryURL.href + match[1]; + // Compute nested list path relative to parent list path + const pos = result.url.lastIndexOf('/'); + if ( pos === -1 ) { continue; } + const subURL = result.url.slice(0, pos + 1) + match[1]; if ( sublistURLs.has(subURL) ) { continue; } sublistURLs.add(subURL); out.push(