musescore-downloader

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 142324c7679ef03db8e9062d73984b3357528208
parent 0c3dccb1f38a98d74ae8c1fc2dd3ae39c5f330c0
Author: Xmader <xmader@outlook.com>
Date:   Sun,  1 Dec 2019 04:41:42 -0500

v0.3.4 - add cleanup

Diffstat:
Mdist/main.js | 7+++++--
Mpackage.json | 2+-
Msrc/main.ts | 7++++++-
3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/dist/main.js b/dist/main.js @@ -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.3 +// @version 0.3.4 // @description 免登录、免 Musescore Pro,下载 musescore.com 上的曲谱 // @author Xmader // @match https://musescore.com/*/* @@ -26016,7 +26016,10 @@ Please pipe the document into a Node stream.\ document.body.appendChild(canvas); canvasContext.clearRect(0, 0, width, height); canvasContext.drawImage(imageElement, 0, 0); - return canvas.toDataURL("image/png"); + const data = canvas.toDataURL("image/png"); + canvas.remove(); + imageElement.remove(); + return data; }); const generatePDF = (svgURLs, name) => __awaiter(void 0, void 0, void 0, function* () { if (pdfBlob) { diff --git a/package.json b/package.json @@ -1,6 +1,6 @@ { "name": "musescore-downloader", - "version": "0.3.3", + "version": "0.3.4", "description": "download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱", "main": "dist/main.js", "repository": { diff --git a/src/main.ts b/src/main.ts @@ -34,7 +34,12 @@ const svgToPng = async (svgURL: string) => { canvasContext.clearRect(0, 0, width, height) canvasContext.drawImage(imageElement, 0, 0) - return canvas.toDataURL("image/png") + const data = canvas.toDataURL("image/png") + + canvas.remove() + imageElement.remove() + + return data } const generatePDF = async (svgURLs: string[], name?: string) => {