Years ago, in a land far far away, there was some public exposed API
that used DDE to communicate to "the" browser [windows of course].
I have since lost all such knowledge..
For IE you can get this info by using tcom and the COM interface.
For Mozilla/Firefox etc. i don't really know, a mozilla chrome/xul
extension can do it (i have one that tracks the currently visited
website in a browser and sends it and some extra info to a tclhttpd via
SOAP. The server then sends the next page to show in the browser, kind
of remote controlled webpage show...)
Michael
>Helmut Giese wrote:
>> Hello out there,
>> I would like to be able to ask the user's browser what URL it is
>> currently showing. (I cannot ask the user since he/she doesn't always
>> know: When navigating in a site the current address isn't necessarily
>> displayed.)
>> I seem to remember that this topic came up here a couple of times, but
>> a search on groups.google.com and the wiki didn't turn up anything
>> useful.
>> Anybody out there with a better memory then me? Or greater
>> capabilities in formulating search criteria? Or just plainly _knowing_
>> it?
>> Any advice or link will be greatly appreciated.
>> Best regards
>> Helmut Giese
>
Hi David,
>Years ago, in a land far far away, there was some public exposed API
>that used DDE to communicate to "the" browser [windows of course].
>
>I have since lost all such knowledge..
Too bad :(
But many thanks for supplying the 2 links. It turned out to be useful
to associate 'DDE' and 'browser' or 'Netscape' to get some useful
information. It's as easy as
package require dde
set browser IEXPLORE ;# or FIREFOX or NETSCAPE
set data [dde request $browser WWW_GetWindowInfo 0xFFFFFFFF]
set url [lindex [split $data ","] 0]
but the results are somewhat disappointing: I only get the "start
page" (as displayed in the address field), but what I want is the
_real_ URL the user navigated to, which contains stuff like
...year=2006&month=03&day=02...
which apparently is provided by a script within the page.
Hm, this needs more hunting around.
Best regards
Helmut Giese
>Helmut Giese schrieb:
>> Hello out there,
>> I would like to be able to ask the user's browser what URL it is
>> currently showing. (I cannot ask the user since he/she doesn't always
>> know: When navigating in a site the current address isn't necessarily
>> displayed.)
>> I seem to remember that this topic came up here a couple of times, but
>> a search on groups.google.com and the wiki didn't turn up anything
>> useful.
>> Anybody out there with a better memory then me? Or greater
>> capabilities in formulating search criteria? Or just plainly _knowing_
>> it?
>> Any advice or link will be greatly appreciated.
Hi Michael,
>For IE you can get this info by using tcom and the COM interface.
>For Mozilla/Firefox etc. i don't really know, a mozilla chrome/xul
>extension can do it (i have one that tracks the currently visited
>website in a browser and sends it and some extra info to a tclhttpd via
>SOAP. The server then sends the next page to show in the browser, kind
>of remote controlled webpage show...)
tcom sounds interesting - especially since using DDE didn't produce
what I need (see my answer to David).
Ok, let's hunt for tcom & Netscape/Firefox/IE.
Best regards
Helmut Giese
Darn.. appears to work right with firefox:
% set data [dde request $browser WWW_GetWindowInfo 0xFFFFFFFF]
"http://www.potentiometers.com/rnpushselect.cfm?session_num=2006030209473545","Push-Fit
Control Knobs - Selection Guide",""
Hi David,
with this site it works for me, too.
One difference I notice: At this site the current URL is displayed in
the address field - with all query parameters included.
At the site I'm interested in, the address field _always_ shows the
base URL - and that's what I get back.
But I found a work-around: If I right-click into the frame of interest
and choose 'display current frame' I get the display _and_ I get this
frame's URL in the address field, too - and then I can retrieve it
with the script above.
Seems to me that Firefox always returns what it shows in the address
field. For the moment this is good enough - if the customer feels he
needs something better, there is XPCOM to explore.
BTW with IE I can talk via tcom (really an excellent package) and get
what I want - with the minor annoyance that I cannot reach an already
running instance, but have to launch a new one - well, that's life.
Thanks for your interest and best regards
Helmut Giese