Forum Moderators: open
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
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.
So, you are probably back to using window.open() to open index.html in a new window that you can fully customize.
ajkimoto
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.
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 " ......
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. :)