soscripted / sox

Stack Overflow Extras: a userscript for the Stack Exchange websites to add a bunch of optional toggle-able features
http://stackapps.com/q/6091/
MIT License
72 stars 15 forks source link

Firefox greasemonkey 4 is backwards incompatible #306

Closed shu8 closed 6 years ago

shu8 commented 6 years ago

Greasemonkey 4 is incompatible with previous versions due to changes made in Firefox v57.

https://www.greasespot.net/2017/09/greasemonkey-4-announcement.html

The changes shown in https://www.greasespot.net/2017/09/greasemonkey-4-for-script-authors.html need to be implemented to make it compatible with the new versions of Firefox and still Chrome

shu8 commented 6 years ago

A temporary solution is to use Violetmonkey for Firefox. it seems to work fine on there.

ooker777 commented 6 years ago

I don't upgrade my FF to v57. Is it worth to use former version of Greasemonkey rather than Violentmonkey? Or can they be easily imported? And why they are so different?

shu8 commented 6 years ago

@ooker777 AFAIK Violetmonkey is completely compatible with the 'old' greasemonkey scripts, so just installing it with violetmonkey should work. I'm not entirely sure why violetmonkey works but GM doesn't unfortunately :( it seems like a decision they made when updating it for the new FF?

shu8 commented 6 years ago

It seems Tampermonkey works perfectly fine on Firefox, and doesn't seem to have the same sandboxing either.

We're going to endeavour to support Tampermonkey going from now on, as it will be much easier for us to develop and test. Please do install Tampermonkey!

ooker777 commented 6 years ago

I'm using it now, but occasionally the script just stops. A restart would be required (not really sure about this though).

shu8 commented 6 years ago

@ooker777 does anything appear in the console when it stops? Can you try 'enable debugging' from the dialog and paste the console contents here?

IzzySoft commented 2 years ago

Is there any chance that compatibility can be established with GM4+ – or has that addon been declared dead now (seems like the last commit to its source tree was in 1/2021, so almost a year ago)? Now that SO dropped compatibility for a lot of browsers last night, I'm forced off my main browser (Waterfox Classic) for SE stuff – and in G3 I've got GM 4.11. I'd rather avoid reconfiguring everything again (as that would also mean sttings etc. of other scripts being lost).

shu8 commented 2 years ago

@IzzySoft sorry for the delay! GM4 broke a lot of functionality and we decided we would no longer officially support it due to our time constraints unfortunately. Are you able to use Tampermonkey instead? SOX and most other userscripts should work out-of-the-box with TM.

Pull requests by anyone to support GM4 are more than welcome though!

IzzySoft commented 2 years ago

I can confirm it also broke many of my scripts. I somehow managed to fix those I still maintain (mostly by injecting a compatibility layer). But I understand this might be too much effort and not worth it, considered that development of GM4 seems to have stopped.

However, switching to a different userscript manager would mean porting all currently active scripts and their settings over. And the settings part can be quite tricky. Do you know if it's possible, without too many side effects, to temporarily run both (GM4 and Tampermonkey) in parallel – so the settings of scripts that have no export/import feature can be copy-pasted?

shu8 commented 2 years ago

@IzzySoft I'm not sure of the best way to do that, I think it would depend on how the scripts you use save their settings. Is it using GM_setValue etc. or something else?

I found How to Transfer All Greasemonkey userscripts to Tampermonkey on Firefox 57+ which might help copying the scripts themselves to TM.

If they are using GM storage for the settings, you could to add a console.log(GM_listValues(...)) line at the top of the GM scripts that don't have export/import functionality (https://wiki.greasespot.net/GM.listValues), and then use GM_setValue in the imported TM scripts by copy/pasting the logged settings. Depending on how many userscripts you have/how many have settings, this might be the best way!

There might also be better ways but unfortunately I'm not aware of them!

IzzySoft commented 2 years ago

My own scripts use GM_setValue, but I haven't checked what the 3rd party scripts use. Thanks for the pointer to the how-to, will definitely check that as soon as time permits.

As for console.log – that would mean I'd know at least the variables to check. For more complex scripts, that would be more work than just copy-pasting from the resp. settings pages.

Not sure when I'll find time for that. I'll mark the notification I received for your comment, and report back when I was able to get my hands on this. Thanks a lot!

shu8 commented 2 years ago

@IzzySoft the listValues function should just dump all the variables so you can then save them all back in TM!

I hope it works for you when you do get time! :)