简体   繁体   English

使用命令行参数打开浏览器

[英]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。

Extra额外的

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.

相关问题 localhost/phpmyadmin 未在 Opera 浏览器中打开 - localhost/phpmyadmin is not opening in opera browser 专门使用 Opera 浏览器参数 macOS 打开 Jupiter“实验室”(不是 Jupiter 笔记本)时出现问题 - Problem opening Jupiter "lab" (not Jupiter notebook) specifically with the Opera browser parameter macOS 如何检测浏览器的“换行”表示中是否包含两个字符? - How to detect if the browser's representation of “new line” has two characters? 是否可以在不使用命令行开关的情况下以Kiosk模式启动Opera? - Is it possible to start Opera in Kiosk Mode without command line switches? Chrome和Firefox是否具有类似于IE的-noframemerging的命令行选项? - Do Chrome and Firefox have command line options similar to IE's -noframemerging? Opera浏览器的CSS问题 - CSS issue with Opera browser Opera浏览器-Cookie编辑器 - Opera browser - cookie editor chrome 浏览器上的 chrome cookie 是否适用于 opera 浏览器? - does a chrome cookie on chrome browser works on opera browser? 在 Katalon Studio 中添加自定义浏览器 - Adding custom browser in Katalon Studio Javascript Cookie 脚本 Opera 浏览器 - Javascript Cookie Script Opera Browser
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM