summaryrefslogtreecommitdiffstats
path: root/addon_chrome/bcma
diff options
context:
space:
mode:
authornot_cloudflare <not_cloudflare@noreply.codeberg.org>2019-07-13 04:04:13 +0200
committernot_cloudflare <not_cloudflare@noreply.codeberg.org>2019-07-13 04:04:13 +0200
commitaa9c54dc7ceaa404a1c98f2aedb6a4e0f449320a (patch)
tree94b183a1897f9285071c0777603885504ffd53db /addon_chrome/bcma
parentcb75b7305f89187182d9fbee0e240976512837ec (diff)
downloadcloudflare-tor-aa9c54dc7ceaa404a1c98f2aedb6a4e0f449320a.tar
cloudflare-tor-aa9c54dc7ceaa404a1c98f2aedb6a4e0f449320a.tar.gz
cloudflare-tor-aa9c54dc7ceaa404a1c98f2aedb6a4e0f449320a.tar.lz
cloudflare-tor-aa9c54dc7ceaa404a1c98f2aedb6a4e0f449320a.tar.xz
cloudflare-tor-aa9c54dc7ceaa404a1c98f2aedb6a4e0f449320a.zip
Upload files to 'addon_chrome/bcma'
Diffstat (limited to 'addon_chrome/bcma')
-rw-r--r--addon_chrome/bcma/LICENSE.txt2
-rw-r--r--addon_chrome/bcma/anticloudflare.js42
-rw-r--r--addon_chrome/bcma/manifest.json2
-rw-r--r--addon_chrome/bcma/mydata.html6
-rw-r--r--addon_chrome/bcma/mydata.js19
5 files changed, 15 insertions, 56 deletions
diff --git a/addon_chrome/bcma/LICENSE.txt b/addon_chrome/bcma/LICENSE.txt
index 4843373f..6cac1ebf 100644
--- a/addon_chrome/bcma/LICENSE.txt
+++ b/addon_chrome/bcma/LICENSE.txt
@@ -3,7 +3,7 @@ The MIT License
Copyright (c) 2017 Project BCMA
Copyright (c) 2017 cypherpunks
Copyright (c) 2017 nullius <nullius@nym.zone>
-Copyright (c) 2018 Searxes <searxes.danwin1210.me>
+Copyright (c) 2019 Searxes <searxes.eu.org>
Copyright (c) 2018 Jeff Cliff <@jeffcliff@niu.moe>
Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/addon_chrome/bcma/anticloudflare.js b/addon_chrome/bcma/anticloudflare.js
index 3d5f1b02..10ce4a48 100644
--- a/addon_chrome/bcma/anticloudflare.js
+++ b/addon_chrome/bcma/anticloudflare.js
@@ -1,24 +1,12 @@
/*
"Welcome to PRISM 2.0"
*/
-var cf_flag_ok = 'icons/cf_0.png';
-var cf_flag_ng = 'icons/cf_1.png';
-var force_whitelist = ['searxes.cf', 'thunderbird.net', 'mozilla.org', 'archive.org', 'cloudflare.com', 'cloudflareapps.com', 'cloudflare-dns.com', 'cloudflarestatus.com', 'cloudflareapi.com', 'cloudflare-ipfs.com', 'cloudflare-quic.com'];
-var cfdomains = [];
-var known_cf_domains = [];
-
-fetch('bcmadata.txt', {
- method: 'GET'
-}).then(function (b) {
- return b.text();
-}).then(function (b) {
- cfdomains = b.split("\n").filter(v => v != '');
- known_cf_domains = cfdomains;
-});
-
-var my_cf_collection = [];
-var my_cf_ignore = [];
-var my_action = 2;
+const cf_flag_ok = 'icons/cf_0.png';
+const cf_flag_ng = 'icons/cf_1.png';
+const force_whitelist = ['searxes.eu.org', 'thunderbird.net', 'mozilla.org', 'archive.org', 'cloudflare.com', 'cloudflareapps.com', 'cloudflare-dns.com', 'cloudflarestatus.com', 'cloudflareapi.com', 'cloudflare-ipfs.com', 'cloudflare-quic.com'];
+let my_cf_collection = [];
+let my_cf_ignore = [];
+let my_action = 2;
function onError(e) {
console.log(`BCMA: Error:${e}`);
@@ -43,7 +31,7 @@ function get_realdomain(w) {
}
}
if (wa[0] == 'org') {
- if (wa[1] == 'ae') {
+ if (wa[1] == 'ae' || wa[1] == 'eu') {
return wa[2] + "." + wa[1] + "." + wa[0];
}
}
@@ -620,7 +608,7 @@ function update_icon(tid, url) {
});
return;
}
- if (known_cf_domains.includes(cf_hostname) || my_cf_collection.includes(cf_hostname)) {
+ if (my_cf_collection.includes(cf_hostname)) {
if (my_action == 3) {
chrome.tabs.executeScript(tid, {
matchAboutBlank: true,
@@ -678,7 +666,7 @@ chrome.webRequest.onHeadersReceived.addListener(function (wr) {
if (force_whitelist.includes(wr_hostname)) {
return;
}
- var cf_is = (known_cf_domains.includes(wr_hostname) || my_cf_collection.includes(wr_hostname)) ? true : false;
+ var cf_is = (my_cf_collection.includes(wr_hostname)) ? true : false;
if (!cf_is) {
var cf_headers = wr.responseHeaders,
cf_v_name, cf_v_value;
@@ -761,7 +749,7 @@ chrome.webRequest.onBeforeRequest.addListener(function (wr) {
if (force_whitelist.includes(wr_hostname)) {
return;
}
- var cf_is = (known_cf_domains.includes(wr_hostname) || my_cf_collection.includes(wr_hostname)) ? true : false;
+ var cf_is = (my_cf_collection.includes(wr_hostname)) ? true : false;
if (cf_is) {
console.log('BCMA: Block Cloudflare BR', wr_hostname);
if (my_action == 0 || my_action == 1) {
@@ -788,20 +776,12 @@ chrome.webRequest.onBeforeRequest.addListener(function (wr) {
chrome.runtime.onMessage.addListener(function (a, b, c) {
if (a[0] == 'cf') {
- c(['ok', JSON.stringify(my_cf_collection), JSON.stringify(my_cf_ignore), (known_cf_domains.length == 0) ? false : true, my_action]);
+ c(['ok', JSON.stringify(my_cf_collection), JSON.stringify(my_cf_ignore), my_action]);
}
if (a[0] == 'erosman') {
my_cf_collection = [];
c(['destroy']);
}
- if (a[0] == 'bi') {
- if (a[1] == 'y') {
- known_cf_domains = cfdomains;
- } else {
- known_cf_domains = [];
- }
- c(['ok']);
- }
if (a[0] == 'ta') {
if (a[1] == '0') {
my_action = 0;
diff --git a/addon_chrome/bcma/manifest.json b/addon_chrome/bcma/manifest.json
index ea4f02f1..13a3ac31 100644
--- a/addon_chrome/bcma/manifest.json
+++ b/addon_chrome/bcma/manifest.json
@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Block Cloudflare MITM Attack",
"description": "Submit to global surveillance or resist. The choice is yours.",
- "version": "1.0.1905.1",
+ "version": "1.0.1907.1",
"minimum_chrome_version": "60",
"author": "Project BCMA",
"homepage_url": "https://codeberg.org/crimeflare/cloudflare-tor",
diff --git a/addon_chrome/bcma/mydata.html b/addon_chrome/bcma/mydata.html
index b72fc48e..71900630 100644
--- a/addon_chrome/bcma/mydata.html
+++ b/addon_chrome/bcma/mydata.html
@@ -6,10 +6,6 @@
<body style="display:none">
Temporary configurations
<hr>
- <b>&#9758; Built-in Cloudflare list (.com only)</b> <small>(powered by <a href="https://searxes.danwin1210.me/" target="_blank">Searxes</a>)</small><br>
- <label><input type="radio" id="bi0" name="bi" value="0"> Use built-in list</label> <small>(Default)</small><br>
- <label><input type="radio" id="bi1" name="bi" value="1"> Don't use built-in list</label><br>
- <br>
<b>&#9822; Take Action</b><br>
<label><input type="radio" id="ta0" name="ta" value="0"> Block request immediately <small>(first-party + third-party)</small></label><br>
<label><input type="radio" id="ta1" name="ta" value="1"> Block request immediately <small>(third-party only / ignore first-party)</small></label><br>
@@ -17,7 +13,7 @@
<label><input type="radio" id="ta3" name="ta" value="3"> Notify only</label><br>
<br>
<b>&#9997; Your Cloudflare Domain collection</b> <small>(Last 500)</small><br>
- <small>(please share with <a href="https://codeberg.org/crimeflare/cloudflare-tor/" target="_blank">cloudflare-tor@notabug</a>)</small><br>
+ <small>(please share with <a href="https://codeberg.org/crimeflare/cloudflare-tor" target="_blank">cloudflare-tor@crimeflare</a>)</small><br>
<textarea cols="50" rows="12" id="t" wrap="off" spellcheck="false" placeholder="Cloudflare domains"></textarea>
<br>
<button type="button" id="exp">[ &#8659; Export ]</button>
diff --git a/addon_chrome/bcma/mydata.js b/addon_chrome/bcma/mydata.js
index 0d5a8aa6..b5538e87 100644
--- a/addon_chrome/bcma/mydata.js
+++ b/addon_chrome/bcma/mydata.js
@@ -3,14 +3,7 @@ document.addEventListener('DOMContentLoaded', function () {
if (r[0] == 'ok') {
document.getElementById('t').value = JSON.parse(r[1]).join("\n");
document.getElementById('g').value = JSON.parse(r[2]).join("\n");
- if (r[3]) {
- document.getElementById('bi0').checked = true;
- document.getElementById('bi1').checked = false;
- } else {
- document.getElementById('bi0').checked = false;
- document.getElementById('bi1').checked = true;
- }
- switch (r[4]) {
+ switch (r[3]) {
case 1:
document.getElementById('ta0').checked = false;
document.getElementById('ta1').checked = true;
@@ -53,16 +46,6 @@ document.getElementById('clr').addEventListener('click', function () {
document.getElementById('t').value = '';
});
});
-document.getElementById('bi0').addEventListener('click', function () {
- if (this.checked) {
- chrome.runtime.sendMessage(['bi', 'y']);
- }
-});
-document.getElementById('bi1').addEventListener('click', function () {
- if (this.checked) {
- chrome.runtime.sendMessage(['bi', 'n']);
- }
-});
document.getElementById('ta0').addEventListener('click', function () {
if (this.checked) {
chrome.runtime.sendMessage(['ta', '0']);