dufferzafar / Userscripts

A collection of scripts that make spending time on the web easy.
GNU General Public License v3.0
63 stars 27 forks source link

iTunes import broken after redesign #8

Open liftarn opened 7 years ago

liftarn commented 7 years ago

It appears the redesign broke the script.

dufferzafar commented 7 years ago

@liftarn @augustjanse I've updated the script and it now works for me. Please try and let me know!

ewauq commented 7 years ago

I can't see the importation button on any pages after the new design. https://itunes.apple.com/fr/album/witness/id1236471560 image

liftarn commented 7 years ago

Sorry, but I don't see the import button either.

dufferzafar commented 7 years ago

OK. This is weird since it works for me :confused:

https://itunes.apple.com/fr/album/witness/id1236471560 image

https://itunes.apple.com/us/album/best-of-kailash-kher/id420713987 image

dufferzafar commented 7 years ago

How can we debug this now?

ewauq commented 7 years ago

Just deleted the userscript and re-installed it, same problem for me. This is the only Userscript I activated. image

dufferzafar commented 7 years ago

Hi, considering that the "Link to HD Artwork" is working, I've moved the "Add to MusicBrainz" button to the left now. And have updated the script accordingly. See if this works.

image

liftarn commented 7 years ago

Odd. I first saw the Link to HD Artwork button, but then it vanished. It may be an idea to bump the version as well.

dufferzafar commented 7 years ago

@liftarn When that happens, did you try and reload the page? It happened for me too once but I reloaded and it worked!

V-Toll commented 7 years ago

Hmm, it's not working for me either, even after the latest update. The link to HD artwork works (links only to the 939px version and not 1200px) but the import button is just not there (like liftarn and ewauq). I'm using Tampermonkey and Google Chrome 60.0.3112.24 an macOS 10.12.5.

Bacardi89 commented 7 years ago

hey it don't work me.

liftarn commented 7 years ago

@dufferzafar Nope, just the artwork link first showing and then disappearing. Running Greasemonkey 3.11 on Firefox.

liftarn commented 7 years ago

I still haven't managed to get it to work using Firefox 54.0 and GreaseMonkey 3.11. I have tried to reinstall both the script and GreaseMonkey with no luck.

augustjanse commented 7 years ago

Did you check your console (Ctrl+Shift+K)? My update should have fixed the error visible in @ewauq's screenshot, if your console shows a different one that would be helpful. Also try refreshing the release page, seems like it can be a little slow in showing up.

liftarn commented 7 years ago

Noting really suspicious in the console: Cross-Origin begäran blockerad: Same-Origin policyn tillåter inte läsningar av fjärresurs på https://www.apple.com/ac/globalfooter/3/en_US/assets/ac-footer/legacy/appleicons_text.woff. (Orsak: CORS header 'Access-Control-Allow-Origin' saknas). (okänt) downloadable font: download failed (font-family: "Apple Legacy Chevron" style:normal weight:normal stretch:normal src index:1): bad URI or cross-site access not allowed source: https://www.apple.com/ac/globalfooter/3/en_US/assets/ac-footer/legacy/appleicons_text.woff ac-globalfooter.built.css:1:1040 Metrics config: No config provided via delegate or fetched via init(), using default/cached config values. vendor-5f048e2ad0248e8169016946294565f8.js:28:11988 Cross-Origin begäran blockerad: Same-Origin policyn tillåter inte läsningar av fjärresurs på https://www.apple.com/ac/globalfooter/3/en_US/assets/ac-footer/legacy/appleicons_text.ttf. (Orsak: CORS header 'Access-Control-Allow-Origin' saknas). (okänt) downloadable font: download failed (font-family: "Apple Legacy Chevron" style:normal weight:normal stretch:normal src index:2): bad URI or cross-site access not allowed source: https://www.apple.com/ac/globalfooter/3/en_US/assets/ac-footer/legacy/appleicons_text.ttf ac-globalfooter.built.css:1:1040 GET https://web-experience.itunes.apple.com/assets/controls/play@2x-b967ac20db4935540017bdc1ddbed546.svg [HTTP/1.1 200 OK 0ms] OPTIONS XHR https://xp.apple.com/report/2/xp_its_preview [HTTP/1.1 200 OK 522ms] POST XHR https://xp.apple.com/report/2/xp_its_preview [HTTP/1.1 200 OK 138ms]

liftarn commented 7 years ago

When refreshing I sometimes get a "Link to HD artwork" that then disappear.

augustjanse commented 7 years ago

Replication succeeded! Windows 10, newly installed Firefox 54.0 64-bit and Greasemonkey 3.11 for the record, but the browser is probably the critical part. I'll take a look.

liftarn commented 7 years ago

Tested with your fix and it seem to solve the problem.

libussa commented 7 years ago

This is still broken for me. Link to HD artwork and import button appear briefly below the artwork, then disappears. Firefox 55, Linux

dufferzafar commented 7 years ago

@libussa Link to itunes page where you're experiencing the problem?

A screenshot?

libussa commented 7 years ago

@dufferzafar everything I tried is problematic. A couple of examples: https://itunes.apple.com/us/album/good-will-continue-remixes/id1266082650 https://itunes.apple.com/fr/album/bubbling/id1205433832

screenshot: https://i.imgur.com/eZKvKkr.png

liftarn commented 7 years ago

Yes, it appears and then disappears. Using Firefox 54.0.1 and Greasemonkey 3.11

dufferzafar commented 7 years ago

Are you sure you guys are using the right version? (current master tip)

Because it stays visible for me. I'm on KDE Neon using FF 55.0.2 and the dotjs addon.

liftarn commented 7 years ago

Yes, reinstalled from https://github.com/dufferzafar/Userscripts/blob/master/MB-Import-From-iTunes.user.js today and tested.

Bacardi89 commented 7 years ago

Same don't work

Obtenez Outlook pour iOShttps://aka.ms/o0ukef


From: liftarn notifications@github.com Sent: Tuesday, August 22, 2017 11:27:12 AM To: dufferzafar/Userscripts Cc: Bacardi89; Comment Subject: Re: [dufferzafar/Userscripts] iTunes import broken after redesign (#8)

Yes, reinstalled from https://github.com/dufferzafar/Userscripts/blob/master/MB-Import-From-iTunes.user.js today and tested.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/dufferzafar/Userscripts/issues/8#issuecomment-323971418, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Ab_30E5lW37qNjyiTPPGYdKMqTQOeU_8ks5sap7wgaJpZM4Nz7ss.

otringal commented 7 years ago

I had the same problem but found a solution that works for me, but sometimes you have to reload the itunes page before it starts to work. I think the problem is that the script runs before the page has finished loading. Add this at the top of the script if you use Greasemonkey: //@run-at document-idle

AzoresOne commented 7 years ago

@otringal

Add this at the top of the script if you use Greasemonkey: //@run-at document-idle

I get this warning: Scam Warning: Take care when pasting things you don't understand. This could allow attackers to steal your identity or take control of your computer. Please type 'allow pasting' in the scratchpad below to allow pasting.

Now what?

AzoresOne commented 7 years ago

Update: I went ahead and typed instead of pasting and whattya know, it now works properly! Thanks 👍

V-Toll commented 7 years ago

Strange. Same problem here, even with //@run-at document-idle

Here is an example: the US iTunes site doesn't work: https://itunes.apple.com/us/album/raining-single/id1272276768

01

The German one works fine for me: https://itunes.apple.com/de/album/raining-single/id1272276768

2

(using Tampermonkey on Google Chrome)

liftarn commented 7 years ago

Even with //@run-at document-idle it don't always appears so I often have to reload the page to make it appear, but it's still a vast improvement over how it was before.

augustjanse commented 7 years ago

I haven't had this problem recently, but started encountering it today. These two were the problem at first:

But now that I test other albums, they all seem to be having problems, including ones I had no problem with just now. No idea what's the problem. Don't really have any time to debug it either, sorry.

Tried @Mirgolth's fix, but it didn't do much. It seems reasonable, but on the other hand the script already waits for a state change so I'm not sure it does much.

augustjanse commented 7 years ago

I found while debugging that pausing the execution of the userscript (for example by setting debugging mode in Tampermonkey/Greasemonkey and opening the console before updating the page) consistently makes the button appear as it should after resuming. It seems clear that the problem is when it executes before the iTunes scripts do. Not sure how to fix it, but this is a pretty useful workaround.

jesus2099 commented 7 years ago

Hello, I also have a broken iTunes script I don’t really intend to work on any more.

But just to say I have noticed that iTunes JavaScript is running routinely to red raw redraw the page (I see an ugly font jump, few seconds after each page load in opera presto).

So I have put a delay before my script runs and it worked but it is not good solution. https://github.com/jesus2099/konami-command/issues/353#issuecomment-326946527

5moufl commented 6 years ago

works again on Firefox 58 with ViolentMonkey

gauravjuvekar commented 6 years ago

Disabling security.csp.enabled in FF ESR 52.7.3 allows it to work correctly.

jesus2099 commented 5 years ago

@dufferzafar, you could try to add a setInterval(function() { … }, 5000); that keeps checking if your buttons are still there, and if not, readds them.

jesus2099 commented 5 years ago

@Mirgolth’s fix #15 (// @run-at document-idle), which is a sensible improvement in running this script on iTunes’ new page design, has just been deployed!

ghost commented 5 years ago

I cannot see the "Add to MusicBrainz" button with Firefox 65.0.2 and GreaseMonkey 4.7 so I install ViolentMonkey 2.10.3 and it works !

jesus2099 commented 5 years ago

Does anyone still have this problem since version 2017.11.21.1 deployed on 2019-02-08? No problem here with Vivaldi (Chrome) + Violentmonkey (but I don’t often go to iTunes).

UPDATE

I have just had the issue right now. WHen you browse iTunes, it uses an AJAX stuff that does not really reload full pages and the script button will never appear.

@dufferzafar, for this kind of sites, the solution really is IMO to use setInterval to regularly check if the buttons are there or not. There are cleaner means but they are much more difficult to maintain as the web sites regularly changes its code — for this reason I progressively put all sites in such setInterval dumbMode in some other script.

jesus2099 commented 5 years ago

I forgot to mention the very easy work around: Press F5 to load page properly and to let the user script catch up.