diff --git a/platform/chromium/managed_storage.json b/platform/chromium/managed_storage.json index fb58b2c61..7a334e241 100644 --- a/platform/chromium/managed_storage.json +++ b/platform/chromium/managed_storage.json @@ -41,6 +41,12 @@ "title": "Settings to overwrite at launch time", "type": "object", "properties": { + "filters": { + "title": "A collection of filters", + "description": "The set of user filters to use at launch time -- where each entry is a distinct line.", + "type": "array", + "items": { "type": "string" } + }, "filterLists": { "title": "A collection of list identifiers and/or list URLs", "description": "The set of filter lists to use at launch time.", diff --git a/src/js/storage.js b/src/js/storage.js index 7852c8f2a..59f3df9e2 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -1387,7 +1387,12 @@ self.addEventListener('hiddenSettingsChanged', ( ) => { vAPI.storage.set(bin); } - if ( typeof data.userFilters === 'string' ) { + if ( + Array.isArray(toOverwrite.filters) && + toOverwrite.filters.length !== 0 + ) { + this.saveUserFilters(toOverwrite.filters.join('\n')); + } else if ( typeof data.userFilters === 'string' ) { this.saveUserFilters(data.userFilters); } };