Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[help][webbrowser always opens new tab. I want to open in the same tab] #77111

Closed
tommylim1018navercom mannequin opened this issue Feb 24, 2018 · 6 comments
Closed

[help][webbrowser always opens new tab. I want to open in the same tab] #77111

tommylim1018navercom mannequin opened this issue Feb 24, 2018 · 6 comments
Labels
OS-mac OS-windows stdlib Python modules in the Lib dir

Comments

@tommylim1018navercom
Copy link
Mannequin

tommylim1018navercom mannequin commented Feb 24, 2018

BPO 32930
Nosy @pfmoore, @ronaldoussoren, @tjguk, @ned-deily, @zware, @zooba, @csabella, @titansnow

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2018-02-24.18:27:14.793>
created_at = <Date 2018-02-24.02:17:13.260>
labels = ['OS-mac', 'library', 'OS-windows']
title = '[help][webbrowser always opens new tab. I want to open in the same tab]'
updated_at = <Date 2018-02-24.18:27:14.791>
user = 'https://bugs.python.org/tommylim1018navercom'

bugs.python.org fields:

activity = <Date 2018-02-24.18:27:14.791>
actor = 'cheryl.sabella'
assignee = 'none'
closed = True
closed_date = <Date 2018-02-24.18:27:14.793>
closer = 'cheryl.sabella'
components = ['Library (Lib)', 'macOS', 'Windows']
creation = <Date 2018-02-24.02:17:13.260>
creator = 'tommylim1018@naver.com'
dependencies = []
files = []
hgrepos = []
issue_num = 32930
keywords = []
message_count = 6.0
messages = ['312689', '312713', '312715', '312717', '312720', '312740']
nosy_count = 9.0
nosy_names = ['paul.moore', 'ronaldoussoren', 'tim.golden', 'ned.deily', 'zach.ware', 'steve.dower', 'cheryl.sabella', 'tttnns', 'tommylim1018@naver.com']
pr_nums = []
priority = 'normal'
resolution = 'third party'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue32930'
versions = ['Python 3.6']

@tommylim1018navercom
Copy link
Mannequin Author

tommylim1018navercom mannequin commented Feb 24, 2018

Dear manager,

I'm just starting python and trying to make simple web application.
As above title, I just want to open webbrowser at first and then just change web-address in the same tab, but whenever I try webbrowser.open, it always open new tab or new window.
When I checked webbrowser-control options on python help page, it says webbrowser.open's 2nd argument can control window opening. but it did not work well in my tries. following is my test code.

#1st try
import webbrowser
url = 'www.google.com'
webbrowser.open(url, new=0) # this open new explorer window.

#....wait

#2nd try
webbrowser.open(url, new=0) # this open new explorer window again.

In my test, I test 2nd argument from 0 to 2, but there seems no change.
always opens new tab.

Is there any way to change address and open in the current opened browser window?

best Regards,
Tommy

@tommylim1018navercom tommylim1018navercom mannequin added OS-windows stdlib Python modules in the Lib dir OS-mac labels Feb 24, 2018
@csabella
Copy link
Contributor

Hi Tommy,

The documentation states "If new is 0, the url is opened in the same browser window if possible." It seems to be browser dependent, hence the 'if possible' caveat. What operating system and browser are you using?

@TitanSnow
Copy link
Mannequin

TitanSnow mannequin commented Feb 24, 2018

Hi Cheryl,

I think you may misunderstand.
What it means is to open URL in
the *same tab*, not *same window*,
which is not described in documentation.

Hi Tommy,

It’s hard to say what is “the same tab”.
Is it the current tab or the tab opened by
last webbrowser.open call?
If the user open a new tab in the opened browser,
then which tab is “the same tab”?

@csabella
Copy link
Contributor

TitanSnow,

You're right, sorry about the confusion.

But, nevertheless, this does seem to be something that the browsers don't have available as an option.

Here's the Mozilla command line option page:
https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options

Under the Browser section, there is a note stating:
Note: When opening multiple URLs, Firefox always opens them as tabs in a new window.

I believe the other browsers behave the same.

@TitanSnow
Copy link
Mannequin

TitanSnow mannequin commented Feb 24, 2018

Yes, I think so.

Maybe, in a web application, to achieve this,
the way is to use a GUI library then use its
web view widget.

@csabella
Copy link
Contributor

I'm going to close this as third party since it's browser and not Python related.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac OS-windows stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant