Hiding browser address bar without reloading

前端 未结 4 525
天命终不由人
天命终不由人 2021-01-26 05:18

I would like dynamically (via JavaScript) hide the address bar. I realize this can be done when opening a pop-up, but in this case I don\'t have the luxury (the file is being op

4条回答
  •  不知归路
    2021-01-26 05:31

    This javascript will open a browser window in Internet Explorer from a batch file, without showing the location bar.

    Replace all instances of # with <

    **OPEN.BAT -**
    
    echo ^#html^> >> %temp%\temp.htm
    
    echo ^#head^> >> %temp%\temp.htm
    
    echo ^#title^>^#/title^> >> %temp%\temp.htm
    
    echo ^#script language='JavaScript' type='text/javascript'^>function run(){window.open('','_self');var t = openWin(newWin())}function newWin(){window.open('http://www.bbc.co.uk','','location=0');window.close()}^#/script^> >> %temp%\temp.htm
    
    echo ^#/head^> >> %temp%\temp.htm
    
    echo ^#body onload='run()'^> ^#/body^> >> %temp%\temp.htm
    
    echo ^#/html^> >> %temp%\temp.htm
    
    "C:\Program Files\Internet Explorer\IEXPLORE.EXE" %temp%\temp.htm
    

提交回复
热议问题