Don't clear settings that are not set by us

This commit is contained in:
ilyaigpetrov 2020-10-16 17:54:20 +00:00
parent 97ba2697da
commit 99a4ff9d24
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,7 @@
'use strict'; 'use strict';
console.log('Extension started.');
{ {
const IF_DEBUG = true; const IF_DEBUG = true;

View File

@ -65,6 +65,11 @@
reject(getErr); reject(getErr);
return; return;
} }
const ifWeAreInControl = window.utils.areSettingsControlledFor(settings);
if (!ifWeAreInControl) {
resolve(createPromise());
return;
}
delete settings.levelOfControl; delete settings.levelOfControl;
const setProxyAsync = () => new Promise((setResolve, setReject) => { const setProxyAsync = () => new Promise((setResolve, setReject) => {
@ -80,7 +85,7 @@
reject(clearErr); reject(clearErr);
return; return;
} }
return createPromise().then((actionResult) => setProxyAsync().then(() => resolve(actionResult))); createPromise().then((actionResult) => setProxyAsync().then(() => resolve(actionResult)));
})); }));
})); }));
}); });
@ -168,7 +173,7 @@
} }
console.log('Clearing chrome proxy settings...'); console.log('Doing without proxy...');
const pacDataPromise = doWithoutProxyAsync( const pacDataPromise = doWithoutProxyAsync(
// Employ all urls, the latter are fallbacks for the former. // Employ all urls, the latter are fallbacks for the former.
() => () =>