possible fix for #21

This commit is contained in:
Ray Lothian 2018-08-20 16:11:47 +04:30
parent fdfc5c63df
commit 166e756a45
3 changed files with 9 additions and 2 deletions

View file

@ -42,6 +42,9 @@
<tr>
<td><textarea id="custom" rows="5" wrap="off"></textarea></td>
</tr>
<tr>
<td><label><input type="checkbox" id="cache"> Use caching to improve performance (recommended value is true). Uncheck this option only if you are using the custom mode and also you need the user-agent string to be altered from the provided list on every single request.</label></td>
</tr>
<tr>
<td><label><input type="checkbox" id="faqs"> Open FAQs page on updates</label></td>
</tr>

View file

@ -30,6 +30,7 @@ function save() {
chrome.storage.local.set({
faqs: document.getElementById('faqs').checked,
cache: document.getElementById('cache').checked,
blacklist: prepare(document.getElementById('blacklist').value),
whitelist: prepare(document.getElementById('whitelist').value),
custom,
@ -43,12 +44,14 @@ function save() {
function restore() {
chrome.storage.local.get({
faqs: true,
cache: true,
mode: 'blacklist',
whitelist: [],
blacklist: [],
custom: {}
}, prefs => {
document.getElementById('faqs').checked = prefs.faqs;
document.getElementById('cache').checked = prefs.cache;
document.querySelector(`[name="mode"][value="${prefs.mode}"`).checked = true;
document.getElementById('blacklist').value = prefs.blacklist.join(', ');
document.getElementById('whitelist').value = prefs.whitelist.join(', ');