Arras.io Analytics Blocker

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Arras.io Analytics Blocker
// @namespace    https://
// @version      2024-12-13
// @description  Blocks requests to and from the Arras.io analytics server.
// @author       JavedPensions
// @match        *://arras.io/*
// @icon         https://arras.io/favicon/2048x2048.png
// @license      GNU GPLv3
// @grant        none
// ==/UserScript==

const oldFetch = window.fetch;

window.fetch = async function(...y2) {
    const url = typeof y2[0] === 'string' ? y2[0] : y2[0].url;

    if (url.includes('analytics')) {
        console.error('blocked fetch request to:', url);
        return Promise.reject(new Error('fetch request quit, is part of the category "analytics".'));
    }

    console.log('received fetch req:', {
        url: url,
        options: y2[1] || {}
    });

    const z3 = await oldFetch(...y2);
    const a4 = z3.clone();

    a4.text().then(b5 => {
        console.log('received fetch resp:', {
            url: z3.url,
            status: z3.status,
            statusText: z3.statusText,
            body: b5
        });
    }).catch(c6 => {
        console.error(c6);
    });

    return z3;
};