Get rid of obsolete firefox scripts

This commit is contained in:
ilyaigpetrov 2020-10-16 17:02:22 +00:00
parent 747ad70497
commit 0ffefd7cfc
3 changed files with 0 additions and 98 deletions

View File

@ -252,43 +252,4 @@
},
};
// Shims for FireFox
if (!chrome.proxy.settings) {
const ffxStore = window.utils.createStorage('firefox-only');
chrome.proxy.settings = {
get: (_, cb) => {
let currentSettings = ffxStore('proxySettings') || {};
currentSettings.levelOfControl = 'controlled_by_this_extension'; // May be lie, but this field is required.
cb && cb(currentSettings);
},
onChange: {
addListener: () => {},
},
set: (details, cb) => {
browser.proxy.unregister();
browser.proxy.register('./default.pac.js');
// browser.proxy.onProxyError.addListener((...err) => { console.log('ERROR IN PAC:', ...err) });
browser.runtime.sendMessage(details, {toProxyScript: true});
ffxStore('proxySettings', details);
cb && cb();
},
};
const proxySettings = ffxStore('proxySettings');
if (proxySettings) {
chrome.proxy.settings.set(proxySettings);
}
}
}

View File

@ -1,42 +0,0 @@
'use strict';
{
if (!chrome.proxy.settings) {
const ffxStore = window.utils.createStorage('firefox-only');
chrome.proxy.settings = {
get: (_, cb) => {
let currentSettings = ffxStore('proxySettings') || {};
currentSettings.levelOfControl = 'controlled_by_this_extension'; // May be lie, but this field is required.
cb && cb(currentSettings);
},
onChange: {
addListener: () => {},
},
set: (details, cb) => {
browser.proxy.unregister();
browser.proxy.register('./default.pac.js');
// browser.proxy.onProxyError.addListener((...err) => { console.log('ERROR IN PAC:', ...err) });
browser.runtime.sendMessage(details, {toProxyScript: true});
ffxStore('proxySettings', details);
cb && cb();
},
};
const proxySettings = ffxStore('proxySettings');
if (proxySettings) {
chrome.proxy.settings.set(proxySettings);
}
}
}

View File

@ -1,17 +0,0 @@
var coolFind = () => {};
this.FindProxyForURL = function (...args) {
return coolFind(...args);
};
const dnsResolve = this.dnsResolve || (() => null); // Welcome to hell! Someone forgot dns.
browser.runtime.onMessage.addListener((details) => {
const pacData =
details && details.value && details.value.pacScript && details.value.pacScript.data;
if (!pacData) {
throw new Error('Never install empty PAC scripts!');
}
coolFind = (function() { eval(pacData); return FindProxyForURL; })();
});