Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
301 views
in Technique[技术] by (71.8m points)

windows - Edge-Chromium - Registry settings for proxy server does not work immediately

I need to switch proxy server settings for edge-chromium with powershell. The settings will be stored in >>HKCU:SoftwareMicrosoftCurrentVersionInternet Settings<<. But after a change the new value does not work immediately. I need to open >>Settings -> Network and Internet -> Proxy<<. After opening the Proxy settings Edge-Chromium work fine with new Proxy.

class ProxyServer {
     [string]$ServerAddress
     [string]$RegistryPath

     ProxyServer(){
          $this.ServerAddress = "newProxy.com:8080"
          $this.RegistryPath = "HKCU:SoftwareMicrosoftCurrentVersionInternet Settings"
     }
     [void]SetServer() {
          Set-ItemProperty -Path $this.RegistryPath -Name ProxyServer -Value $this.ServerAddress
          Set-ItemProperty-Path $this.RegistryPath -Name ProxyEnable -Value 1
     }
}

With Edge(not edge-chromium) and IE the script works fine. I have tried the Registry hive HKCU:SoftwarePoliciesMicrosoftEdge as mentioned here also.

{
 "ProxyMode": "fixed_server",
 "ProxyServer": "newProxy.com:8080"
}

But even with this Registrypath I have to open >>Settings --> Network and Internet --> Proxy<<.

testet on Windows 10 1803 and 1909.

Thanks in advance for help

question from:https://stackoverflow.com/questions/66059264/edge-chromium-registry-settings-for-proxy-server-does-not-work-immediately

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...