This commit is contained in:
Xmader 2020-11-19 18:54:49 -05:00
parent 4eade0ad46
commit 63892a495a
No known key found for this signature in database
GPG key ID: A20B97FB9EB730E4
3 changed files with 9 additions and 5 deletions

10
dist/main.js vendored
View file

@ -5,7 +5,7 @@
// @supportURL https://github.com/Xmader/musescore-downloader/issues
// @updateURL https://msdl.librescore.org/install.user.js
// @downloadURL https://msdl.librescore.org/install.user.js
// @version 0.15.11
// @version 0.15.12
// @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro免费下载 musescore.com 上的曲谱
// @author Xmader
// @match https://musescore.com/*/*
@ -26818,10 +26818,14 @@ Please pipe the document into a Node stream.\
const getBtnContainer = () => {
const container = document.querySelectorAll('aside>section>section')[0];
return [...container.children].find((div) => {
const btnParent = [...container.children].find((div) => {
const b = div.querySelector('button, .button');
return b && b.outerHTML.replace(/\s/g, '').includes('Download');
const text = b ? b.outerHTML.replace(/\s/g, '') : '';
return text.includes('Download') || text.includes('Print');
});
if (!btnParent)
throw new Error('btn parent not found');
return btnParent;
};
const buildDownloadBtn = () => {
const btn = document.createElement('button');

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "musescore-downloader",
"version": "0.15.11",
"version": "0.15.12",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

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