Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python WebBrowser Open In Same Tab

running this line:

webbrowser.open(page.path, new=0, autoraise=True)

I always get the page opened in a new Tab.

How can I get it in the same Tab as it should be using new=0?

like image 509
user3755529 Avatar asked Nov 19 '17 12:11

user3755529


Video Answer


1 Answers

This can't be done unfortunately.

You can set the variable to whatever you want but browser tab behaviour is hard-set in modern browsers and will override it. You'll find that you won't be able to use new=1 to open in a brand new window either, for the same reason. It will always just be a new tab.

The last update to the webbrowser module in the Github was about the same age as this question, I wonder if this has been abandoned.

like image 186
츄 plus Avatar answered Sep 29 '22 09:09

츄 plus