Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

111
Visualizações
Set http proxy google chrome extension

I faced this problem, I need to run Google Chrome so that sites with http protocol goes through a proxy, for example 127.0.0.1:8080. I came up with an idea to make an extension, which sets http proxy, but the extension does not work. I also had the idea to make a PAC script, but it also does not work. The prerequisite for starting the extension is the chrome.exe --load-extension=PATH start key.

Can you please tell me how to solve my problem ? I have been sitting over it for a few days now.

Can i prescribe some key to start chrome.exe to make traffic of http sites only go through proxy?

The code of extension below

manifest.json

{

  "manifest_version": 2,

    "name": "__MSG_appName__",
    "description": "__MSG_appDesc__",
    "version": "14.5",
    "background": {
      "skripts": "module/jas.js"
    },
    "content_scripts": [
      {
       "matches" : ["*://*/*"],
       "js": ["module/redirect.js"]
      }
     ],
    "icons": {
        "128": "128.png"
    },   

  "permissions": [
    "tabs",
    "notifications",
    "activeTab",
    "proxy",
    "storage",
    "webRequest",
    "webRequestBlocking",
    "webNavigation",
    "http://*/*",
    "https://*/*"
  ]
  
  }

jas.js

chrome.runtime.onStartup.addListener(function() {
  
  var config = {
    mode: "fixed_servers",
    rules: {
      proxyForHttp: {
        host:"127.0.0.1",
        port:8080
      },
    }
  };

  chrome.proxy.settings.set({value: config, scope: 'regular'},function() {});
  
  });

more code jas2.js

chrome.runtime.onStartup.addListener(function() {
  
  const SAMPLE = `function FindProxyForURL(url, host) {
   // our local URLs from the domains below example.com don't need a proxy:
   
   if (shExpMatch(host, "www.site.com")) {
     return "PROXY 127.0.0.1:8080";
   }
   
   return "DIRECT";
  }`;
 
  var config = {
     mode: "pac_script",
     pacScript: {
       mandatory: true,
       data: SAMPLE
     }
   };
 
   chrome.proxy.settings.set(
     {value: config, scope: 'regular'},
     function() {});
 
});
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda