Forum Moderators: open

Message Too Old, No Replies

Setting the window to a certain width/height...

while removing all toolbars?

         

Wertigon

6:36 pm on Mar 17, 2004 (gmt 0)

10+ Year Member



Hey all, I'm trying to build a portfolio for a friend of mine, I've solved everything except this...

What my friend wants is a window with the dimensions of 750 * 500 that removes all toolbars. Now, no problems here since I can simply solve it using popups. However, my friend wants it so that if you double-click the index.html file, it opens up with the width/height set and toolbars gone.

Therefore, I wonder if there is some way to tell the browser to resize the *current* window and remove all toolbars, and not as a popup window?

Thanks for your help
- Wertigon

ajkimoto

7:32 pm on Mar 17, 2004 (gmt 0)

10+ Year Member



Wertigon,

You can resize (and move) the window using something like:

//move window to top left
self.moveTo(0,0)
//resize window to 750px wide by 500px high
self.resizeTo(750,500)

However there is no cross-browser code to remove toolbar, statusbar, etc in the current window, though there is some proprietary code that only works in netscape.

Wertigon

9:51 pm on Mar 17, 2004 (gmt 0)

10+ Year Member



Hmm... Okay, I see.

Then is there some way to load a dummy page that automaticly redirects you to a new popup window, and then close itself?

ajkimoto

10:18 pm on Mar 17, 2004 (gmt 0)

10+ Year Member



You will have trouble closing a window that was not itself loaded via a script. I believe that IE will allow you to do it, but only after you dismiss a dialog box. I know that Mozilla 1.5 will not allow you to do it at all. In any event, it is not an elegant solution.

So, you are probably back to using window.open() to open index.html in a new window that you can fully customize.

ajkimoto

Purple Martin

10:18 pm on Mar 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you try to make a window close itself, the browser gives the user a warning and the opportunity to cancel the close.

This is an important security feature: it would be a bad thing to remove all toolbars in the manner that you suggest because it would remove control of the browser from the user. Obviously this is not allowed! The browser belongs to the user not to you, so you shouldn't try to take control of it.

Wertigon

10:50 am on Mar 18, 2004 (gmt 0)

10+ Year Member



True... It's not a webpage for the web though, it's a webpage that's supposed to be on a CD.

Ah well, I guess I'll simply make a link then. It's not the prettiest of solutions, but it gets the job done.

Thanks for the help! Really appreciate it. :)

Leosghost

11:57 am on Mar 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can be done... without any problem ..for ie 5 and upwards ...
We played around with the idea for one of our sites ..
..eventually decided that people wouldn't be too pleased with the experience ( like.. how to hit a non existant back button? ) ....

Can it be done so it doesnt trip the security?..yes!..

Problem is.. you feel like you wrote and implemented a virus ...( the behaviour is basically that of an html virus ..with a single "internet session" life span )...

Just a "pop up" is the "white hat" way to do it ...

Even on a Cd.. be nice to people ...Amazing how people always think you can't catch "squat" from a Cd....

My second most lucrative form of "security work" is cleaning up ( particularly on XP ) after the "CD my friend loaned me " or " I got this cd from a magazine " ......

Wertigon

2:31 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



You're right, and normally I wouldn't consider this approach in the first place, but for this particular use I personally think it's a legit use, since you won't be *surfing* into the page, you'll be opening it directly. This makes it more like a traditional application.

However, since there is no way to do it cross-browser, I'm not going to lose my sleep over it, I'll just use the link approach which I *know* works cross-browser. Like I said, not the way I'd prefer it, but it gets the job done. :)