Welcome to WebmasterWorld Guest from 54.167.0.111

Forum Moderators: ocean10000

Message Too Old, No Replies

Shell command to control browser window controls

browser window controls

     

beaudettee

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

5+ Year Member



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

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

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



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

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

5+ Year Member



I'll give this a try. Thank you!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month