aboutsummaryrefslogtreecommitdiffstats
path: root/addons/bcmaFX/cs.js
diff options
context:
space:
mode:
authorJim Gonzales <09893eab840e3b392c98991c02a0deabae502139@cloudflare.com>2020-07-31 12:33:37 +0200
committerJim Gonzales <09893eab840e3b392c98991c02a0deabae502139@cloudflare.com>2020-07-31 12:33:37 +0200
commitf542983f872b60a990192bfaa0bf9c4b36f883d3 (patch)
tree6ce6e07afd5d2bbc8159d22be6a5ac958e2897c4 /addons/bcmaFX/cs.js
parent6d71f2e102045df15b45fb6e2dbfd042d302d6ed (diff)
downloadcloudflare-tor-f542983f872b60a990192bfaa0bf9c4b36f883d3.tar.lz
cloudflare-tor-f542983f872b60a990192bfaa0bf9c4b36f883d3.tar.xz
cloudflare-tor-f542983f872b60a990192bfaa0bf9c4b36f883d3.zip
cs.js
Diffstat (limited to 'addons/bcmaFX/cs.js')
-rw-r--r--addons/bcmaFX/cs.js50
1 files changed, 49 insertions, 1 deletions
diff --git a/addons/bcmaFX/cs.js b/addons/bcmaFX/cs.js
index dcdd4815..82be38ef 100644
--- a/addons/bcmaFX/cs.js
+++ b/addons/bcmaFX/cs.js
@@ -1 +1,49 @@
-sync \ No newline at end of file
+if (document.body && !location.hostname.endsWith('.onion')) {
+ browser.runtime.onMessage.addListener((a, b, c) => {
+ if (a[0] == location.hostname && a[1]) {
+ if (a[2]) {
+ let _tt = document.title;
+ function codeBy_Sw_updateBorder() {
+ if (!document.title.startsWith('[!!MITM')) {
+ document.title = '[!!MITM!!]' + _tt;
+ }
+ document.body.style = 'border:6px dashed #' + ['e74c3c', '9b59b6', '3498db', '17a589', '196f3d', 'f4d03f', 'f39c12', 'd35400'][Math.floor(Math.random() * 8)] + ' !important';
+ setTimeout(codeBy_Sw_updateBorder, 6500);
+ }
+ codeBy_Sw_updateBorder();
+ }
+ if (a[3]) {
+ function codeBy_smege1001_decodeEmail(hash) {
+ let decoded = '',
+ hashArray = [];
+ for (let hAIndex = 0; hAIndex < hash.length; hAIndex += 2) {
+ hashArray.push(parseInt(hash.substring(hAIndex, hAIndex + 2), 16));
+ }
+ let key = hashArray[0];
+ for (let index = 1; index < hashArray.length; index++) {
+ decoded += String.fromCharCode(hashArray[index] ^ key);
+ }
+ return decoded;
+ }
+ document.querySelectorAll('.__cf_email__[data-cfemail]:not(a)').forEach(a => {
+ let aV = a.dataset.cfemail;
+ if (/^([a-f0-9]{4,})$/.test(aV)) {
+ a.dataset.cfemail = '';
+ a.innerText = codeBy_smege1001_decodeEmail(aV);
+ }
+ });
+ document.querySelectorAll("a.__cf_email__[data-cfemail]").forEach(a => {
+ let aV = a.dataset.cfemail;
+ if (/^([a-f0-9]{4,})$/.test(aV)) {
+ a.dataset.cfemail = '';
+ a.innerText = codeBy_smege1001_decodeEmail(aV);
+ a.href = 'mailto:' + a.innerText;
+ }
+ });
+ }
+ }
+ c(true);
+ return;
+ });
+ browser.runtime.sendMessage(['cs', location.hostname]);
+} \ No newline at end of file