mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Add "toOverwrite.filters" entry as managed storage property
The new entry is an array of strings, each representing a distinct line, and all entries are used to populate the "My filters" pane. This offers an more straightforward way for administrators to specify a list of custom filters to use for all installations.
This commit is contained in:
parent
055f37d765
commit
649b3480e0
@ -41,6 +41,12 @@
|
|||||||
"title": "Settings to overwrite at launch time",
|
"title": "Settings to overwrite at launch time",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"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": {
|
"filterLists": {
|
||||||
"title": "A collection of list identifiers and/or list URLs",
|
"title": "A collection of list identifiers and/or list URLs",
|
||||||
"description": "The set of filter lists to use at launch time.",
|
"description": "The set of filter lists to use at launch time.",
|
||||||
|
@ -1387,7 +1387,12 @@ self.addEventListener('hiddenSettingsChanged', ( ) => {
|
|||||||
vAPI.storage.set(bin);
|
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);
|
this.saveUserFilters(data.userFilters);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user