code of webbrowser.py

  • Thread starter Michel Van den Bergh
  • Start date
M

Michel Van den Bergh

Hello,

I was looking at the code of webbrowser.py included in python 2.3.3. I
think there are some
obvious problems with it (tested with mozilla on Linux).

(*) If you open an url (with the option "new window") and the browser is
not already running
then it opens *two* windows: the home page and your url. This is
different for example
from the default behaviour on Windows.

(**) There is another related problem: if you open an url
and the browser is not already running then the code starts a new
browser, does a timed sleep
and then issues a "-remote" command.

Using a timed sleep is *very fragile*, and indeed I had failures because
the delay
(PROCESS_CREATION_DELAY) was not long enough. At the very least the -remote
command should be tried a couple of times.

BUT: there is no reason *at all* to issue a -remote command in this
case. All browsers I know
accept an url as argument. So one can just start a new browser with the
url as argument.

(***) Mozilla type browsers now have a -remote "ping()" command. This is
perhaps a
cleaner way to detect a running browser.

Any comments?

Best regards,
Michel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,197
Messages
2,571,040
Members
47,635
Latest member
SkyePurves

Latest Threads

Top