Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #34579

Re: open URL in the current tab

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.035
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'think,': 0.07; 'python': 0.09; 'tab': 0.09; 'dec': 0.15; 'options.': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:URL': 0.16; 'wrote:': 0.17; 'module': 0.19; 'trying': 0.21; 'somebody': 0.23; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'transition': 0.27; 'message-id:@mail.gmail.com': 0.27; 'trigger': 0.29; 'system,': 0.32; 'received:209.85.160.46': 0.32; 'could': 0.32; '11,': 0.33; 'handle': 0.33; 'problem': 0.33; 'to:addr :python-list': 0.33; 'hi,': 0.33; 'received:google.com': 0.34; 'open': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'next': 0.35; 'but': 0.36; 'depends': 0.36; 'previous': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'page': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'your': 0.60; '*please': 0.71; 'business,': 0.84; "else's": 0.84; 'hugely': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cWf+WIOpmT7izEHb9tbg0rDSVtvqaN9kdidebDH2mMk=; b=ea6aWJU839Fl7UHN0jpO1utAbu6uLqPC2wcTRjSBgF+JdWW6fIPA2NciKwJPLHBJ/o ZwIwhTYib6j2cOTT6R90g+waPrFguy2IBwyJLr4CHEays/Z5yYrEgoLqIK+2nlyUD1R4 +oPE36gSfaI1GXXH/887NuuA0Hzlx1OFSJqMzTcKNxvobfMu+XIOHRR42tPYfenBOOD5 F5nhOfNPxdgaBY3XJh+yyLorhjEf4O9o3FtIFvPeJ7fx0gYhIMEWifvjR8zK3AjkjPbY ivKQqseMmlnP3F6Zir8CRB7SuiHDSIMfq6BrSlBFneSK9S6hL4x8as+rA+qGyzkl43DJ C7mg==
MIME-Version 1.0
In-Reply-To <CAOuJsM=ch3T=L3+7rQ=sg5t_LmA5v_nXJLYYTw7ySD30Vmx+qA@mail.gmail.com>
References <CAOuJsM=ch3T=L3+7rQ=sg5t_LmA5v_nXJLYYTw7ySD30Vmx+qA@mail.gmail.com>
Date Tue, 11 Dec 2012 10:14:59 +1100
Subject Re: open URL in the current tab
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.691.1355181303.29569.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355181303 news.xs4all.nl 6967 [2001:888:2000:d::a6]:53641
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:34579

Show key headers only | View raw


On Tue, Dec 11, 2012 at 9:27 AM, Jabba Laci <jabba.laci@gmail.com> wrote:
> Hi,
>
> With the webbrowser module you can open a URL in a new tab. But how
> could I tell Firefox from Python to open a URL in the _current_ tab?

If this is for use on somebody else's system, *please don't*. My
current tab is my business, not your program's. But if this is your
own system (eg you want to use Firefox as your GUI), there are a few
options. The easiest, I think, is to have the previous page handle the
transition - trigger it in some way, and then it simply does:

location.href = "some_new_url"

How you go about triggering this is the next problem :) But that
depends hugely on what you're trying to accomplish.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: open URL in the current tab Chris Angelico <rosuav@gmail.com> - 2012-12-11 10:14 +1100

csiph-web