Vine Enhancer stopped working here
Closed this issue · 10 comments
Since yesterday, all of a sudden, the script completely stopped working here – it looks like it's not even loaded anymore (no controls, no filtering, the menu is no longer "pinned", …). Checking the console I however see it is loaded, as there is exactly 1 errors reported for it:
(funny thing is I neither updated the script nor GreaseMonkey here – unless something updated itself; to make sure: GreaseMonkey 4.12.0, last updated 2024-01-04; Amazon Vine Enhancer 0.7.8, last updated 2024-01-29. Next funny thing is the script only has 814 lines, but the error should be in line 837…)
I've tried the latest script from the repo here. Seems like the namespace was changed, so I then had 2 versions of the script running – but even disabling the "old one" to not collide did not change a thing (would settings be converted when switching?).
Also in the browser console I see a bunch of errors from the Vine website itself (mostly CORS and fonts, though), so most likely Amazon broke something, causing this problem? I cannot tell, as there are no more messages from this script giving hints.
For the GM_addStyle
error you could simply pull in https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
:
// @grant GM_addStyle
// @grant GM.addStyle
// @require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
PS: Fun. Applying my suggested changes for GM_addStyle
brings back the cogwheel for settings, and I can access settings again. Sticky header/footer are back as well, the sticky sidebar-menu seems not to be back (but that didn't work for all categories in the past either). Items are grayed-out properly again – so it seems the above fixes (almost?) this entire issue, wow! I like it when "major issues" disappear like that 🤣
No more error messages from the script itself in the console. The Amazon ones are still there, though – might be fewer, I didn't count.
So may I suggest adopting the suggested changes? Though if you don't care for GM3.x compatibility, replacing GM_
by GM.
would possibly do as well without the need to "drag in" the PolyFill script.
Hmm, odd. I guess there was some kind of GreaseMonkey/TamperMonkey update that broke stuff. Yes I did change my GitHub username at one point and went around my repos changing stuff like the namespace here, I forgot that might have caused issues like this! Glad you figured it out though.
Honestly, this is not a script I personally use any more since much better once have come out since I wrote this. I use and recommend either VineHelper or UltraViner as they are both much more fully featured and more work is done to keep them updated: https://vine-wiki.com/en/extension/vine-helper/about/vh-vs-uv
But I can for sure make the changes you are suggesting, I just want to make sure I understand them. So you are saying I either need need to add that polyfill script OR change every GM_addStyle
to GM.addStyle
?
I use and recommend either VineHelper or UltraViner
Thanks a lot! Will take a look at those. I'm always open to such suggestions. While your script already helped me a lot, my wish-list indeed is a little longer. Not everything can be covered by UserScripts (like Amazon seeming unwilling to implement a search function there, or other filters one can apply in their shop; for example, if I don't have a Tesla I'm not interested in car products by that brand). So much appreciated!
I just want to make sure I understand them.
I'm fully with you there! Matches my approach.
So you are saying I either need need to add that polyfill script OR change every
GM_addStyle
toGM.addStyle
?
I wonder that GM_addStyle
was working at all. That's the "old API" and was dropped with GreaseMonkey 4. So what that PolyFill does is basically: if the function GM_addStyle
does not exist, establish it as a wrapper to GM.addStyle
. So yes, it's either-or. If you switch to GM.addStyle
(don't forget to adjust the Grant
then), you're basically dropping support for GreaseMonkey < 4 (not sure if that's in use at all – but the possibility exists, e.g. with Firefox-57 forks still sticking to the "old API" – but on those this script doesn't work anyway I guess, at least failed for me back then when I tried it on Waterfox Classic, which is one of those forks. Currently have a black-out for the other names; was it Basilisk? PaleMoon is a probably better known example).
So using PolyFill gives you wider compatibility at the cost of pulling in 1 dependency (you can look at its source to help your decision). As the PoliFill script would be only pulled on-install (and then stored with the main UserScript), I've used that with my own UserScripts where needed.
TL;DR: just adding those 3 lines mentioned at the end of my original post fixed the script for me.
Feel free to close this issue then at your convenience – and thanks for your answer!
Thanks for the explanations. With that I decided just to add the lines instead of updating everything, might as well go for more compatibility
Added here: 5d9203d
And my thanks again for recommending that addon! Goes well together with your script, mostly. While I no longer see "grayed out items" from yours, at least navigation is kept in place by it (which I couldn't figure with that addon alone).
Speaking of navigation: categories are only kept in place as long as there are no more than 11 sub-categories I figured. Thought to let you know 😉 – ah, that's why – OK, makes sense. Indeed, with more than 11 sub-categories, the full list no longer fits on screen and thus some categories would become "unreachable", yeah… 🤷 Can't have it all I guess.
Yep, don't want to pin something to the screen that's taller than your screen or else you'd never be able to use it!
One could "simply" select another category – but then: which one? Would you remember how many subs which category has? I don't 🙈 Guess there's no "perfect solution" to that…
In hind-sight it's obvious. But it took me a couple of months to realize why "sticky mode" didn't work for some categories.
Btw, to make it better work with that addon you recommended me:
//Fade/Dim tiles
`.VINE-UIE-dimmed-tile {
opacity: .25 !important;
transition: opacity 300ms;
}
The !important
made the "dimmed" status stick, which otherwise was overridden by the addon. This way I can dim terms that might lead to "false positives" with your script, while permanently remove "safe hits" with the addon 😃
Can you make a PR for this or open a new issue?
Gladly! PR on its way…