954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to set proxy for Chrome from extension

Hello,
I need to write an extension for Chromium Browser. First i will just
write a code to change the proxy. After that i will write all the
extension. But i could not use proxy API.
I write this code on the background page of extension but it did not
work:

<script type="text/javascript"> 
var config = { 
                    mode: "fixed_servers", 
                    rules: { 
                                  httpProxy: { 
                                                       port:"8080", 
                                                       scheme: 
"socks5", 
                                                       host: "1.2.3.4" 
                                                   } 
                              } 
                   }; 
chrome.proxy.settings.set({value: config, scope: 'regular'}); 
</script>


Even i give true values for proxy host and port number (which i try it
at the same time from Firefox if the proxy works) Chromium browser
don't use the proxy. It still goes directly to the sites.

The free proxies you can try for extension: http://hidemyass.com/proxy-list/
Chrome proxy API page: http://code.google.com/chrome/extensions/proxy.html

Open source extension for the same purpose as example:
https://chrome.google.com/webstore/detail/fajkpbphiejhldakjboejnabfch ...

You can download my extension from here:
http://www.2shared.com/file/d0lPSB16/proxy_changer_extension.html

You need Chrome 13+ to use chrome proxy API. If you use older version
you neeed to enable experimental APIs of chrome also you need to
change the function class name from my code..

I will be happy if you can help me. I just need the code to change the
proxy.

Thank you

ferat_tes
Newbie Poster
1 post since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: