Skip to content

Instantly share code, notes, and snippets.

@khanhicetea
Last active July 15, 2019 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khanhicetea/8d08c704bea02c809fcc87b8d8b7a2f5 to your computer and use it in GitHub Desktop.
Save khanhicetea/8d08c704bea02c809fcc87b8d8b7a2f5 to your computer and use it in GitHub Desktop.
Test Iframe in webview
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script>
var setTempCookie = function (name, value) {
var now = new Date(),
expires = 'expires=';
now.setTime(now.getTime() + 20000);
expires += now.toGMTString();
document.cookie = name + '=' + value + '; ' + expires + '; path=/';
return document.cookie;
}
var isCookieExisted = function (name) {
return document.cookie.split('; ').map(function(c) { return c.split('=')[0]; }).indexOf(name) >= 0;
};
setInterval(function(){
var node = document.createElement("li");
var textnode = document.createTextNode(document.cookie); // Create a text node
node.appendChild(textnode);
document.getElementById("main").appendChild(node);
}, 3000);
</script>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '359472231329751');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=359472231329751&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
</head>
<body>
<p><a href="https://gitcdn.xyz/repo/khanhicetea/8d08c704bea02c809fcc87b8d8b7a2f5/raw/e04f61509a681e9826926bc68a4cca483ac57eb1/test.html">Go to another page</a></p>
<ol id="main"></ol>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script>
var setTempCookie = function (name, value) {
var now = new Date(),
expires = 'expires=';
now.setTime(now.getTime() + 20000);
expires += now.toGMTString();
document.cookie = name + '=' + value + '; ' + expires + '; path=/';
return document.cookie;
}
var isCookieExisted = function (name) {
return document.cookie.split('; ').map(function(c) { return c.split('=')[0]; }).indexOf(name) >= 0;
};
setInterval(function(){
var node = document.createElement("li");
var textnode = document.createTextNode(document.cookie); // Create a text node
node.appendChild(textnode);
document.getElementById("main").appendChild(node);
}, 3000);
</script>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '359472231329751');
fbq('track', 'ViewContent');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=359472231329751&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
</head>
<body>
<ol id="main"></ol>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h1>Test page</h1>
<script>
window.onbeforeunload = function() {
return "Bạn có chắc chắn chưa ?";
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment