Xmader / musescore-downloader

⚠️ This repo has moved to https://github.com/LibreScore/dl-librescore ⚠️ | Download sheet music (MSCZ, PDF, MusicXML, MIDI, MP3, download individual parts as PDF) from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱

Home Page:https://github.com/LibreScore/dl-librescore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tampermonkey script no longer works specifically in Google Chrome (not all Chromium-based browser)

PeterNjeim opened this issue · comments

For some reason, when creating a new Image, const d = new Image();, the script fails at the next line document.body.prepend(d), saying that d is undefined. This is very strange, and I don't even know if it's possible to fix, without Google Chrome reverting something they did.

They've added the detection code again.

window.Image = function() {
            var stack = new Error().stack
            var stackChunks = stack.split('\n').slice(2);
            var lastLine = stackChunks.reverse()[0];
            var url = lastLine.split(' ').reverse()[0]
            var urlChunks = url.substr(1, url.length - 2).split(':')
            var resultUrl = urlChunks[0] + ':' + urlChunks[1]

            if (
                getIsUserScript(stack)
                || lastLine.split(' (eval').length >= 3
                || (lastLine.indexOf(' eval ') && resultUrl === location.href)                 || stackChunks.every(function (chunk) { return chunk.indexOf('a (https://c.amazon-adsystem.com/aax2/apstag.js:') > -1 })
            ) {
                disable()
                return null;
            }
            return new Img(arguments[0], arguments[1])
        }