Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-09-2002, 08:56 PM   PM User | #1
spinweb
New Coder

 
Join Date: Jul 2002
Location: North Carolina
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
spinweb is an unknown quantity at this point
How to Close Parent Window w/o Alert?

I'm trying to spawn a toolbar-less window from a link on my desktop. It still throws up an alert box confirming that the user wants the window closed.

Is there a way to close the parent window without alerting the user, particularly since the parent window is there just to spawn the child window (why this is necessary, I'm not sure).

Thanks,
Rick

P.S. For more detail, please see this thread:
http://www.codingforums.com/showthre...&threadid=1665
spinweb is offline   Reply With Quote
Old 07-09-2002, 09:18 PM   PM User | #2
Soldier Bob
New Coder

 
Join Date: Jul 2002
Location: USA, East Coast
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Soldier Bob is an unknown quantity at this point
something to do with security

The parent window is opened by the user. What if he doesn't want his Web browser to be closed?

Its a built in function for security reasons last I understood.

You could load up a site map on the parent browser to navigate anthing your loading on the popup. That way at least the content is useful and not just a blank screen.

-S. Bob
Soldier Bob is offline   Reply With Quote
Old 07-09-2002, 10:25 PM   PM User | #3
spinweb
New Coder

 
Join Date: Jul 2002
Location: North Carolina
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
spinweb is an unknown quantity at this point
Change Parent?

Is it possible to make the child the parent and then kill the parent?
spinweb is offline   Reply With Quote
Old 07-10-2002, 12:18 AM   PM User | #4
Quiet Storm
Regular Coder

 
Join Date: Jun 2002
Location: Beyond Lament
Posts: 424
Thanks: 0
Thanked 0 Times in 0 Posts
Quiet Storm is an unknown quantity at this point
There is a way to close() the parent window from the child - on IE only, though.

__________________
Quíet Storm Designs ~ Art is not what you see, but what you make others see.
· the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·
Quiet Storm is offline   Reply With Quote
Old 07-10-2002, 02:39 PM   PM User | #5
spinweb
New Coder

 
Join Date: Jul 2002
Location: North Carolina
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
spinweb is an unknown quantity at this point
OK....

All I need is for it to work in IE. Can you post the code?

Thanks,
Rick
spinweb is offline   Reply With Quote
Old 07-10-2002, 05:06 PM   PM User | #6
Quiet Storm
Regular Coder

 
Join Date: Jun 2002
Location: Beyond Lament
Posts: 424
Thanks: 0
Thanked 0 Times in 0 Posts
Quiet Storm is an unknown quantity at this point
<HEAD>

<OBJECT id="closes" type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM NAME="Command" VALUE="Close">
</OBJECT>

<script type="text/javascript">
function init() {
window.open('Page2.html','second','height=400,width=400');
window.focus();
closes.Click(); }
</script>

</HEAD>
<BODY onload="init()">

The above will automatically open Page2.html and close the parent onLoad.

To make it work by clicking a button first, remove the onload="init()" command and use this:



<A HREF="#" onClick="javascript:init();">Open & Close!</A>
__________________
Quíet Storm Designs ~ Art is not what you see, but what you make others see.
· the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·
Quiet Storm is offline   Reply With Quote
Old 07-10-2002, 06:41 PM   PM User | #7
spinweb
New Coder

 
Join Date: Jul 2002
Location: North Carolina
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
spinweb is an unknown quantity at this point
Great!

Many Thanks QS. I've wanted to be able to spawn a window from outside a browser with no toolbars, etc., at a given size for a long time. This seems to be the closest we can get (i.e., first spawning a "dummy" window that's resized to 1px x 1px and then closed.)

Rick
spinweb is offline   Reply With Quote
Old 07-11-2002, 09:09 PM   PM User | #8
spinweb
New Coder

 
Join Date: Jul 2002
Location: North Carolina
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
spinweb is an unknown quantity at this point
Can the windows be centered?

Is it possible to have these windows, launched from a shortcut on the desktop be centered?

That would be really nice.

Thanks,
Rick
spinweb is offline   Reply With Quote
Old 07-11-2002, 09:53 PM   PM User | #9
Soldier Bob
New Coder

 
Join Date: Jul 2002
Location: USA, East Coast
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Soldier Bob is an unknown quantity at this point
Arrow Rofl

geez, build the application already :P

I think what you are really asking is if a browser can be made to behave like a custom app. This isnt a good road to travel upon. If you really need all this and more, you might want to try looking into modifying the mozilla core and open it up to allow for things like this.

From what I understand its open source etc.

http://www.mozilla.org/

-S. Bob
Soldier Bob is offline   Reply With Quote
Old 07-11-2002, 10:12 PM   PM User | #10
joh6nn
wei wu wei


 
joh6nn's Avatar
 
Join Date: Jun 2002
Location: 72° W. 48' 57" , 41° N. 32' 04"
Posts: 1,887
Thanks: 0
Thanked 1 Time in 1 Post
joh6nn is an unknown quantity at this point
i suggest you leave it alone, period. if it's a built in security feature, then there's gotta be a good reason why you shouldn't be doing it, in which case you'd better have a REAL good reason to bypass it. and i can't imagine such a reason.

on that note, i'd like to politely request, that those few of us, who know how to bypass that security measure, don't tell other people how. the measure is there for a reason, and we're doing no favors by making it easier to get around.
__________________
bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

i am a loser geek, crazy with an evil streak,
yes i do believe there is a violent thing inside of me.
joh6nn is offline   Reply With Quote
Old 07-11-2002, 10:20 PM   PM User | #11
Roy Sinclair
Senior Coder

 
Join Date: Jun 2002
Location: Wichita
Posts: 3,880
Thanks: 0
Thanked 0 Times in 0 Posts
Roy Sinclair will become famous soon enough
Quote:
on that note, i'd like to politely request, that those few of us, who know how to bypass that security measure, don't tell other people how. the measure is there for a reason, and we're doing no favors by making it easier to get around.
I also recommend that these "bypass the security" things not be given out for an additional reason. These are bugs in the browser which need to be fixed, not hidden capabilities and when those bugs are fixed this code will suddenly no longer function and your page will break unexpectedly. You don't need that grief so don't try to take advantage of a bug.

FWIW, some more serious problems related to the use of this bug have recently been reported on BUGTRAQ (specifically, unrestricted cross site scripting) and MS will be scrambling right now to disable this so this particular bug is going to have a short life.
Roy Sinclair is offline   Reply With Quote
Old 07-11-2002, 10:31 PM   PM User | #12
spinweb
New Coder

 
Join Date: Jul 2002
Location: North Carolina
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
spinweb is an unknown quantity at this point
gee

For those of us who are looking to get the most out of our browsers, it seems to me a reasonable goal to be able to:

Launch a centered window from a link on the desktop, without all the browser accoutremonts.

For web designers/developers this comes up frequently.

Regards,

Rick
spinweb is offline   Reply With Quote
Old 07-11-2002, 11:14 PM   PM User | #13
joh6nn
wei wu wei


 
joh6nn's Avatar
 
Join Date: Jun 2002
Location: 72° W. 48' 57" , 41° N. 32' 04"
Posts: 1,887
Thanks: 0
Thanked 1 Time in 1 Post
joh6nn is an unknown quantity at this point
without wanting to sound hostile, i'd like to say that if your design is at the cost of my security, i'd rather have my security.

try looking at HTAs, in the MS link in my sig. that might be what you're looking for.
__________________
bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

i am a loser geek, crazy with an evil streak,
yes i do believe there is a violent thing inside of me.
joh6nn is offline   Reply With Quote
Old 07-12-2002, 12:03 AM   PM User | #14
Quiet Storm
Regular Coder

 
Join Date: Jun 2002
Location: Beyond Lament
Posts: 424
Thanks: 0
Thanked 0 Times in 0 Posts
Quiet Storm is an unknown quantity at this point
HTA's secure? BS!

Quote:
(edited) is a tool which allows ANY file to be encoded and then embedded in plain HTML web page code as a script which will execute automatically by making use of the Hypertext Application (HTA) functions of the Microsoft Windows Scripting Host (WSH) which is called by a script embedded along with the encoded content inside that web page. It is not necessary to click on any link. The mere presence of the script in the page will automatically activate and execute (edited) which will then save the exploit to the computer's hard drive as an HTA file. This exploit was described previously by Georgi Guninski ("scriptlet exploit") but this represents the first time an automatic generator has been released along with all of the necessary source code to permit others to exploit further.


Besides, I've used this trick on a few of my sites. Never had any complaints. The Chromeless window trick is also a bug in IE - you gonna want to remove that feature from all the different sites that use it, too?

Last edited by Quiet Storm; 07-12-2002 at 12:26 AM..
Quiet Storm is offline   Reply With Quote
Old 07-12-2002, 12:24 AM   PM User | #15
joh6nn
wei wu wei


 
joh6nn's Avatar
 
Join Date: Jun 2002
Location: 72° W. 48' 57" , 41° N. 32' 04"
Posts: 1,887
Thanks: 0
Thanked 1 Time in 1 Post
joh6nn is an unknown quantity at this point
that's a rather moot point you make. The fact that neither HTAs nor embedded objects are in any way a good answer to this problem, is another excellent reason to give up on this. It can't be done without circumventing important security measures in some way, which ought to suggest that it shouldn't be done.
__________________
bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

i am a loser geek, crazy with an evil streak,
yes i do believe there is a violent thing inside of me.
joh6nn is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:45 PM.


Advertisement
Log in to turn off these ads.