挖地兔PDF

识别挖地兔report id ,在新窗口打开PDF

// ==UserScript==
// @name         挖地兔PDF
// @namespace
// @version      0.32
// @description  识别挖地兔report id ,在新窗口打开PDF
// @author       hunk
// @match        *://*.waditu.com/*
// @grant        none
// @license MIT

// @namespace 
// ==/UserScript==

sniffWaditu();
function sniffWaditu() {

    const { fetch: originalFetch } = window;
    window.fetch = async (...args) => {
        let [resource, config] = args;
        if(args[0]){
            console.log(args[0]);
            location.href=args[0];
        }

        let response = await originalFetch(resource, config);
        return response;
    };
}