This commit is contained in:
Xmader 2020-02-27 12:14:29 -05:00
parent 0baf661c13
commit f44be6b3df
2 changed files with 5 additions and 5 deletions

8
dist/main.js vendored
View file

@ -3,7 +3,7 @@
// @namespace https://www.xmader.com/ // @namespace https://www.xmader.com/
// @homepageURL https://github.com/Xmader/musescore-downloader/ // @homepageURL https://github.com/Xmader/musescore-downloader/
// @supportURL https://github.com/Xmader/musescore-downloader/issues // @supportURL https://github.com/Xmader/musescore-downloader/issues
// @version 0.5.1 // @version 0.5.2
// @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro免费下载 musescore.com 上的曲谱 // @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro免费下载 musescore.com 上的曲谱
// @author Xmader // @author Xmader
// @match https://musescore.com/*/* // @match https://musescore.com/*/*
@ -28829,7 +28829,7 @@ Please pipe the document into a Node stream.\
if (pdfBlob) { if (pdfBlob) {
return saveAs(pdfBlob, `${name}.pdf`); return saveAs(pdfBlob, `${name}.pdf`);
} }
const cachedImg = document.querySelector("img[id^=score_]"); const cachedImg = document.querySelector("img[src*=score_]");
const { naturalWidth: width, naturalHeight: height } = cachedImg; const { naturalWidth: width, naturalHeight: height } = cachedImg;
const worker = new PDFWorkerHelper(); const worker = new PDFWorkerHelper();
const pdfArrayBuffer = yield worker.generatePDF(imgURLs, imgType, width, height); const pdfArrayBuffer = yield worker.generatePDF(imgURLs, imgType, width, height);
@ -28842,12 +28842,12 @@ Please pipe the document into a Node stream.\
return scorePlayerData.json.metadata.pages; return scorePlayerData.json.metadata.pages;
} }
catch (_) { catch (_) {
return document.querySelectorAll("img[id^=score_]").length; return document.querySelectorAll("img[src*=score_]").length;
} }
}; };
const getImgType = () => { const getImgType = () => {
try { try {
const imgE = document.querySelector("img[id^=score_]"); const imgE = document.querySelector("img[src*=score_]");
const { pathname } = new URL(imgE.src); const { pathname } = new URL(imgE.src);
const imgtype = pathname.match(/\.(\w+)$/)[1]; const imgtype = pathname.match(/\.(\w+)$/)[1];
return imgtype; return imgtype;

View file

@ -1,6 +1,6 @@
{ {
"name": "musescore-downloader", "name": "musescore-downloader",
"version": "0.5.1", "version": "0.5.2",
"description": "download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro免费下载 musescore.com 上的曲谱", "description": "download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro免费下载 musescore.com 上的曲谱",
"main": "dist/main.js", "main": "dist/main.js",
"repository": { "repository": {