I was forced to use the great script from here Safari 3rd party cookie iframe trick no longer working? to work for me in Safari and managed to get a payment widget working using one of the tricks. The trick fundamentally sets cookies and then redirects to the same page, in my case code designed for iframe. The problem is that the widget is now coming up tiny (1cm in diameter) and whilst I can resize it with a pinch move, I want it to fill the iPhone screen first time round. I have tried every known piece of javascript and viewport code I can find but alas either the widget ceases to appear or it is tiny. How can I get this widget to be the width of an iPhone when the page first opens? I cannot ditch the cookie solution. Thanks in advance for any help, Charlie.
<?php
if (isset($_GET['setdefaultcookie'])) {
// top level page, set default cookie then redirect back to canvas page
setcookie ('default',"1",0,"/");
$url = substr($_SERVER['REQUEST_URI'],strrpos($_SERVER['REQUEST_URI'],"/")+1);
$url = str_replace("setdefaultcookie","defaultcookieset",$url);
$url = 'http://app.junglepay.com/index.php?wkey=83604ccaf9e9a54b7807e32685cc090e6977da8d';
echo "<html>\n<body>\n<script>\ntop.location.href='".$url."';\n</script></body></html>";
exit();
} else if ((!isset($_COOKIE['default'])) && (!isset($_GET['defaultcookieset']))) {
// no default cookie, so we need to redirect to top level and set
$url = $_SERVER['REQUEST_URI'];
if (strpos($url,"?") === false) $url .= "?";
else $url .= "&";
$url .= "setdefaultcookie=1";
echo "<head></head>\n<html>\n<body>\n<script>\ntop.location.href='".$url."';\n</script></body></html>";
exit();
}
?>