1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00

Truncate support information when too many lists are added

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1852
This commit is contained in:
Raymond Hill 2021-12-12 11:31:31 -05:00
parent 4d482f9133
commit 99882cacd0
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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;