How to open a new default browser window in Python when Chrome is used by default

I was looking for a way to open a new default browser window from Python code.

According to the documentation webbrowser.open_new (url) Should do this. Unfortunately, if Chrome is the default browser, it only opens a new tab. Is there a way to open the default browser (not knowing what browser it is)?

+7
source share
3 answers

I have the feeling that this is not Python's mistake. Firefox and Chrome (and possibly IE) intercept calls by opening new windows and changing them to new tabs. Check the settings in your browser to interpret these calls.

+2
source

Give it a whirlwind:

import subprocess command = "cmd /c start chrome http://www.ebay.com --new-window" subprocess.Popen(command, shell=True) 
+2
source
 webbrowser.open('http://www.google.com', new=1) 
-one
source

All Articles