Redirect new window full screen

Started by aaa, January 11, 2008, 10:46:27 AM

aaa

Is there a way to input javascript on the redirect to open in a new window that is at full screen?

Thanks!

zubrag

Hi. Why don't you add javascript to resize window to the target page?
For example you want to redirect to my-protected-page.php. Place following into my-protected-page.php

<script language="JavaScript">
window.onload = maxWindow;

function maxWindow()
{
window.moveTo(0,0);


if (document.all)
{
  top.window.resizeTo(screen.availWidth,screen.availHeight);
}

else if (document.layers||document.getElementById)
{
  if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
  {
    top.window.outerHeight = screen.availHeight;
    top.window.outerWidth = screen.availWidth;
  }
}
}

</script>


source taken from http://support.microsoft.com/kb/287171

aaa

Is there a way to input javascript before hand? I think that is the only reason to remove the address bar, menu bar, button bar and status bar.

Thanks.

zubrag

The string you insert into the Redirect URL field is processed on server by PHP. PHP knows nothing about Javascript, so we cannot simply insert javascript in that field.

But maybe following would work for you.

Create some php file, for example redirects.php. File contents would be:

<html>
<head>
<script language="JavaScript">
window.open("<?php echo $_GET['url'] ?>",'newwindow',
'fullscreen=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
window.opener='x'; // avoid "The page is trying to close the window" message
window.close();
</script>
</head>
<body>
</body>
</html>

Than place your urls in following format into the Redirect URL:
http://www.example.com/path/to/the/redirects.php?url=PUT URL HERE

Summary: password protector will try to redirect to redirects.php passing real url as parameter. redirects.php would generate html page which would open fullsize window without toolbar. Original window will be closed.

aaa

Tried, but the script doesn't work.

There is a blank page on the redirect, and the address box is showing the redirect url string, not the final url.

I checked the source code of the blank page and it is "redirects.php" page. Something isn't being processed I guess. The opening of a new window, and then the closing of this one. Does something need to go in the body section?

Thanks a bunch!

zubrag

What is the source of that empty page? Did it replace <?php ?> with actual URL?  Do you have javascript enabled in the browser?

aaa

Sorry for the delay in getting back, I wanted to try different scripts that do the same, but have had no luck so far.

Regarding the variables passing through, yes that did work. It's just not loading the page.

Thanks.

zubrag

Please try again. I fixed code above. One line was broken into two, causing error.
Note: popup blockers may not allow you to open window.

aaa

Now, there is the blank page as before and a prompt "Do you want to close window?" The directed page is not coming in.

zubrag

I had the same "Do you want to close window?", and my popup blocker blocked new window.

in order for this to work popup blockers must be disabled. It works ok with popup blocker disabled.

wendyrosepairs

Yeah. I know the otao supply lots of the different model smartphone protector. High quality, good brand.

wendyrosepairs

Here i recommend you enter OTAO which can supply lots of premium protective film to protect your window full screen. Really wonderful.

OTAO has proprietary surface processing craft , which is helpful in protecting daily using dirts from the screen protector.