Microsoft is acquiring GitHub. Decentraleyes is leaving GitHub. Welcome to its new home!

To participate, please register, or sign in with an existing GitLab.com, Bitbucket, or GitHub account.

Past contributions on GitHub? Be sure to reclaim your Comments, Issues, and Pull Requests.

Commit 44b3e400 authored by Thomas Rientjes's avatar Thomas Rientjes

Implement add-on setting persistance

parent 35eae8d3
......@@ -18,7 +18,7 @@ window.onload = function () {
let previousValue, currentValue;
previousValue = target.getAttribute('data-previous-value') || '';
previousValue = target.getAttribute('data-previous-value') || null;
currentValue = target.value;
sharedFunctions.applySetting({
......
......@@ -6,6 +6,13 @@
"id": "tor-browser-settings@torproject.org",
"main": "src/main.js",
"author": "Thomas Rientjes",
"preferences": [{
"name": "security_level",
"title": "Tor browser security level",
"hidden": true,
"type": "integer",
"value": 0
}],
"permissions": {
"private-browsing": true
},
......
......@@ -97,7 +97,7 @@ function startListening (worker) {
learn_more_label: _('learn_more_label')
},
settings: {
security_level: new Setting('security_level', 2)
security_level: new Setting('security_level', settings['security_level'])
}
});
......@@ -111,9 +111,9 @@ function startListening (worker) {
worker.port.on('setting:altered', function (settingAlteration) {
settings[settingAlteration.settingId] = settingAlteration.currentValue;
settings[settingAlteration.settingId] = parseInt(settingAlteration.currentValue);
var persistedSetting = new Setting(settingAlteration.settingId, settingAlteration.currentValue);
let persistedSetting = new Setting(settingAlteration.settingId, settingAlteration.currentValue);
worker.port.emit('setting:persisted', persistedSetting);
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment