<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <title>VKAudio</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="description" content="This is a default index page for a new domain."/> <link rel="shortcut icon" href="//vk.com/images/faviconnew.ico?3" /> <link rel="apple-touch-icon" href="//vk.com/images/safari_60.png"> <link rel="apple-touch-icon" sizes="76x76" href="//vk.com/images/safari_76.png"> <link rel="apple-touch-icon" sizes="120x120" href="//vk.com/images/safari_120.png"> <link rel="apple-touch-icon" sizes="152x152" href="//vk.com/images/safari_152.png"> <style type="text/css"> body {font-size:10px; color:#777777; font-family:arial; text-align:center;} h1 {font-size:64px; color:#555555; margin: 70px 0 50px 0;} p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } div {width:320px; text-align:center; margin-left:auto;margin-right:auto;} a:link {color: #34536A;} a:visited {color: #34536A;} a:active {color: #34536A;} a:hover {color: #34536A;} </style> </head> <body> <h1>Add this page to home screen and click</h1> <a href="#" id="setcookie" style="display: block; margin: 20px; font: 20px arial; color: #FFF; background: #45688E; padding: 10px; border-radius: 10px; box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.3);">HERE</a> </body> <script> var clickopen=document.getElementById("setcookie"); clickopen.onclick=function() { //set cookie var date = new Date( new Date().getTime() + 10*365*24*60*60*1000 ); document.cookie="openvkapp=true; path=/; expires="+date.toUTCString(); window.location.reload(); } <?php if(isset($_COOKIE["openvkapp"])) { ?> window.location="vk://vk.com/audio"; setTimeout(function(){ window.close(); },500); <?php } ?> </script> </html>
Source: https://habr.com/ru/post/376703/
All Articles