kopia lustrzana https://github.com/robinmoisson/staticrypt
remove google analytics, save traffic to supabase
rodzic
0347b4429d
commit
1162e35e2c
|
@ -349,7 +349,7 @@ exports.init = init;
|
||||||
var decode = codec.init(cryptoEngine).decode;
|
var decode = codec.init(cryptoEngine).decode;
|
||||||
|
|
||||||
// variables to be filled when generating the file
|
// variables to be filled when generating the file
|
||||||
var encryptedMsg = '30d59eebfa6443549af9f78e49525e458bd5d4ee783cb2fc5a61882f62769d8ec467ba45c6c10554321b4ff338b9baacU2FsdGVkX1/M666zWrcMkpw3mxNzMVp8DMjVCvC7R6wGFtZMgA17LV7KuFWo9vqiCoqz52rvljIuZ65Uq5xFJxKGZAAhXfiKrfNnlhcoEsqrdLH/RVRqC2VKPwlM+6OyMd2GB5FV79kWJW9xlnrUjpokIbq7OqIfKooQ8hSKsJFqHNJFYzLNuGMtvERC23jgSFXSKoCACBPXsSgqCdrxbQ==',
|
var encryptedMsg = '01f9008b256609f2bfd27da9643e2718817d28fb4b194104090d3f485c2623cbb629bd9fa1fe315a50e0f7dd50c4c98eU2FsdGVkX1+ZSG96042ErwkyOo9O7uOc/v2KMt4XH1MQIYfg4VW0Rb7somvWeSOYTps0rc5M56su4rSdzrwfaaaYMvdNdj9CGtL0vKKl3zrOnfZYCnFhT/1Y/Dg0CTaC2o1erNl50uzwvY/98mwNPQLMu+zgn4EjkzayWdNIiQ7zFR28JcBSILlBlnrpIm16c8A0MVj7SdoSXnYtWrviOw==',
|
||||||
salt = 'b93bbaf35459951c47721d1f3eaeb5b9',
|
salt = 'b93bbaf35459951c47721d1f3eaeb5b9',
|
||||||
labelError = 'Bad password!',
|
labelError = 'Bad password!',
|
||||||
isRememberEnabled = true,
|
isRememberEnabled = true,
|
||||||
|
|
49
index.html
49
index.html
|
@ -24,24 +24,6 @@
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
|
||||||
(function (i, s, o, g, r, a, m) {
|
|
||||||
i['GoogleAnalyticsObject'] = r;
|
|
||||||
i[r] = i[r] || function () {
|
|
||||||
(i[r].q = i[r].q || []).push(arguments)
|
|
||||||
}, i[r].l = 1 * new Date();
|
|
||||||
a = s.createElement(o),
|
|
||||||
m = s.getElementsByTagName(o)[0];
|
|
||||||
a.async = 1;
|
|
||||||
a.src = g;
|
|
||||||
m.parentNode.insertBefore(a, m)
|
|
||||||
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
|
|
||||||
|
|
||||||
ga('create', 'UA-73629908-2', 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -450,6 +432,25 @@ exports.genFile = genFile;
|
||||||
.innerText.replace(/window\.\w+ = /, '');
|
.innerText.replace(/window\.\w+ = /, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register something happened - this uses a simple Supabase function to implement a counter, and allows use to drop
|
||||||
|
* google analytics.
|
||||||
|
*
|
||||||
|
* @param action
|
||||||
|
*/
|
||||||
|
function trackEvent(action) {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open('POST', 'https://zlgpaemmniviswibzuwt.supabase.co/rest/v1/rpc/increment_analytics', true);
|
||||||
|
xhr.setRequestHeader('Content-type', 'application/json; charset=UTF-8')
|
||||||
|
xhr.setRequestHeader('apikey', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpsZ3BhZW1tbml2aXN3aWJ6dXd0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NjkxMjM0OTcsImV4cCI6MTk4NDY5OTQ5N30.wNoVDHG7F6INx-IPotMs3fL1nudfaF2qvQDgG-1PhNI')
|
||||||
|
xhr.setRequestHeader('Authorization', 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpsZ3BhZW1tbml2aXN3aWJ6dXd0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NjkxMjM0OTcsImV4cCI6MTk4NDY5OTQ5N30.wNoVDHG7F6INx-IPotMs3fL1nudfaF2qvQDgG-1PhNI')
|
||||||
|
xhr.send(
|
||||||
|
JSON.stringify({
|
||||||
|
action_input: action
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill the password prompt template with data provided.
|
* Fill the password prompt template with data provided.
|
||||||
* @param data
|
* @param data
|
||||||
|
@ -483,12 +484,19 @@ exports.genFile = genFile;
|
||||||
request.send();
|
request.send();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// register page load
|
||||||
|
window.onload = function () {
|
||||||
|
trackEvent('show_index');
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle form submission.
|
* Handle form submission.
|
||||||
*/
|
*/
|
||||||
document.getElementById('encrypt_form').addEventListener('submit', function (e) {
|
document.getElementById('encrypt_form').addEventListener('submit', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
trackEvent('generate_encrypted');
|
||||||
|
|
||||||
// update instruction textarea value with CKEDITOR content
|
// update instruction textarea value with CKEDITOR content
|
||||||
// (see https://stackoverflow.com/questions/3147670/ckeditor-update-textarea)
|
// (see https://stackoverflow.com/questions/3147670/ckeditor-update-textarea)
|
||||||
CKEDITOR.instances['instructions'].updateElement();
|
CKEDITOR.instances['instructions'].updateElement();
|
||||||
|
@ -529,7 +537,6 @@ exports.genFile = genFile;
|
||||||
} else {
|
} else {
|
||||||
setFileToDownload(data);
|
setFileToDownload(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('toggle-extra-option')
|
document.getElementById('toggle-extra-option')
|
||||||
|
@ -556,6 +563,10 @@ exports.genFile = genFile;
|
||||||
*/
|
*/
|
||||||
document.getElementById('download-link')
|
document.getElementById('download-link')
|
||||||
.addEventListener('click', function (e) {
|
.addEventListener('click', function (e) {
|
||||||
|
// only register the click event if there is actually a generated file
|
||||||
|
if (htmlToDownload) {
|
||||||
|
trackEvent('download_encrypted');
|
||||||
|
}
|
||||||
|
|
||||||
var isIE = (navigator.userAgent.indexOf("MSIE") !== -1) || (!!document.documentMode === true); // >= 10
|
var isIE = (navigator.userAgent.indexOf("MSIE") !== -1) || (!!document.documentMode === true); // >= 10
|
||||||
var isEdge = navigator.userAgent.indexOf("Edge") !== -1;
|
var isEdge = navigator.userAgent.indexOf("Edge") !== -1;
|
||||||
|
|
|
@ -24,24 +24,6 @@
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
|
||||||
(function (i, s, o, g, r, a, m) {
|
|
||||||
i['GoogleAnalyticsObject'] = r;
|
|
||||||
i[r] = i[r] || function () {
|
|
||||||
(i[r].q = i[r].q || []).push(arguments)
|
|
||||||
}, i[r].l = 1 * new Date();
|
|
||||||
a = s.createElement(o),
|
|
||||||
m = s.getElementsByTagName(o)[0];
|
|
||||||
a.async = 1;
|
|
||||||
a.src = g;
|
|
||||||
m.parentNode.insertBefore(a, m)
|
|
||||||
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
|
|
||||||
|
|
||||||
ga('create', 'UA-73629908-2', 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -245,6 +227,25 @@ Filename changed to circumvent adblockers that mistake it for a crypto miner (se
|
||||||
.innerText.replace(/window\.\w+ = /, '');
|
.innerText.replace(/window\.\w+ = /, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register something happened - this uses a simple Supabase function to implement a counter, and allows use to drop
|
||||||
|
* google analytics.
|
||||||
|
*
|
||||||
|
* @param {string} action
|
||||||
|
*/
|
||||||
|
function trackEvent(action) {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open('POST', 'https://zlgpaemmniviswibzuwt.supabase.co/rest/v1/rpc/increment_analytics', true);
|
||||||
|
xhr.setRequestHeader('Content-type', 'application/json; charset=UTF-8')
|
||||||
|
xhr.setRequestHeader('apikey', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpsZ3BhZW1tbml2aXN3aWJ6dXd0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NjkxMjM0OTcsImV4cCI6MTk4NDY5OTQ5N30.wNoVDHG7F6INx-IPotMs3fL1nudfaF2qvQDgG-1PhNI')
|
||||||
|
xhr.setRequestHeader('Authorization', 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpsZ3BhZW1tbml2aXN3aWJ6dXd0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NjkxMjM0OTcsImV4cCI6MTk4NDY5OTQ5N30.wNoVDHG7F6INx-IPotMs3fL1nudfaF2qvQDgG-1PhNI')
|
||||||
|
xhr.send(
|
||||||
|
JSON.stringify({
|
||||||
|
action_input: action
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill the password prompt template with data provided.
|
* Fill the password prompt template with data provided.
|
||||||
* @param data
|
* @param data
|
||||||
|
@ -278,12 +279,19 @@ Filename changed to circumvent adblockers that mistake it for a crypto miner (se
|
||||||
request.send();
|
request.send();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// register page load
|
||||||
|
window.onload = function () {
|
||||||
|
trackEvent('show_index');
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle form submission.
|
* Handle form submission.
|
||||||
*/
|
*/
|
||||||
document.getElementById('encrypt_form').addEventListener('submit', function (e) {
|
document.getElementById('encrypt_form').addEventListener('submit', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
trackEvent('generate_encrypted');
|
||||||
|
|
||||||
// update instruction textarea value with CKEDITOR content
|
// update instruction textarea value with CKEDITOR content
|
||||||
// (see https://stackoverflow.com/questions/3147670/ckeditor-update-textarea)
|
// (see https://stackoverflow.com/questions/3147670/ckeditor-update-textarea)
|
||||||
CKEDITOR.instances['instructions'].updateElement();
|
CKEDITOR.instances['instructions'].updateElement();
|
||||||
|
@ -324,7 +332,6 @@ Filename changed to circumvent adblockers that mistake it for a crypto miner (se
|
||||||
} else {
|
} else {
|
||||||
setFileToDownload(data);
|
setFileToDownload(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('toggle-extra-option')
|
document.getElementById('toggle-extra-option')
|
||||||
|
@ -351,6 +358,10 @@ Filename changed to circumvent adblockers that mistake it for a crypto miner (se
|
||||||
*/
|
*/
|
||||||
document.getElementById('download-link')
|
document.getElementById('download-link')
|
||||||
.addEventListener('click', function (e) {
|
.addEventListener('click', function (e) {
|
||||||
|
// only register the click event if there is actually a generated file
|
||||||
|
if (htmlToDownload) {
|
||||||
|
trackEvent('download_encrypted');
|
||||||
|
}
|
||||||
|
|
||||||
var isIE = (navigator.userAgent.indexOf("MSIE") !== -1) || (!!document.documentMode === true); // >= 10
|
var isIE = (navigator.userAgent.indexOf("MSIE") !== -1) || (!!document.documentMode === true); // >= 10
|
||||||
var isEdge = navigator.userAgent.indexOf("Edge") !== -1;
|
var isEdge = navigator.userAgent.indexOf("Edge") !== -1;
|
||||||
|
|
Ładowanie…
Reference in New Issue