[Python-bugs-list] [ python-Bugs-812089 ] webbrowser.open_new() opens in an existing browser window

SourceForge.net noreply at sourceforge.net
Fri Sep 26 08:37:00 EDT 2003


Bugs item #812089, was opened at 2003-09-25 00:38
Message generated for change (Comment added) made by theller
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=812089&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Bram Cohen (bram_cohen)
Assigned to: Nobody/Anonymous (nobody)
Summary: webbrowser.open_new() opens in an existing browser window

Initial Comment:
I'm running Windows with Mozilla (version 1.4) as my

default web browser. When I call webbrowser.open_new()

using Python 2.3 it opens the url in an existing window

(if there are any) rather than opening a new one like

it's supposed to. This might in some way be an

interaction with tabbed browsing, since I always have a

bunch of tabs open.

----------------------------------------------------------------------

>Comment By: Thomas Heller (theller)
Date: 2003-09-26 14:37

Message:
Logged In: YES 
user_id=11105

I can confirm (and possibly explain) everything that Bram

reports.



1. The '-remote' switch on the command line for mozilla only

works on Unix/Linux, as documented in

http://www.mozilla.org/docs/command-line-args.html. So

executing the command line



"Program Files\mozilla.org\Mozilla\mozilla.exe" - remote

"openURL(...)"



doesn't load this url, it only starts mozilla.



2. webbrowser.py on Windows (for me at least) doesn't

instantiate the Netscape class - it uses WindowsDefault,

which simply uses startfile(url). So, the 'new' and

'autoraise' arguments are not even used.



Looking at the docs for the webbrowser module, the words 'if

possible' are used very often. So it seems, it simply is not

possible on windows.



(The only thing which should be fixed in the docs is that

the win32api and win32con modules are mentioned, but they

are not used in the code - so this should be removed IMO).



I suggest to close the bug if noone comes up with a patch.

----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2003-09-26 13:39

Message:
Logged In: YES 
user_id=11375

Looking at the code. this is what webbrowser.py should be doing.  I can't 

debug this problem, because I'm not seeing it on my Linux box with 

Mozilla 1.4.  



I suggest you make a copy of webbrowser.py and insert debugging prints 

into it.  Is it instantiating the Netscape class, as I expect?  And what 

arguments is it really using?



----------------------------------------------------------------------

Comment By: Bram Cohen (bram_cohen)
Date: 2003-09-26 03:34

Message:
Logged In: YES 
user_id=52561

This is very bizzare. When I execute this command -



C:\>"Program Files\mozilla.org\Mozilla\mozilla.exe" -remote

"openURL(http://www.bitconjurer.org/, new-window)"



it opens a new browser window with no page open in it. Are

you sure it's executing the command you said?

----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2003-09-25 20:42

Message:
Logged In: YES 
user_id=11375

It's invoking Mozilla with -remote "openURL(http://example.com, 

new-window)".  



According to http://www.mozilla.org/unix/remote.html, this should create 

a new window.  Try to run this command yourself and set if it opens a 

new tab; if it does, this is a Mozilla bug (or perhaps a feature?).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=812089&group_id=5470



More information about the Python-bugs-list mailing list