possible fix for #21
This commit is contained in:
parent
fdfc5c63df
commit
166e756a45
3 changed files with 9 additions and 2 deletions
|
@ -13,7 +13,8 @@ var prefs = {
|
|||
whitelist: [],
|
||||
custom: {},
|
||||
mode: 'blacklist',
|
||||
color: '#ffa643'
|
||||
color: '#ffa643',
|
||||
cache: true
|
||||
};
|
||||
chrome.storage.local.get(prefs, ps => {
|
||||
Object.assign(prefs, ps);
|
||||
|
@ -188,7 +189,7 @@ function match({url, tabId}) {
|
|||
}
|
||||
|
||||
var onBeforeSendHeaders = ({tabId, url, requestHeaders, type}) => {
|
||||
if (type === 'main_frame') {
|
||||
if (type === 'main_frame' || prefs.cache === false) {
|
||||
cache[tabId] = match({url, tabId});
|
||||
}
|
||||
if (cache[tabId] === true) {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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(', ');
|
||||
|
|
Loading…
Reference in a new issue