Forráskód Böngészése

Disable PAC support for webext and remove unsafe-eval.

FelisCatus 8 éve
szülő
commit
4b38034536

+ 0 - 28
omega-target-chromium-extension/omega_webext_proxy_script.js

@@ -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.

+ 0 - 2
omega-target-chromium-extension/overlay/manifest.json

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