Created
January 25, 2022 14:08
-
-
Save qinlili23333/32b393069c1aad1e4e491683832e78f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Botu Predator | |
// @namespace https://qinlili.bid | |
// @version 0.1 | |
// @description 截取博图加密PDF | |
// @author You | |
// @match *://www.cnbooksearch.com/CheckIpForRead.aspx?* | |
// @match *://*/*/CheckIpForRead.aspx?* | |
// @grant none | |
// @run-at document-body | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var loadUrl= new Function(document.body.getAttribute("onload").replace("javascript:","").replace("OpenURL","OpenUrlHook")); | |
document.body.onload=""; | |
document.body.setAttribute("onload",""); | |
console.log("catch onload event!") | |
window.OpenUrlHook=function(nouse0,pdfurl,nouse1,nouse2){ | |
console.log("Got PDF URL:"+pdfurl); | |
fetch(pdfurl).then(res => res.blob().then(blob => { | |
var bloburl = URL.createObjectURL(blob); | |
var a = document.createElement('a'); | |
var filename = "[尚未解密]"+document.title+".pdf"; | |
a.href = bloburl; | |
a.download = filename; | |
a.click(); | |
window.URL.revokeObjectURL(bloburl); | |
})) | |
} | |
loadUrl(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment