Disable PAC support for webext and remove unsafe-eval.

This commit is contained in:
FelisCatus 2017-04-15 20:15:54 -04:00
parent 4dca36a45f
commit 4b38034536
2 changed files with 0 additions and 30 deletions

View File

@ -27,8 +27,6 @@ FindProxyForURL = (function () {
if (!matchResult) {
if (profile.profileType === 'DirectProfile') {
return 'DIRECT';
} else if (profile.pacScript) {
return runPacProfile(profile.pacScript);
} else {
warn('Warning: Unsupported profile: ' + profile.profileType);
return fallbackResult;
@ -59,32 +57,6 @@ FindProxyForURL = (function () {
return fallbackResult;
}
function runPacProfile(profile) {
var cached = pacCache[profile.name];
if (!cached || cached.revision !== profile.revision) {
// https://github.com/FelisCatus/SwitchyOmega/issues/390
var body = ';\n' + profile.pacScript + '\n\n/* End of PAC */;'
body += 'return FindProxyForURL';
var func = new Function(body).call(this);
if (typeof func !== 'function') {
warn('Warning: Cannot compile pacScript: ' + profile.name);
func = function() { return fallbackResult; };
}
cached = {func: func, revision: profile.revision}
pacCache[cacheKey] = cached;
}
try {
// Moz: Most scripts probably won't run without global PAC functions.
// Example: dnsDomainIs, shExpMatch, isInNet.
// https://bugzilla.mozilla.org/show_bug.cgi?id=1353510
return cached.func.call(this);
} catch (ex) {
warn('Warning: Error occured in pacScript: ' + profile.name, ex);
return fallbackResult;
}
}
function warn(message, error) {
// We don't have console here and alert is not implemented.
// Throwing and messaging seems to be the only ways to communicate.

View File

@ -43,8 +43,6 @@
"ftp://*/*",
"<all_urls>"
],
"content_security_policy":
"script-src 'self' 'unsafe-eval'; object-src 'self';",
"commands": {
"_execute_browser_action": {
"suggested_key": {