aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r--ext/bg/js/options.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 0d83f428..c513f572 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -389,6 +389,10 @@ class OptionsUtil {
{
async: true,
update: this._updateVersion3.bind(this)
+ },
+ {
+ async: false,
+ update: this._updateVersion4.bind(this)
}
];
}
@@ -459,4 +463,22 @@ class OptionsUtil {
}
return fieldTemplates;
}
+
+ static _updateVersion4(options) {
+ // Version 4 changes:
+ // Options conditions converted to string representations.
+ for (const {conditionGroups} of options.profiles) {
+ for (const {conditions} of conditionGroups) {
+ for (const condition of conditions) {
+ const value = condition.value;
+ condition.value = (
+ Array.isArray(value) ?
+ value.join(', ') :
+ `${value}`
+ );
+ }
+ }
+ }
+ return options;
+ }
}