homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Shell command to control browser window controls
browser window controls
beaudettee




msg:4434967
 8:15 pm on Mar 29, 2012 (gmt 0)

Hi All:

I am building an autorun file for a cd to launch a webpage in a users default browser that will display an html menu of the items on the CD.

I am OK with using a basic shell command to launch a file in a browser, however ideally I would also like the ability to strip the browser of all control (menus, navigation etc) and set height and width etc. and I am stuck.

I am also familiar with opening a browser using javascript in a webpage but not using the windows scripting host or wscript.exe.

Any help/guidance would be greatly appreciated.

Thanks!

 

Ocean10000




msg:4435482
 1:59 am on Mar 31, 2012 (gmt 0)

One of the methods I found on the net, was a two file solution. This works some times but fails if a popup blocker stops it.

The initial file which is launched by the auto run, and your menu html file.

The initial file calls a javascript method which opens a new window (your menu) and closes the original window. Some web browser popup blockers will stop this.

This function is in the initial html file called from the autorun.


function openWindow(){
var browser=navigator.appName;
if (browser=="Microsoft Internet Explorer"){
window.opener=self;
}
window.open('popup.html', 'null', 'width=900,height=750,toolbar=no,scrollbars=no,location=no,resizable =yes');
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height-100);
parent.close(); //Closing on the child
}
</script>


This can be called from the body onload method.

onload="window.open('','_parent','');openWindow()"


Notes:
The reason that this two file method approach is required, is that modern web browsers unless you open a new window you can not remove the scroll bars and other features from the currently active window.

reference
Window open() Method [w3schools.com]

beaudettee




msg:4436811
 6:35 pm on Apr 3, 2012 (gmt 0)

I'll give this a try. Thank you!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved