This commit is contained in:
Xmader 2020-11-26 14:24:50 -05:00
parent 4acff224a8
commit 6e48ef1253
No known key found for this signature in database
GPG key ID: A20B97FB9EB730E4
3 changed files with 11 additions and 7 deletions

14
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.17.1
// @version 0.17.2
// @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/*/*
@ -79,14 +79,18 @@
if (typeof document === 'undefined')
return {};
return new Promise((resolve) => {
window.onmouseover = () => {
const iframe = document.createElement('iframe');
const targetEl = document.documentElement;
const eventName = 'onmousemove';
const id = Math.random().toString();
targetEl[id] = (iframe) => {
delete targetEl[id];
targetEl.removeAttribute(eventName);
iframe.style.display = 'none';
document.body.append(iframe);
targetEl.append(iframe);
const w = iframe.contentWindow;
window.onmouseover = null;
resolve(w);
};
targetEl.setAttribute(eventName, `this['${id}'](document.createElement('iframe'))`);
});
});
const getUnsafeWindow = () => {

2
package-lock.json generated
View file

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

View file

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