Arras.io Analytics Blocker

Blocks requests to and from the Arras.io analytics server.

  1. // ==UserScript==
  2. // @name Arras.io Analytics Blocker
  3. // @namespace https://
  4. // @version 2024-12-13
  5. // @description Blocks requests to and from the Arras.io analytics server.
  6. // @author JavedPensions
  7. // @match *://arras.io/*
  8. // @icon https://arras.io/favicon/2048x2048.png
  9. // @license GNU GPLv3
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. const oldFetch = window.fetch;
  14.  
  15. window.fetch = async function(...y2) {
  16. const url = typeof y2[0] === 'string' ? y2[0] : y2[0].url;
  17.  
  18. if (url.includes('analytics')) {
  19. console.error('blocked fetch request to:', url);
  20. return Promise.reject(new Error('fetch request quit, is part of the category "analytics".'));
  21. }
  22.  
  23. console.log('received fetch req:', {
  24. url: url,
  25. options: y2[1] || {}
  26. });
  27.  
  28. const z3 = await oldFetch(...y2);
  29. const a4 = z3.clone();
  30.  
  31. a4.text().then(b5 => {
  32. console.log('received fetch resp:', {
  33. url: z3.url,
  34. status: z3.status,
  35. statusText: z3.statusText,
  36. body: b5
  37. });
  38. }).catch(c6 => {
  39. console.error(c6);
  40. });
  41.  
  42. return z3;
  43. };