Picklet Deep Network Inspector

Logs ALL egg/coin traffic (real data only)

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Picklet Deep Network Inspector
// @namespace    http://tampermonkey.net/
// @version      4.0
// @description  Logs ALL egg/coin traffic (real data only)
// @match        *://picklet.party/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    console.log("🔍 Inspector ACTIVE");

    // FETCH HOOK
    const origFetch = window.fetch;
    window.fetch = async function(...args) {
        const [url, config] = args;

        console.group("🌐 FETCH:", url);

        if (config?.body) {
            try {
                console.log("📤 Request Body:", JSON.parse(config.body));
            } catch {
                console.log("📤 Raw Body:", config.body);
            }
        }

        const res = await origFetch.apply(this, args);

        res.clone().text().then(text => {
            try {
                console.log("📥 Response:", JSON.parse(text));
            } catch {
                console.log("📥 Raw Response:", text);
            }
            console.groupEnd();
        });

        return res;
    };

    // XHR HOOK
    const origOpen = XMLHttpRequest.prototype.open;
    const origSend = XMLHttpRequest.prototype.send;

    XMLHttpRequest.prototype.open = function(method, url) {
        this._url = url;
        return origOpen.apply(this, arguments);
    };

    XMLHttpRequest.prototype.send = function(body) {
        console.group("🌐 XHR:", this._url);

        if (body) {
            try {
                console.log("📤 Request Body:", JSON.parse(body));
            } catch {
                console.log("📤 Raw Body:", body);
            }
        }

        this.addEventListener("load", function() {
            try {
                console.log("📥 Response:", JSON.parse(this.responseText));
            } catch {
                console.log("📥 Raw Response:", this.responseText);
            }
            console.groupEnd();
        });

        return origSend.call(this, body);
    };

})();