j"19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAutM/*
MIT License
Copyright (c) 2019 monkeylord
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
<!--
Bico Magic by Monkeylord
This is a single file service worker example that works on bico.media.
This file can be interpreted to both HTML and Javascript.
So it's both entrance and siteloader script.
Note: This magic only works on bico.media.
-->
<html>
<head>
<script>
// CleanUp comment
document.body.firstChild.remove()
// Ensure subdomain
var mypath = document.location.pathname
var hash = document.location.hash
if(mypath.endsWith('/')){
mypath=mypath.slice(0,mypath.length-1)
if(!navigator.serviceWorker.controller||!navigator.serviceWorker.controller.state=='activated'){
navigator.serviceWorker.oncontrollerchange = function() {
this.controller.onstatechange = function() {
if (this.state === 'activated') {
index()
}
};
};
navigator.serviceWorker.register(mypath+".js", {scope: mypath+"/"})
setTimeout("document.location.href = mypath+'/' + hash",5000)
}else{
index()
}
}else{
navigator.serviceWorker.register(mypath+".js", {scope: mypath+"/"})
setTimeout("document.location.href = mypath+'/' + hash",5000)
}
function index(){
console.log("Good! Siteloader is activated.")
if(hash=="")document.location.href="./index.html"
else document.location.href="./" +hash
}
</script>
</head>
<body>
<p>Loading...Please wait or <a href="" onclick="document.location.reload()">refresh this page manually</a>...</p>
</body>
</html>
<!--
*/
window=this
// JSEncrypt.js
importScripts('c1ac4721b5029b5d879e76720182c346838c1a6a139f99bd01538e7c7e780501')
// CryptoJS.js
importScripts('1b1ba5c0dece7a642c9a16a6c7bc73e62ebf595e2fa956bf09cdf4aff0660d01')
// SiteLoader.js
importScripts('75db3c4850beb00b8ddcb1092b7fe5c539839bb4b8705d0e6c09c1f98b4d2648')
// Your Site's RSA public key.
// Site's RSA key pair can be generated by openssl
// TODO: support certificate
var PubK = '-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoUGrWFtwHuSjbp56aeec\nsEQBmZB6IWhY7iluMJDTftqRyK7J7PJvr7dsBCRE7DWIV2/+Nszg0x2tt+hT5gzz\nDKdy96Xusn1qPqiyK+RG2lVlMS2ert8113KUN9e9ozQyvlOkmRFv/j0os/YN4f+E\nlkftIY1NPRrFaR0ZB7ktjVf5qjKsf/w4hW1PRDMCIAK2D6WGynn7694KgOJwnHcE\noDZ0ysjRDBK3sW/UijhRmE3QpYgoV9oa35Jkf6QY4PtE6Be4bHEk53hY9SBCoaRE\n9w+nAVUU/rVXjrjX+2yXtrFRdwUS1z77R14LbQ0s8cYn0xwjCuRRk+SafiyxY9FV\n9wIDAQAB\n-----END PUBLIC KEY-----'
// Initialize SiteLoader
var mSiteloader = new SiteLoader({
sitePubK : PubK,
siteId : "Blog",
endpoint : "https://bitgraph.network/q/",
apikey : "1NivvRMuW2UPmYXQg5JFaR8QjMPLasGVxA"
})
// Siteloader as server worker
self.addEventListener('fetch', function(event) {
mSiteloader.fetch(event)
});
//--> text/html
https://whatsonchain.com/tx/3def3fab84d446030e07f2d87c1174f57830bced9f37b2680a7f2627a25a3f34