Remove CloudFlare links

Remove CloudFlare links from website | https://0xacab.org/dCF/deCloudflare/-/blob/master/tool/userscripts/README.md

La data de 14-12-2023. Vezi ultima versiune.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name Remove CloudFlare links
// @author Matthew L. Tanner
// @match https://*/*
// @version 1.0.0.0
// @grant none
// @run-at document-end
// @namespace deCloudflare_userscript_remove-cf
// @description Remove CloudFlare links from website | https://0xacab.org/dCF/deCloudflare/-/blob/master/tool/userscripts/README.md
// @license MIT
// ==/UserScript==
// To learn about this API, please go to http://about-karmaapi.go.crimeflare.eu.org
const api_url = 'https://karma.crimeflare.eu.org/api/is/cloudflare/';
let fqdns = {},
   fqdn_self = location.hostname;
document.querySelectorAll('a[href]:not([xcf])').forEach(l => {
   try {
      let u = new URL(l.href);
      if (u.hostname != fqdn_self && (u.protocol == 'https:' || u.protocol == 'http:')) {
         let fqdn = u.hostname;
         if (fqdns[fqdn] == undefined) {
            fqdns[fqdn] = [];
         }
         fqdns[fqdn].push(l);
         l.setAttribute('xcf', 'q');
      }
   } catch (x) {}
});
function mark_fqdn(fl) {
   try {
      if (fl == '') {
         return;
      }
      fetch(api_url, {
         method: 'POST',
         mode: 'cors',
         body: 'ff=' + fl,
         referrer: '',
         headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
         }
      }).then(x => x.json()).then(x => {
         for (let xx in x) {
            if (fqdns[xx]) {
               if (x[xx]) {
                  fqdns[xx].forEach(qs => {
                     qs.outerHTML = qs.innerHTML;
                  });
               } else {
                  fqdns[xx].forEach(qs => {
                     qs.setAttribute('xcf', 'n');
                  });
               }
               delete fqdns[xx];
            }
         }
      }).catch(x => {});
   } catch (x) {}
}
mark_fqdn(Object.keys(fqdns).join(','));