musescore-downloader icon indicating copy to clipboard operation
musescore-downloader copied to clipboard

it says "Disable Tampermonkey to access the website"

Open fadfdsaadfd opened this issue 4 years ago • 4 comments

I hate musescore..

fadfdsaadfd avatar Dec 02 '20 15:12 fadfdsaadfd

There is an alternative method, see CLI Usage

Xmader avatar Dec 02 '20 21:12 Xmader

I had the same problem as you but I played around with Tampermonkey Beta and figured out a simple solution to make it work. Disable Tampermonkey before accessing the page with the sheet music you want, then enable Tampermonkey and CLICK REFRESH. Download your file then disable Tampermonkey and CLICK REFRESH before leaving page to get another sheet, repeat the same steps for each file. Works for me so far.... good luck.

Jockeystrap avatar Dec 04 '20 04:12 Jockeystrap

CLI Usage (recommended, more bulletproof)

  1. Install Node.js LTS (https://nodejs.org/)
  2. Open a command line terminal or command prompt
  3. Type npx msdl, enter (npx msdl will always run the latest version) Follow the instructions

https://github.com/Xmader/musescore-downloader#cli-usage

sjkim04 avatar Dec 04 '20 10:12 sjkim04

Hi,

I'm unfamiliar with the project structure, however I've found a workaround for this.

Right at the start of the script in Tampermonkey, just after the comment-y bits at the start, I've added the following JS code:

var script = document.createElement("script");
script.textContent = `class _ErrorReplacement{
    constructor(){
        this.stack = "not tamper";
    }
}

Error = _ErrorReplacement;
`;

(document.head||document.documentElement).appendChild(script);

With this tweak I'm no longer seeing the Tampermonkey error. Sometimes the download buttons don't show, but clicking the Tampermonkey extension icon and then choosing Download MSCZ etc all still work.

Basically I noticed that MuseScore is raising a new error and then checking the stack to see if it contains "userscript.html", and if it does then the message gets shown. Here I'm overriding the default error with my own class and setting the stack to a string that is definitely not "userscript.html" to bypass this.

rugulous avatar Dec 08 '20 20:12 rugulous

This repo has been moved to https://github.com/LibreScore/dl-librescore

Xmader avatar Mar 01 '23 23:03 Xmader