Ok bear with me, kind of a long explantion coming. In our company, we used to use IE 6. Our Intranet page that loaded on default contained the following code:
--INDEX.HTML--
As you can see, this would open a user agreement page in full screen mode, then close the parent window. The agreement page contained the following code:
--AGREEMENT.HTML--
As you can see, this page contained our user agreement, along with two buttons. If the user did not agree, the browser would close. If they clicked AGREE, then a confirmation window would pop up and make them confirm their agreement. If they clicked YES, they would continue to our main Intranet page, if they clicked NO, then the browser would close.
Our main Intranet page contained the following script:
--INTRANET/INDEX.HTML--
This script would make sure that the page was properly sized and aligned with the users desktop setting.
All in all, this script worked flawlessly in IE 6 (although some of you are probably screaming because there may be a much simpler way to do this). However, we have just made the transition to Firefox 1.0.1, and this script does not work. When run as is, the INDEX.HTML (the very first page) does not close, leaving a window open at all times. The user can then close the agree page without agreeing to anything, and continue surfing on the parent window. That is bad. I know why this script, as is, does not work in firefox. Window.Close() will only work in firefox if it is executed within the same script that opened the window. Since the window was opened by the user when they double-clicked on the Firefox icon, there is no opening script, so firefox blocks the window.close().
Basically, I need help converting my existing script (or writting new script) so that the following occurs:
1) an agreement page loads with no options to navigate away (no address bar, no tool bar, no bookmarks, no additional windows etc.)
2) The user must confirm their agreement to the policy.
3) no additional windows should be open that the user can potentially use to navigate past the agreement without actually agreeing.
4) once agreed to, the intranet index page needs to load and expand to the user's full screen size.
Thank you for enduring such exhausting blabbering, and thank you even more for your assitance.
--INDEX.HTML--
Code:
<body>
<script>
<!--
window.open("agreement.html","agreepage","fullscreen")
window.opener=self
window.close()
//-->
</script>
</body>
As you can see, this would open a user agreement page in full screen mode, then close the parent window. The agreement page contained the following code:
--AGREEMENT.HTML--
Code:
<body>
<script language="javascript">
<!--
function agree() \\if user clicks AGREE button
{
var agreechoice=confirm("Technology User Agreement Confirmation\n\nBy Clicking on 'OK', you are confirming your agreement to the rules and regulation set forth by this district concerning proper Internet use.")
if (agreechoice) \\if user clicked AGREE button, then clicked YES on confirm dialog box
{
var macagree = "top=0,left=0,width=740,height=540,menubar,scrollbars,status,toolbar,location,resizable"
var winagree = "top=0,left=0,width=740,height=540,menubar,scrollbars,status,toolbar,location"
if (navigator.appVersion.indexOf("Win") > 0)
{
window.open("Intranet/index.html","main",winagree)
window.opener=self
window.close()
}
if (navigator.appVersion.indexOf("Mac") > 0)
{
window.open("Intranet/index.html","main",macagree)
window.opener=self
window.close()
}
}
else \\if user clicked AGREE button, then clicked NO on confirm dialog box
{
window.opener=self
window.close()
}
}
function closebrowser() \\if user clicked DO NOT AGREE button
{
window.opener=self
window.close()
}
//-->
</script>
...
...
...
</body>
As you can see, this page contained our user agreement, along with two buttons. If the user did not agree, the browser would close. If they clicked AGREE, then a confirmation window would pop up and make them confirm their agreement. If they clicked YES, they would continue to our main Intranet page, if they clicked NO, then the browser would close.
Our main Intranet page contained the following script:
--INTRANET/INDEX.HTML--
Code:
<head>
...
...
...
<script>
<!--
function windowchange(){
if (navigator.appVersion.indexOf("Win") > 0) {
if (navigator.appVersion.indexOf("MSIE")!=-1) {
window.moveTo(0,0);window.resizeTo(screen.availwidth,screen.availheight)}}}
windowchange()
//-->
</script>
</head>
This script would make sure that the page was properly sized and aligned with the users desktop setting.
All in all, this script worked flawlessly in IE 6 (although some of you are probably screaming because there may be a much simpler way to do this). However, we have just made the transition to Firefox 1.0.1, and this script does not work. When run as is, the INDEX.HTML (the very first page) does not close, leaving a window open at all times. The user can then close the agree page without agreeing to anything, and continue surfing on the parent window. That is bad. I know why this script, as is, does not work in firefox. Window.Close() will only work in firefox if it is executed within the same script that opened the window. Since the window was opened by the user when they double-clicked on the Firefox icon, there is no opening script, so firefox blocks the window.close().
Basically, I need help converting my existing script (or writting new script) so that the following occurs:
1) an agreement page loads with no options to navigate away (no address bar, no tool bar, no bookmarks, no additional windows etc.)
2) The user must confirm their agreement to the policy.
3) no additional windows should be open that the user can potentially use to navigate past the agreement without actually agreeing.
4) once agreed to, the intranet index page needs to load and expand to the user's full screen size.
Thank you for enduring such exhausting blabbering, and thank you even more for your assitance.