musicbrainz-userscripts icon indicating copy to clipboard operation
musicbrainz-userscripts copied to clipboard

Discogs import script broken after firefox/greasemonkey update

Open eharris opened this issue 4 years ago • 20 comments

Yesterday I rebooted and updated my firefox-esr on Debian Buster with the 78.7.0esr-1~deb10u1 version security update.

After restarting, I discovered that the discogs import script, even though it appears to still be installed and enabled, isn't showing anything on discogs pages where I would expect it.

Looking into it further, I also see that greasemonkey was updated to 4.11 yesterday, so I'm not sure if the problem was caused by firefox or greasemonkey.

I have downgraded firefox-esr back to version 78.5.0esr-1~deb10u1 (what's in stable without security fixes), and also downgraded greasemonkey back to 4.10, but the script still isn't working, so I'm at a loss as to the cause. Why it isn't working now after downgrading both is really strange, but maybe something was changed with the updates that didn't get reverted by downgrading?

Reporting here in case there is something that needs changing in the script to accommodate either the firefox-esr or greasemonkey updates. and for help in how to get it working again.

eharris avatar Jan 28 '21 17:01 eharris

Same issue with firefox/chrome and latest tampermonkey, so assume it is the discogs page that changed?

ggalan87 avatar Jan 29 '21 10:01 ggalan87

Works fine for me using Violentmonkey on Brave. Can you open the web console and check if there any error messages?

atj avatar Jan 29 '21 11:01 atj

Based on this thread it appears you need to login to Discogs for the script to work:

https://community.metabrainz.org/t/discogs-import-script-not-working/516221

atj avatar Jan 29 '21 13:01 atj

Based on this thread it appears you need to login to Discogs for the script to work: https://community.metabrainz.org/t/discogs-import-script-not-working/516221

I've never had to login before, and it has always worked, I've been using it a lot up until about 2 days ago when it broke.

If it really is the case that it doesn't work anymore without being logged in, seems like that should still be able to be fixed, since the data is still displayed without being logged in.

eharris avatar Jan 29 '21 20:01 eharris

I checked the web console in Firefox, doesn't show any errors.

eharris avatar Jan 29 '21 23:01 eharris

I'm unable to replicate this in Firefox 85 with Tampermonkey 4.11.6120 or Greasemonkey 4.11 on Linux, or in Brave with Violentmonkey. The import buttons appear whether I'm logged in or out.

The only thing I can suggest at this point is try clearing your Discogs cookies. You can do this by opening the Storage Inspector (shift+F9), expand "Cookies" on the left, then right click on "https://www.discogs.com" and click "Delete All" from the context menu:

image

atj avatar Feb 01 '21 10:02 atj

I've got my browser set to remove all cookies whenever I close it, so stale cookies isn't an issue. I've since tried the import script on Violentmonkey on the same browser, and it works there. So it seems to be a problem with Greasemonkey on Firefox.

eharris avatar Feb 03 '21 05:02 eharris

Glad you got it working. I'm afraid there's not much we can do unless it's reproducible.

@ggalan87 is it still not working for you? Can you try Violentmonkey if not?

atj avatar Feb 03 '21 14:02 atj

@atj I will check it later and will report back.

ggalan87 avatar Feb 03 '21 14:02 ggalan87

Based on this thread it appears you need to login to Discogs for the script to work:

https://community.metabrainz.org/t/discogs-import-script-not-working/516221

I was having the same problem with the script not working but as soon as I signed in, BINGO, working again. Thank you.

lexguy2007 avatar Feb 03 '21 23:02 lexguy2007

So @atj I made some tests and the following hold for both Tampermonkey (4.11.6120) and Violentmonkey (2.12.8) in Firefox 85

  • Without having logged in at least once, the buttons are not shown. After visiting the site 3 discogs cookies are created under "www.discogs.com" entry
  • After a login / logout cycle, the buttons show up. The difference is that 6 more cookies have been created for "www.discogs.com" (9 total) + other 6 for "accounts.discogs.com". I assume that they are the same 6 because even if you delete the "accounts." cookies, the buttons still show up. You don't have to login again and it still works.

ggalan87 avatar Feb 04 '21 10:02 ggalan87

Thanks @ggalan87 this is helpful. I can't see how the cookies themselves could be the cause - my guess would be that Discogs must be generating slightly different HTML based on the presence of these cookies. I'll try to replicate the issue.

atj avatar Feb 04 '21 17:02 atj

OK, I've finally been able to reproduce this. Discogs returns completely different markup if you're not logged in, which contains class names like:

<div class="side_3-xID" style="order:3">
  <section class="section_9nUx6 open_BZ6Zt">
    <header class="header_W2hzl">
      <div class="header_3eShg">
        <h3>Marketplace</h3>

The order:3 in the style attribute indicates that flex-box is being used for the sidebar layout. This means that even if we update the script to recognise the the weird class names the page will be messed up because the inserted MB element doesn't work with flex-box:

image

The only option I can see at the moment, that won't require making significant changes to the script, would be to add the buttons before the tracklist, like so:

image

However this doesn't fix the MB artist/label/release links, so some functionality of the script will still be lost. @murdos: any thoughts? Should we just require users to be logged in?

atj avatar Feb 04 '21 18:02 atj

Layout is totally different when logged in or not...

discogs_fmt

So it will take a lot of time to fix.

zas avatar Feb 10 '21 11:02 zas

I wonder if Discogs are redesigning / refactoring / modernizing their site and the redesign is currently only visible to logged out users? Has anyone tried reaching out to Discogs and asking them about it?

any thoughts? Should we just require users to be logged in?

I doubt that's a long-term solution; I'm sure if they're changing the site, the changes will eventually roll out to logged-in users too.

Daniel15 avatar Feb 10 '21 20:02 Daniel15

Should we just require users to be logged in?

Please add some kind of note on the non-logged-in version if possible; I've been thinking the script was broken for quite a while now. Logging in fixed it for me. Many people may be suffering from the same issue so some kind of tip to log in would be appreciated.

redactedscribe avatar Apr 03 '21 10:04 redactedscribe

I'm logged in and the script is clearly doing it's thing because all the little Musicbrainz icons show up on the page, but there is no "import to Musicbrainz" button like there used to be. Help!

I'm on Ubuntu 20.04 and it's the same in both Firefox and Chromium:

e.g. no_import_button

Normally the button appears on the right underneath that Marketplace section, but it's currently nowhere to be seen.

Doh! Ignore me. It's because I was looking at the Master Release instead of a specific release, actually working fine if I look at a specific release:

actually_working_fine

jdaviescoates avatar May 13 '21 08:05 jdaviescoates

This is an issue for me, even when logged in now.

djdembeck avatar Jun 30 '21 16:06 djdembeck

Can you please update the userscript and check whether version 2021.8.10.1 fixes your problem?

kellnerd avatar Aug 10 '21 16:08 kellnerd

I now see the import button without being logged into Discogs. Thanks!

redactedscribe avatar Aug 10 '21 17:08 redactedscribe