Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1737
  • Last Modified:

Manipulate the browser (Force F11)

Hi,

1) How can I programmatically in an ASP page force the browser to go full screen ?  (Same as pressing F11) by the user.

2) How can I force the browser to auto-hide the toolbar when in Full Screen mode ?

Kind regards,
Yves Vindevogel


0
vindevogel
Asked:
vindevogel
  • 11
  • 9
  • 8
  • +3
1 Solution
 
John844Commented:
unless you open a new window, you can't.  When you open a new window, you can specify size and toolbars to show.
John
0
 
AzraSoundCommented:
You must open a new window, example:
http://www.bytchandbytes.com/ezscripts/window/form2.html
0
 
John844Commented:
here is some more info about the options available when opening a new window

     var sOptions = "";
     
     sOptions += 'width=600'                    //outter width of window in pixels
     sOptions += ',height=400'               //outter height of window in pixels
     sOptions += ',toolbar=yes'               //"back", "forward" and other buttons in the row
     sOptions += ',location=' + page;          //field displaying the current URL
     //sOptions += ',directories=??????'     // "What's New" and other buttons in the row
     sOptions += ',status=yes'               //Statusbar at the bottom of window
     sOptions += ',menubar=yes'               //menubar at top of window
     sOptions += ',scrollbars=yes'          //displays scrollbars if the document is larger than window
     sOptions += ',resizable=yes'               //allow resizing by dragging

the options string could then be used in the window.open statement
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
brunoCommented:
unless this is for a kiosk or something similar, i would NOT recommend it.  user's do not take kindly to losing the ability to navigate and use the toolbar.

if it IS for a kiosk environment, there are other solutions, besides doing it programmatically.

BRUNO
0
 
vindevogelAuthor Commented:
It's not for a kiosk app, but for our own apps ...
We develop all our apps browser based using a combination of VB, XML, ASP and XSL.

When the user logs into our "homepage", the browser may go full screen.  He/she doesn't need the toolbar anymore.


Is there a solution for the auto-hide ?
0
 
turbosigCommented:
The exact Answer to your question is:  IMPOSSIBLE

These functions were removed in the latest versions.
0
 
vindevogelAuthor Commented:
Hmm, all of these solutions open the new window covering my complete screen, BUT, that's still not the same as having pressed "F11".

Pressing F11 does some more things ...
Please experts, try that and see the difference.

I cannot accept any of these answers.
0
 
vindevogelAuthor Commented:
Bruno: I know some products like "Netshift" that do this, I do not need that ... Just a simulation of "F11"
0
 
turbosigCommented:
vind..

This feature was SPECIFICALLY removed from IE so that it is NOT possible. The reasons were abuse of this functionality.

Lets say this WAS possible and you did not offer a "close window" option on the page.  An inexperienced user may be baffled as to how to close the window.

Microsofts site EXPLICITLY explains that this keycode is NOT Trappable, therefore unmanipulatable.

~Turbo
0
 
AzraSoundCommented:
It would require an activeX solution now.
0
 
brunoCommented:
vind,

i was not talking about an outside app, you can append "-k" to the properties line of a IE shortcut...

ex:  "C:\Program Files\Plus!\Microsoft Internet\IEXPLORE.EXE" -k


this will open the browser in "kiosk" mode.... but you lose ALL functionality...other than keyboard shortcuts...ie: ctrl-o to open a URL, or alt-left arrow to go back...

but it doesn't sound like this is what you need.

can you explain WHAT functionality F11 offers that you are trying to maintain that the solutions posed have not offered?

BRUNO
0
 
brunoCommented:
btw:  if you try that kiosk thing, the easiest way to close the window is alt-F4....somepeople forget that
0
 
vindevogelAuthor Commented:
Bruno:
I have my webpage really all the way over my screen, even without a border or title bars or whatever .... Really nothing to see of IE.  It even overrides the start bar of Windows.

Turbo:
Sorry, but you're probably right.  But, it's not because the Mickeys don't allow me to do it, I won't do it  ;-)
In VB I can't do a lot of stuff with the things Microsoft puts in the manuals, altough a lot of Experts agree with me that you can do almost everything with VB.  (As long as VB does not have to be Virtual Blowj..)

AzraSound:
Euh, you got a clue on how to do it ?
0
 
vindevogelAuthor Commented:
hmm, I do like the -K option ....
Even better than the F11 stuff.

A way to force that ?
0
 
brunoCommented:
can't force it upon the user, no....just on whatever machine you have, that's why it's good for kiosk use.
0
 
turbosigCommented:
Well if you can find a way to force an action equivilent to the F11 key, I would pay big money for that, hell, I would give away all my points.

We have been wanting that ability ever since they rashed IE 3.0.  Seems IE and Windows together serve as a powerful force, and if Microsoft says you won't do it, I would PAY to see it done.

short of re-writing IE let me know.
0
 
AlfaNoMoreCommented:
Only works in IE, but use:

window.open("blah.html",pageName,"width=...,height=.....etc......,fullscreen=1);

should do the job.

Daniel Newman.

0
 
turbosigCommented:
AlfaNoMore,

Actually onload event not a new window.
0
 
AlfaNoMoreCommented:
I suppose only microsoft have the answer to this. I'm sure using Direct-X, you could do it. Maybe you'd need to get a reference to the existing IE object (your browser), and probably do something like objDirectXIE.FullScreenMode or something. It's got to be availabale. But not using JavaScript.
0
 
AlfaNoMoreCommented:
I'd like all your points please turbosig!!!!



<SCRIPT LANGUAGE="vbscript">
<!--Sub window_onLoad()
dim exp
set exp=Explorer
exp.fullscreen=true
end sub-->
</SCRIPT>

Haven't tried it, and it only works for IE, but looks good.

Daniel.
0
 
turbosigCommented:
daniel, won't work.
0
 
vindevogelAuthor Commented:
Daniel, most experts do not log into this side to have a laugh...

set exp = explorer .... ?

Have you been smoking ??
0
 
vindevogelAuthor Commented:
Hmm, iexplore.exe is surely not an ActiveX exe.
Does anyone know what DLL's are accessible ?
Or what DLL's IEplore uses ?
0
 
vindevogelAuthor Commented:
Hmm, thinking ...

In VB, you can load the "internet controls"
One of them is the "webbrowser"

This is IE without the borders ...
And has a property "FullScreen"

Maybe we can hack our way around it ....
0
 
AlfaNoMoreCommented:
Wasn't my code. I found it. And I did say I hadn't tested it. But you guys seem to be thinking about accessing IE's properties and methods directly, which is kinda my suggestion?
0
 
AzraSoundCommented:
This is how you can loop through open IE windows, but the FullScreen property is a property of the InternetExplorer object, and looping through the shell windows only returns a reference to the IWebBrowser2 interface, I believe, which does not exude that property.  This is not a limitation in VB, however...


<html>
<script language="VBScript">
Sub CallMe()
On Error Resume Next
Dim shWin, i
Set shWin = CreateObject("Shell.Application")
For i = 0 To shWin.Windows.Count - 1
    window.alert(shWin.Windows(i).LocationURL)
Next

Set shWin = Nothing
End Sub
</script>

<body onload="CallMe">
</body>
</html>
0
 
AzraSoundCommented:
Just found out that you can get a reference to the InternetExplorer object itself via the parent property of the WebBrowser interface:

<html>
<script language="VBScript">
Sub CallMe()
On Error Resume Next
Dim shWin, i
Set shWin = CreateObject("Shell.Application")
For i = 0 To shWin.Windows.Count - 1
    If shWin.Windows(i).LocationURL = "http://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20171764" Then
        shWin.Windows(i).Parent.FullScreen = True
    End If
Next

Set shWin = Nothing
End Sub
</script>

<body onload="CallMe">
</body>
</html>
0
 
turbosigCommented:
AzraSound, Couldn't get that to work either?? -- Now it sounds like I am the one who asked this question.
0
 
brunoCommented:
turbo,

just a guess, but you might need to check your options to make sure you allow activex to run?

bruno
0
 
AzraSoundCommented:
Yes it will require you allow ActiveX to run, and, you will get a popup informing you that a control is running.  Unless you have your security set for "everything goes", this will be the case.
0
 
brunoCommented:
a good guess on my part then  :-)  i think you were helping me on something once where i had the same problem, if i remember correctly.

BRUNO
0
 
turbosigCommented:
Maybe you need IE 5.5?
0
 
AzraSoundCommented:
Shouldnt...the ShellWindows automation object should have been available since IE4, maybe even IE3.
0
 
AzraSoundCommented:
This site claims IE4, but some issues that may arise with Win95 and winNT with earlier versions of the Shell

http://www.borncity.com/WSHBazaar/WSHShellWin.htm
0
 
turbosigCommented:
Possibly, we are on NT machines?  Weird, I have no problems with ActiveX on other apps???

Maybe I will try this at home?

If it does work, I will keep true to my promise of awarding dome "effort" points.

:)

Now this is the kind of place all developers should hang out..
0
 
brunoCommented:
vind,

check this site out....this is similiar to what you want to do?  you can view the javascript in the source...

http://www.turnofftheinternet.com/


BRUNO
0
 
brunoCommented:
vind,

how about coming back and giving us an update?

did the code from that last site i posted help you out at all?


BRUNO
0
 
vindevogelAuthor Commented:
Brunobear: this code seems to work indeed.

When I added window.close (); also, it even closed my window before opening the new one :-))

But, ....

Since when do browsers ask "this page wants to close the window, are you sure ?"   Is this a IE6 "feature" ?

Gonna accept yours bruno .... the "Fullscreen" in the features seems to pull the trick.
0
 
vindevogelAuthor Commented:
<html>
     <head>
          <script language="JavaScript">
               function fullScreen(URL)
               {
                    window.parent.close ();
                    window.open (URL, '', 'fullscreen=yes, width="110%", height="100%", menubar=no, toolbar=no, scrollbars=no, resizable=no');
               };
               
          </script>
     </head>
     <body>

          <p align="center">
               <a style="CURSOR: hand" onclick="fullScreen('home.asp')"><U>Enter the site</U></a>
          </p>
     </body>
</HTML>



This is my code now ... works fine  :-))
Thanks Bruno


(Sorry guys, i'd forgotten about this question)
0
 
AzraSoundCommented:
>>Since when do browsers ask "this page wants to close the window, are you sure ?"

It always asks if its the original window.  You can only close windows you spawn...otherwise, people could just be browsing along and have sites shut down their browser window.
0
 
vindevogelAuthor Commented:
Hmmmm ... do you think there's a way around this ?
If you think it could be done, i'm going to post a new question on that.
0
 
brunoCommented:
thanks for the A vind, as far as your new question I don't think it can be done for the reason Azra stated.  You can easily close windows that you have spawned using javascript.  the easy was i've remembered is if i opened the window with javascript, then i can close it with javascript with no pop up message.  not sure how your site works, but if you can open the window before with javascript as well, you should be able to close it with javascript....


BRUNO
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 11
  • 9
  • 8
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now