Reputation:
I want to open a Firefox browser from the command line and have it go to youtube.com
I have tried: open /Applications/Firefox.app --args -remote "openURL(www.youtube.com, new-tab)"
It successfully opens a Firefox, but does not navigate to youtube.com
How do I fix this?
Upvotes: 28
Views: 19661
Reputation: 3330
You can open Firefox to a specific url and pass params if you want. Note: kiosk mode is an example only supported in Firefox 71 beta.
open -a /Applications/Firefox.app "https://stackoverflow.com" --args --kiosk
Upvotes: 1
Reputation: 131
Maybe you can append two aliases, edit ~/.bash_profile, append code below:
open_by_browser(){ open -a $1 $2}
alias firefox='open_by_browser firefox'
alias chrome='open_by_browser "Google Chrome"'
then you can open html file by Firefox
firefox xxx.html
or by Chrome
chrome xxx.html
Upvotes: 9
Reputation:
The others' answers work by the way, but another way you can do it is:
/Applications/Firefox.app/Contents/MacOS/firefox "youtube.com"
Upvotes: 3
Reputation: 28029
If firefox is your default browser you can simply use: open 'http://www.youtube.com'
Upvotes: 17