Greasy Fork is available in English.

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

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

  1. // ==UserScript==
  2. // @name 保存下载 高教书苑 等 网站加密电子书的小工具
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @match *://ebook.hep.com.cn/*
  6. // @description 保存 高教书苑 等 网站加密电子书的小工具
  7. // @grant none
  8. // @license MIT
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. const originalCreateObjectURL = URL.createObjectURL;
  13.  
  14. URL.createObjectURL = function(blob) {
  15. const objectURL = originalCreateObjectURL(blob);
  16.  
  17. const timestamp = Date.now();
  18. const filename = `blob-content-${timestamp}.webp`; //
  19.  
  20. const link = document.createElement('a');
  21. link.href = objectURL;
  22. link.download = filename;
  23. document.body.appendChild(link);
  24. link.click();
  25. document.body.removeChild(link);
  26.  
  27. console.log(`Blob URL detected: ${objectURL}, file saved as ${filename}`);
  28.  
  29. return objectURL;
  30. };})();