[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

Mozilla Htm Code to open Mozilla as a kiosk

Gents

I am no expert in htm but i have found some code with which I can restrict mozila to be a kiosk style web browser

The only think is that when i run the code it opens up 2 windows

the first window is blank
the second opens up my kiosk style browser

I will paste the code into this page

But i am after someone to modify this so that when i execute this it only open up the kiosk style web page


<html>
<head>
<script language="javascript">
<!--
function WinOpen(){
window.open("http://htsvr1:82","","toolbar=yes,scrollbars=yes");
timeoutID=setTimeout("WinClose()", 1000);
}
function WinClose(){
window.close();
}
//-->
</script>
</head>
<body onLoad="WinOpen()">
</body>
</html>


Any ideas

Darren
 
0
DarrenJackson
Asked:
DarrenJackson
1 Solution
 
superm401Commented:
Easy answer:

It can't be done.

Hard answer:

It can if you have a signed script.  See http://www.mozilla.org/projects/security/components/jssec.html#sameorigin

The way you have it now, it will never close the window.  This is because Mozilla doesn't close windows that you didn't use a script to open.  I recommend you just let it be, and remind the user to close the original window.
0
 
DarrenJacksonAuthor Commented:
I am able to close the window behind the one i want.

So would it be possible to have a piece of code to do this without having someone close it manually.

It needs to be closed so that a user cannot browse past the windows he is allowed to view

Darren
0
 
superm401Commented:
Okay, you have two pages.  One opens the kiosk window(let that be page A), and the other is the kiosk window(page B).  If you make another one that opens page A using window.open(), everything will work.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DarrenJacksonAuthor Commented:
OKay

What  code do I use to close the other pages

Darren
0
 
cristy56Commented:
add this statement to your page A so that it will close automatically,
<BODY  LEFTMARGIN="0" TOPMARGIN="0" onLoad="setTimeout(window.close, 5000)">
you can modify the parameter 5000 to any number, the unit is in ms.

Cristy
0
 
superm401Commented:
Yeah, or your existing functions will work, provided you use javascript to open page A.
0
 
DarrenJacksonAuthor Commented:
I have a piece of vb code that opens up a web page but it opens up internet explorer

How would I be able to open up mozilla using the same piece of code

Private Sub Label2_Click()
 Terms.Show vbModal, Me

End Sub




Private Sub Form_Load()
    WebBrowser1.Navigate "http://htsvr1:82/index.php"


Above code is opening explorer instead of mozilla

Any Ideas

Darren
0
 
pmsyyzCommented:
cwkhang, he doesn't want to run Mozilla in kiosk mode, he just wants to open a browser window with minimal user interface.

cristy56, JavaScript cannot close a window that was not opened by JavaScript.

DarrenJackson, I would recommend just using a regular window.open() with the width and height set to the screen dimensions and all the various UI options (menubar, location, status, etc.) set to no.  You can't close the browser window that it is launched from.
0
 
DarrenJacksonAuthor Commented:
Gents

Thankyou all for helping me out but cwkhang was thier with the answer

Thank you

Darren
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now