[英]Opening browser with command line params
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我正在使用 Opera 浏览器。我想通过 detault 使用一个命令行选项打开浏览器,即)每当我打开 Opera 时,它都应该启用该选项
I am now opening my opera using我现在正在使用
opera --proxy-pac-url="http://hostname/autoproxy.pac"歌剧 --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.每当我单击桌面上的歌剧快捷方式时,都应设置此自动代理文件。我使用的是 ubuntu。
Thanks in advance.提前致谢。
One possibility of solutions is to use alias
configured in your ~/.bash_aliases
script.解决方案的一种可能性是使用在~/.bash_aliases
脚本中配置的alias
。
Just append the following line into your ~/.bash_aliases
.只需~/.bash_aliases
附加到您的~/.bash_aliases
。
alias opera="opera --proxy-pac-url='http://hostname/autoproxy.pac'"
Then source it for your current terminal session with source ~/.bash_aliases
.然后使用source ~/.bash_aliases
为您当前的终端会话source ~/.bash_aliases
。 Now every time you execute opera
, it will have such --proxy-pac-url=...
as you configured automatically.现在,每次执行opera
,它都会有您自动配置的--proxy-pac-url=...
。 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.这会将标准错误消息重新路由到标准输出流,然后将它们都转储到/dev/null
因此您将看不到任何内容。 At the same time, start opera in the background.同时,在后台启动opera。
To configure opera to start with socks5 proxy server, use the following要将opera配置为使用socks5代理服务器启动,请使用以下命令
alias opera="opera --proxy-server='socks://127.0.0.1:8080' > /dev/null 2>&1 &"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.