trying to close a window and open a new one without toolbars

A

Albretch

Hi,

client wants for a window with no toolbars to open (technical and
'esthetical' reasons) after the window, user clicks on, is being
closed.

I told them about security settings in browsers and no cross-browsers
solutions and all of that we know, but they have told me they have
seen that before and how then the annoying pop-up windows work? . . .

After reading and searching . . . I still don't see how to get it
right

This is what I have (see below) which is still prompts you with the
message:

"The Web page you are viewing is trying to close the window."

"Do you want to close the window?"

"[YES|NO]"

// Page1_WithBrowswerToolbars.jsp
// - - - - - - - - - - - - - - - - - Page1_With Browswer Toolbars

<html>
<head>
<title>Page1_WithBrowswerToolbars</title>
<script type="text/javascript" language="Javascript">
<!--
function newWindow(popWin){
// __
window.opener = self;
window.close();
// __
popWindow = window.open(popWin, 'popWin',
'width=700,height=600,resize=yes,toolbar=no,location=no,scrollbars=yes');
popWindow.focus();
}
-->
</script>
</head>

<body bgcolor="ffffff">
<center><h1>Page1 With Browser Toolbars</h1>
<br />
<br />
<a href="javascript:newWindow('./Page2_WithNoToolbars.jsp')">click
here to open window with no tool bars</a>
</center>
</body></html>

// Page2_WithNoToolbars.jsp
// - - - - - - - - - - - - - - - - - Page2 With No Toolbars
<html>
<head>
<title>Page2_WithNoToolbars</title>
<script type="text/javascript" language="Javascript">
<!--
function CloseParent(){
var hwnd = window.open('','Page1_WithBrowswerToolbars'); // notice,
no page included, only the title of the window you want to hijack
hwnd.close();
}
-->
</script>

</head>

<body onload="CloseParent()">
<center><h1>Page2_WithNoToolbars</h1></center>
</body></html>

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
A

Andrew Thompson

On 21 Jul 2004 13:00:58 -0700, Albretch wrote:

Read in c.l.j.programmer
client wants for a window with no toolbars to open

reader wants on-topic posts
<script type="text/javascript" language="Javascript">

Which this is not. What makes you think
Java programmers are qualified or able
to abswer JS questions? Most Java programmers
would not even recognize the mistake in that line.

Would you ask the baker about that problem
you are having with the roof on your house?

<http://groups.google.com/groups?q=group:comp.lang.javascript>

In future, please do not post JS questions to c.l.j.p.,
please do not cross-post to three groups (in case you
were wonderring if you might be that important - no,
you are not).

F'Ups set to c.l.js.
 
A

Albretch

Andrew Thompson said:
Would you ask the baker about that problem
you are having with the roof on your house?

Your parallelism I find more off-topic (and I would say stupid) than
my inquiry.

Proof?

I did a javascript group:comp.lang.java.programmer search and got
14,100 (including mine)

'"public class" group:comp.lang.javascript' gives you 359
'"public class" group:comp.lang.javascript -applet'; 108

'"public class" group:comp.infosystems.www.authoring.html'; 12

There must be a reason why javascript qs are more than 100% likely
posted on a java group than java qs are posted in JS/design ones. I
have constantly seen people asking HTML and Javascript questions to
server side java developers here in this group.

They usually complain about HTML/design people being cranky.
In future, please do not post JS questions to c.l.j.p.,
please do not cross-post to three groups (in case you
were wonderring if you might be that important - no,
you are not).

F'Ups set to c.l.js.

Thank you for letting me know how important I should think I am.

Now, do you want to become my mother too?
 
B

Brian

Albretch said:
I did a javascript group:comp.lang.java.programmer search

Great. But Java != JavaScript.
There must be a reason why javascript qs are more than 100% likely
posted on a java group than java qs are posted in JS/design ones.

There must be a reason why articles x-posted to more than one group
are often not appropriate for any of them.
I have constantly seen people asking HTML and Javascript questions to
server side java developers here in this group.

Java and JS questions are off-topic for ciwah, unless they pertain to
the markup used to include them in an html document.
Now, do you want to become my mother too?

Do you want to get plonked?
 
M

Murray

Your parallelism I find more off-topic (and I would say stupid) than
my inquiry.

Andrew's post was off-topic I guess *but you started it* :p He was simply
pointing out your mistake, so that you/others wouldn't make the same mistake
in the future. He could said it more succinctly and in a nicer way, but at
least he got his point across ...
Proof?

I did a javascript group:comp.lang.java.programmer search and got
14,100 (including mine)

'"public class" group:comp.lang.javascript' gives you 359
'"public class" group:comp.lang.javascript -applet'; 108

'"public class" group:comp.infosystems.www.authoring.html'; 12

I did a "depression" group:sci.med.cardiology search and got 886 results.
Then I did an "atherosclerosis" group:alt.support.depression.medication
search and got 62 results

I must remember from now on to post all depression related questions to
sci.med.cardiology as well
There must be a reason why javascript qs are more than 100% likely
posted on a java group than java qs are posted in JS/design ones. I
have constantly seen people asking HTML and Javascript questions to
server side java developers here in this group.

I'd take a guess that a large proportion of those would be
- posts like yours
- posts by newbies who don't realise the difference between Java and
Javascript
- posts containing the word Javascript but are not related to Javascript
(e.g. posted JSP code that has js code in it)
Thank you for letting me know how important I should think I am.

Now, do you want to become my mother too?

Waah
 
A

Albretch

Brian said:
Great. But Java != JavaScript.

Jeez! I new these guys would be able to even challenge Einsteins
equation.

They are so smart!!!
There must be a reason why articles x-posted to more than one group
are often not appropriate for any of them.


Java and JS questions are off-topic for ciwah, unless they pertain to
the markup used to include them in an html document.


Do you want to get plonked?

Reinforcing exactly my point.

Brian, you have really broken my heart, I could not sleep well
because of your language.
 
K

kaeli

Hi,

client wants for a window with no toolbars to open (technical and
'esthetical' reasons) after the window, user clicks on, is being
closed.

I told them about security settings in browsers and no cross-browsers
solutions and all of that we know, but they have told me they have
seen that before and how then the annoying pop-up windows work? . . .

They work in IE with no blocking software installed.
My browser, Netscape 7, blocks all that shit. So do many others,
including Firefox, Mozilla, and Opera.
IE on the lowest security setting allows a popup to close the opener,
IIRC.

What the client wants sounds best suited to an intranet application
where the users all have IE and can make the site "trusted". Is this the
case? If not, don't bother. Most internet users do not want popups and
none of them are going to trust your application to close the opener
from a popup. The very concept of such a thing is alien for Opera users,
since new "windows" are able to be opened in one browser instance.
Trying to close the opener might well close the entire application.
Now, if it IS an intranet application and the users have IE, try making
the site trusted in the low security settings. That might make the
message go away.

HTH

--
 
H

Harlan Messinger

Albretch said:
Hi,

client wants for a window with no toolbars to open (technical and
'esthetical' reasons) after the window, user clicks on, is being
closed.

I told them about security settings in browsers and no cross-browsers
solutions and all of that we know, but they have told me they have
seen that before and how then the annoying pop-up windows work? . . .

If I have my browser open and I'm browsing to one site, and then I go to
another, and then to another, and your client's site happens to be one of
them, then who the hell does your client think he is closing MY browser on
me and opening a different one without my normal configuration? Would your
client like it if he came to my web site and suddenly found that all his
icons had been removed from his desktop because I think a minimalist
appearance is more esthetically pleasing? Tell him how I configure my
software is my business and isn't subject to his esthetical sensibilities.
 
M

Murray

This is what I have (see below) which is still prompts you with the
message:

"The Web page you are viewing is trying to close the window."

"Do you want to close the window?"

"[YES|NO]"

Unfortunately, that's just what IE does if you try to close the *main*
browser window. You can close any other window without prompting, but you
will always be prompted if you try to close the main window (the very first
window after opening IE). I looked into this quite a while ago, and there
was no solution at the time, and I believe that is still the case.
 
H

Harlan Messinger

Murray said:
This is what I have (see below) which is still prompts you with the
message:

"The Web page you are viewing is trying to close the window."

"Do you want to close the window?"

"[YES|NO]"

Unfortunately, that's just what IE does if you try to close the *main*
browser window. You can close any other window without prompting, but you
will always be prompted if you try to close the main window (the very first
window after opening IE). I looked into this quite a while ago, and there
was no solution at the time, and I believe that is still the case.

And that's a good thing.
 
M

Murray

Harlan Messinger said:
Murray said:
This is what I have (see below) which is still prompts you with the
message:

"The Web page you are viewing is trying to close the window."

"Do you want to close the window?"

"[YES|NO]"

Unfortunately, that's just what IE does if you try to close the *main*
browser window. You can close any other window without prompting, but you
will always be prompted if you try to close the main window (the very first
window after opening IE). I looked into this quite a while ago, and there
was no solution at the time, and I believe that is still the case.

And that's a good thing.

Agreed :) It would have been nice to disable it for Intranet though, but it
was no big deal
 
D

Daniel R. Tobias

client wants for a window with no toolbars to open (technical and
'esthetical' reasons) after the window, user clicks on, is being
closed.

And I want a Web page that will detect that the person reading it is
the sort of jerk who wants to create pages that muck with my browser
settings, and proceed to electrocute that user in order to take such
antisocial tendencies out of the gene pool.

But you can't always get what you want...
 
R

Richard Cornford

Murray said:
Agreed :) It would have been nice to disable
it for Intranet though, but it was no big deal

There is a bug in current and past IE versions that allows it to be
tricked into closing a window that was not opened with a script, without
showing the dialog. But the technique is unlikely to be reiterated here
(as it is harmful in an Internet context). If you want to know the
unconditional truth you would have to search the comp.lang.javascript
archives for it.

Richard.
 
T

Thomas 'PointedEars' Lahn

Albretch said:
Jeez! I new these guys would be able to even challenge Einsteins
equation.

They are so smart!!!

While you cannot stop crossposting off-topic and replying
using what is left of your brain, would you please FOAD?


PointedEars, Score adjusted, F'up2 where it belongs
 
A

Albretch

I did a "depression" group:sci.med.cardiology . . .

Same old, same old.

Hard to tell if you should laugh or cry with these HMTL/Javascript
people, . . . they apparently not only challenge Einstein's equation
(see above), but they have also some clues about 'semantic fields' of
words and searching stuff

Jeez, aren't these little smart a$$*$?

Also, I think you have all misread my post in the eaiest possible
way.

I said, I will/need to:

1) open an initial window via target="_new", which would then

2) open a window from 1 which will not have toolbars and

3) would close 1

I wonder how/why would this change the world as we know it.
 
D

Daniel R. Tobias

Albretch said:
1) open an initial window via target="_new", which would then

2) open a window from 1 which will not have toolbars and

3) would close 1

Seems unnecessarily complex, even assuming for the sake of argument that
the opening of new windows, and the use of windows without toolbars, are
actually a good idea. Why not just open up the toolbar-less window in
step 1, and avoid the need for the extra interim window that just gets
closed anyway?
 
G

Grant Wagner

Albretch said:
I said, I will/need to:

1) open an initial window via target="_new", which would then

2) open a window from 1 which will not have toolbars and

3) would close 1

I wonder how/why would this change the world as we know it.

_You_ may have the best intentions in the world, and _you_ may have the
most pressing need in the world to do this. People's lives could be at
stake if you can't do this.

HOWEVER.

If _you_ can do this uninvited then _anyone_ can do it uninvited, and I
don't want Web sites doing this to *MY* Web browser running on *MY*
computer.

It would be like me saying "The gas meter reader needs to get in your
house to read the gas meter. He's just coming to read the meter and he's
perfectly honest, so the easiest thing to do would be to leave the door
on your house unlocked all the time, I don't see how this would change
the world as we know it."

As you can see, leaving the door unlocked for the gas meter reader seems
like a reasonable thing to do until you realize the world is filled with
lots of people who would take advantage of your unlocked door.
 
D

DU

Albretch wrote:

I said, I will/need to:

Did you really need to post this to a java programming newsgroup? Has
your post anything to do with java actually?
1) open an initial window via target="_new",

target="_new" is already invalid markup code.
"Except for the reserved names listed below, frame target names must
begin with an alphabetic character (a-zA-Z). User agents should ignore
all other target names."
http://www.w3.org/TR/html401/types.html#type-frame-target
which would then

You can not force this in NS 7.x and Mozilla-based browsers:
user_pref("browser.block.target_new_window", true);

Even HTML 4.01 Technical Recommendation clearly indicate that user
agents can bypass and override target="_blank" calls:

"User agents may provide users with a mechanism to override the target
attribute."
http://www.w3.org/TR/html401/present/frames.html#h-16.3.2
2) open a window from 1 which will not have toolbars and

Automatically opening an unrequested window will be filtered, prevented,
suppressed by a very wide majority of modern browsers nowadays:
NS 7.x, MSIE 6 SP2, Opera 7.x, K-meleon 0.8+, Galeon 1.x, Konqueror 3.x,
Safari 1.x, etc.. not to mention all kinds of 3rd parties add-ons,
browser extensions, etc.

You can not force Opera 7.x, Mozilla-based browsers to suppress
toolbars: that is just impossible to force.

user_pref("dom.disable_window_open_feature.toolbar", true);
user_pref("dom.disable_window_open_feature.location", true);
user_pref("dom.disable_window_open_feature.personalbar", true);
user_pref("dom.disable_window_open_feature.menubar", true);
user_pref("dom.disable_window_open_feature.scrollbars", true);
user_pref("dom.disable_window_open_feature.resizable", true);
user_pref("dom.disable_window_open_feature.minimizable", true);
user_pref("dom.disable_window_open_feature.status", true);


Since windows XP SP2 release, web developers can not remove by force
statusbar from new secondary windows.
3) would close 1

You can't even force that in Mozilla-based browsers either:
user_pref("dom.allow_scripts_to_close_windows", true);

while there are bugs filed for forcing scripts closing windows with a
cheap js window.opener trick in MSIE 7 and Opera 7: security is now
important you see.

I wonder how/why would this change the world as we know it.

Removing statusbar is removing the toolbar by which users can see http
connections, transfers, loading notifications, security (SSL) padlock
icon status: why would you (or your clients) need to remove such toolbar
from the users' browsers? Did you know that some security hacks were
successful because users could not see the difference (different urls)
between what was written in the statusbar and what was in the
locationbar? So, why would you (or your clients) want to remove both the
statusbar and locationbar on the users' browsers?

Why would leaving these toolbars present change anything for your own
security, your own personal info, your own sensitive info? If you or
your clients can not understand the users' perspective, then just put
and leave your credit card numbers, personal identifications, phone
numbers, etc.. on a webpage for a few days.

DU
 

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

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top