保存下载 高教书苑 等 网站加密电子书的小工具

保存 高教书苑 等 网站加密电子书的小工具

// ==UserScript==
// @name        保存下载  高教书苑 等 网站加密电子书的小工具
// @namespace    http://tampermonkey.net/
// @version      1.1
// @match       *://ebook.hep.com.cn/*
// @description  保存  高教书苑 等 网站加密电子书的小工具
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    
    const originalCreateObjectURL = URL.createObjectURL;

    
    URL.createObjectURL = function(blob) {
        const objectURL = originalCreateObjectURL(blob);

      
        const timestamp = Date.now();
        const filename = `blob-content-${timestamp}.webp`;  //

        
        const link = document.createElement('a');
        link.href = objectURL;
        link.download = filename;
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);

        console.log(`Blob URL detected: ${objectURL}, file saved as ${filename}`);

        return objectURL;
    };})();