Forum Moderators: open
If you want to create a page that opens in a chromeless window, when a link is clicked from the "launch page" it just requires some simple javascript. You can control the size of the new window by adjusting the width and height values.
Test this out yourself by copying the following two example pages. The first is the actual "popup" - be sure to save the page as "pop.htm" since that is the name of the "url" referenced in the "launch" page.
/* copy popup window page code below */
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- WebmasterWorld.com -->
<title>
Simple Chromeless Popup
</title>
</head>
<body>
<p>
This is a test<br />
[b]<a href="javascript:self.close()">Close this window</a>[/b]
</p>
</body>
</html> Then copy and paste the following, you can name the file "poptest.htm" or what ever you choose.
/* copy launch page code below */
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
Simple Popup Chromeless Window
</title>
</head>
<body>
[b]<script type="text/javascript">
function openpopup(){
var popurl="pop.htm"
winpops=window.open(popurl,"","width=300,height=330,scrollbars,")
}
</script>[/b]
<p>
[b]<a href="javascript:openpopup()">CLICK HERE</a>[/b]
</p>
</body>
</html> Then launch "poptest.htm" (or whatever you named the test page) and click on the link. The new window will launch and load "pop.htm" - I've included the "close window script" which is something you should always consider when launching "chromeless" browser windows.
Try doing a search for "chromeless windows" to learn more.
Thanks,
-Harsha
put this into the head or body of your html document:
<object id="WebBrowser1" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" width="0"></object>
WebBrowser1.ShowBrowserBar("{2318C2B1-4965-11d4-9B18-009027A5CD4F}", false);
If you use window.close in a window that your javascript did not open, you get an alert asking for user consent before that script will execute. So I assume that any other changes to basic browser features in a window you didn't open, even if/where possible, would also require user consent.
Yes, there might be a script-kiddie hack. But we're talking about legitimate code, not an exploit that gets around intended security.
Bottom line for me - if I opened the window, I want it to reflect my preferences, and I don't want any website to override me.
If a website wants that kind of control - they should open their own window. And if I don't like what they do, well, I'm an Opera user. I can open a full featured "duplicate" window with a right click.
btw, it's never difficult to override a website's setting, and
i prefer control over my browser, too ;)
Subjecting your visitors to a site that removes their browser controls is both unsettling and rude. In most cases, it is only thought "cool" by the designer. Leave the browser alone... work on the content "inside the chrome." Thats what it is all about anyway. ;)