Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Perl script to change the proxy settings of Google chrome

by ambidexter (Initiate)
on Jun 27, 2013 at 07:24 UTC ( #1040936=perlquestion: print w/replies, xml ) Need Help??
ambidexter has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, Am using this perl script to open a Google Chrome Web Browser in Windows 7. But how to change the proxy settings of Google Chrome from perl script
sub open_default_browser { my $url = shift; my $platform = $^O; my $cmd; if ($platform eq 'MSWin32') { $cmd = "start $url"; } # W +in95..Win7 if (defined $cmd) { system($cmd); } else { die "Can't locate default browser"; } } open_default_browser("http://www.gmail.com/");

Replies are listed 'Best First'.
Re: Perl script to change the proxy settings of Google chrome
by dasgar (Curate) on Jun 27, 2013 at 08:12 UTC

    I haven't looked into setting web proxy settings for a specific browser, but you might want to check out the netsh command's winhttp context commands to set the proxy setting for the entire Windows OS. This will affect all of your web browsers that you have installed. If that accomplishes what you want as far as proxy settings go, you can then have your Perl code make a system call to run the netsh command.

      Yes dasgar,

      Currently i have this as a work around (using set proxy). But specifically i need to change only Chrome's proxy settings. However i had a look at the link posted by "rovf" but i didn't get anything that suits my criteria. Anyway i'll pass on this for now.

Re: Perl script to change the proxy settings of Google chrome (API)
by Anonymous Monk on Jun 27, 2013 at 07:36 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1040936]
Approved by rovf
help
Chatterbox?
[LanX]: inspect %INC ?
[Lady_Aleena]: LanX, for every module I've written?
[huck]: Lady_Aleena see Re: pl script in webserver and/or Re: pl script in webserver for what they use
[Lady_Aleena]: Wouldn't I have to run the modules somehow to get their %INC?
[huck]: the first one works just fine from the command line but requires editing
[huck]: but neither will handle autoloads

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2017-05-27 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?