close a internet explorer window with a button in an Internet explorer plugin...
[1/9] from: e::lauret::gmail::com at: 16-Jun-2005 14:09
Hello Rebolers !!!
I'd like to know if it is possible to close a internet explorer window with
a button.
Thank you for help !
~~Manu~~
[2/9] from: petr:krenzelok:trz:cz at: 16-Jun-2005 14:21
Emmanuel LAURET napsal(a):
>Hello Rebolers !!!
> I'd like to know if it is possible to close a internet explorer window with
>a button.
>Thank you for help !
> ~~Manu~~
>
Hi,
I am not the right-one to ask, but imo it is not easily possible. It is
just imo, but imo Rebol uses kind of 'call internally to start browser
via 'browse. You have 'call function available, so maybe you could call
start.exe, which has some other options, but the result you receive is
always:
>> ble: call/info "start /B iexplore.exe"
>> probe ble
make object! [
id: none
exit-code: 0
]
So - it does seem to me, that you are not able to obtan particular
window handler. I am not sure if it is achievable at all, maybe you
could try your luck with Win32API library calls, but you need /Pro
version of Rebol for that ...
-pekr-
[3/9] from: greggirwin::mindspring::com at: 16-Jun-2005 9:31
Hi Emmanuel,
EL> I'd like to know if it is possible to close a internet explorer window with
EL> a button.
Petr is right; you would need to use API calls to find and close the
window. Not too hard, but you would need a /pro license to make
library calls.
-- Gregg
[4/9] from: hallvard::ystad::oops-as::no at: 16-Jun-2005 20:55
Emmanuel,
You mean with the rebol plugin, right? Try 'do-browser and some javascript. As for the
javascript, I don't know exactly how to do it, but a search for "javascript close internet
explorer window" on Google should do the trick, I guess...
HY
Dixit Emmanuel LAURET (14.09 16.06.2005):
[5/9] from: Izkata:Comcast at: 16-Jun-2005 14:02
> Emmanuel,
> You mean with the rebol plugin, right? Try 'do-browser and some
<<quoted lines omitted: 4>>
> trick,
> I guess...
Well, if Javascript is going to be used, it's pretty simple: self.close()
-Izzy Boy
[6/9] from: hallvard:ystad:oops-as:no at: 16-Jun-2005 21:09
Dixit Izkata (21.02 16.06.2005):
>Well, if Javascript is going to be used, it's pretty simple: self.close()
>
> -Izzy Boy
Unless if you want to close another window, and you don't know it's name or ID.
HY
[7/9] from: e:lauret::gmail at: 17-Jun-2005 7:13
hi,
do-browser "self.close()" only ?
I tried it, doesn't work !!!
i tried with a javascript function in "<head> function close()...</head>"
with do-browser "close()"
doesn't work too !
see on http://lauretprod.web.ool.fr/close.htm
2005/6/16, Izkata <[Izkata--comcast--net]>:
[8/9] from: pwawood::mango::net::my at: 17-Jun-2005 14:26
Hi Emmanuel
This exert from
http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.3/
reference/window.html#1201822 may help explain:
The close method closes only windows opened by JavaScript using the
open method. If you attempt to close any other window, a confirm is
generated, which lets the user choose whether the window closes. This
is a security feature to prevent
mail bombs" containing self.close().
However, if the window has only one document (the current one) in its
session history, the close is allowed without any confirm. This is a
special case for one-off windows that need to open other windows and
then dispose of themselves."
Though when I tried the following simple test with Firefox, Safari and
Internet Exploiter under Mac OS X 10.2.8 :
<html>
<head>
<title>Shut the Browser Window</title>
</head>
<body>
This is some useless text
<script type="text/javascript">
self.close()
</script>
</body>
Safari and even IE happily shut the only window open, but Firefox
didn't!!!
Regards
Peter
[9/9] from: e::lauret::gmail::com at: 17-Jun-2005 11:26
Thanks a lot, but i've found how to do it !
in the html page, you need the code:
*<HEAD>
<SCRIPT LANGUAGE="Javascript">
function evaluate(code) { return eval(code); }
</SCRIPT>
</HEAD>
*in the script, you need the code:
*rebol[]*
*fen: layout [*
*button "close" [*
*do-browser "self.close()"*
*]*
*]*
*view/options/title center-face fen*
*[ resize no-title ]*
*""*
You can test it at: http://lauretprod.web.ool.fr/close.htm
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted