v0.3.2 - PDF cache
This commit is contained in:
parent
eb6c13ce60
commit
f8060aaf07
3 changed files with 25 additions and 5 deletions
12
dist/main.js
vendored
12
dist/main.js
vendored
|
@ -3,7 +3,7 @@
|
|||
// @namespace https://www.xmader.com/
|
||||
// @homepageURL https://github.com/Xmader/musescore-downloader/
|
||||
// @supportURL https://github.com/Xmader/musescore-downloader/issues
|
||||
// @version 0.3.1
|
||||
// @version 0.3.2
|
||||
// @description 免登录、免 Musescore Pro,下载 musescore.com 上的曲谱
|
||||
// @author Xmader
|
||||
// @match https://musescore.com/*/*
|
||||
|
@ -25973,7 +25973,11 @@ Please pipe the document into a Node stream.\
|
|||
mixin(ImagesMixin);
|
||||
mixin(OutputDocumentBrowser);
|
||||
|
||||
let pdfBlob;
|
||||
const generatePDF = (name) => {
|
||||
if (pdfBlob) {
|
||||
return FileSaver(pdfBlob, `${name}.pdf`);
|
||||
}
|
||||
const scoreImgs = document.querySelectorAll("img[id^=score_]");
|
||||
const { naturalWidth: width, naturalHeight: height } = scoreImgs[0];
|
||||
const canvas = document.createElement("canvas");
|
||||
|
@ -26002,8 +26006,12 @@ Please pipe the document into a Node stream.\
|
|||
height,
|
||||
});
|
||||
});
|
||||
// TODO: webworker
|
||||
// @ts-ignore
|
||||
return pdf.download(`${name}.pdf`);
|
||||
return pdf.getBlob().then((blob) => {
|
||||
pdfBlob = blob;
|
||||
FileSaver(blob, `${name}.pdf`);
|
||||
});
|
||||
};
|
||||
const getTitle = (scorePlayerData) => {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue