-
Notifications
You must be signed in to change notification settings - Fork 5
/
site.html
53 lines (43 loc) · 1.72 KB
/
site.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-178226217-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-178226217-1');
</script>
</head>
<body id='mainbody'>
</body>
<!-- <script src='https://cdnjs.cloudflare.com/ajax/libs/lz-string/1.4.4/lz-string.js'></script> -->
<script>
function b64DecodeUnicode(str) {
// Going backwards: from bytestream, to percent-encoding, to original string.
return decodeURIComponent(atob(str).split('').map(function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
doc=location.href.replace('https://htmltourl.netlify.app/site.html?','')
//doc=location.href.replace('http://localhost:8080/html2url/site.html?','')
doc=doc.split("js=");
//document.getElementById('mainbody').innerHTML=decodeURIComponent(doc)
document.getElementById('mainbody').innerHTML=b64DecodeUnicode(doc[0])
var script = document.createElement("script");
// Add script content
script.innerHTML = b64DecodeUnicode(doc[1]);
// Append
document.head.appendChild(script);
console.log(atob('hi'));
console.log(btoa(atob('hi')));
console.log(btoa('hi'));
/*
var str = "This is my compression test.";
//console.log("Size of sample is: " + document.getElementById('data').value.replace('actual=','').length);
//var compressed = LZString.compress(document.getElementById('data').value.replace('actual=',''));
//console.log("Size of compressed sample is: " + compressed.length);
str = LZString.decompress(doc);
console.log("Sample is: " + str);
*/
//document.getElementById('mainbody').innerHTML=str
</script>