murdos / musicbrainz-userscripts

Collection of userscripts for MusicBrainz, by various authors
537 stars 91 forks source link

Bandcamp scripts broken in Safari/Tampermonkey #369

Open CyberSkull opened 3 years ago

CyberSkull commented 3 years ago

For a long while now I haven’t been able to use the two Bandcamp scripts with Safari & Tampermonkey. None of the import buttons appear at all nor does the image download link.

I’ve tried reinstalling to no avail. I’ve tried with Tampermonkey in other browsers like Opera and Chrome and it works fine there.

DesertRec commented 2 years ago

Same here

CyberSkull commented 2 years ago

Seems to be working again in Safari 15.4 (15613.1.17.1.13, 15613) / Tampermonkey 4.13.6140. Still testing.

abyxcos commented 1 year ago

I found two issues here that prevent the bandcamp script from loading in Safari/Userscripts. Did not test TamperMonkey. #466 and #465 are probably also related. Hacking around these two issues locally caused the script to work.

1.) None of the @require lib/*.js are downloaded from github. If the 4x files are downloaded and placed in require/blah.js/lib%2Ffilename.js manually then they are included properly.

2.) if (!unsafeWindow) unsafeWindow = window; from line 24 fails as unsafeWindow cannot be found. Full error below.

[Error] ReferenceError: Can't find variable: unsafeWindow
    (anonymous function) (Import-Bandcamp-releases-to-MusicBrainz.js:812)
    (anonymous function) (Import-Bandcamp-releases-to-MusicBrainz.js:1206)
    Global Code (Import-Bandcamp-releases-to-MusicBrainz.js:1207)
    appendChild
    injectJS (content.js:274)
    processJS (content.js:219)
    (anonymous function) (content.js:402)