From 99882cacd0ac987a4d3939909dde4297f4ec1345 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 12 Dec 2021 11:31:31 -0500 Subject: [PATCH] Truncate support information when too many lists are added Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1852 --- src/js/messaging.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/js/messaging.js b/src/js/messaging.js index 33dab03c2..3094a1286 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -1304,6 +1304,13 @@ const getSupportData = async function() { } if ( Object.keys(addedListset).length === 0 ) { addedListset = undefined; + } else if ( Object.keys(addedListset).length > 20 ) { + const added = Object.keys(addedListset); + const truncated = added.slice(20); + for ( const key of truncated ) { + delete addedListset[key]; + } + addedListset[`[${truncated.length} lists not shown]`] = '[too many]'; } if ( Object.keys(removedListset).length === 0 ) { removedListset = undefined;