Opening browser with command line params

3k Views Asked by At

Im using Opera browser.I want to open the browser with one command line option by detault ie) whenever i open opera it should enable the option

I am now opening my opera using

opera --proxy-pac-url="http://hostname/autoproxy.pac"

This auto proxy file should be set whenever i click opera shortcut in my desktop.I am using ubuntu.

Thanks in advance.

1

There are 1 best solutions below

0
On

One possibility of solutions is to use alias configured in your ~/.bash_aliases script.

Just append the following line into your ~/.bash_aliases.

alias opera="opera --proxy-pac-url='http://hostname/autoproxy.pac'"

Then source it for your current terminal session with source ~/.bash_aliases. Now every time you execute opera, it will have such --proxy-pac-url=... as you configured automatically. As well, you can add any additional parameters as you like.

But a downside of it is that you have to leave such terminal session intact, you cannot close, and those debugging information is printed out on console. If you don't want that, and to be free of it then use the following instead

alias opera="opera --proxy-pac-url='http://hostname/autoproxy.pac' > /dev/null 2>&1 &" 

This will re-route standard error message to standard output stream, then dump both of it into /dev/null so you won't see anything. At the same time, start opera in the background.

Extra

To configure opera to start with socks5 proxy server, use the following

alias opera="opera --proxy-server='socks://127.0.0.1:8080' > /dev/null 2>&1 &"