New Firefox, new Greasemonkey, broken Userscripts.
|3 min read
Recommended Journals
Varyon genos! + Uploads
:new: All genos can now be exchanged for one Purity trial image each! Likewise for rite images for another arpg as well. This is where I'll pop all of the genos or imports I have up for grabs! - USD payments are to be paid via invoice right away. - Maximum hold of 1 month for art payments, if payment is not completed in that time the geno will be put back up for sale. And all progress will be kept. - There MUST be progress within the first 2 weeks for art payments or the hold will be removed. - I can refuse a sale for any reason. Accepted payments: - USD - Points - Quests/CP/PTs/Training/ICQ/Etc - Trades Ping: Xe-Li (https://www.deviantart.com/xe-li) - Female To
About Our Sona Characters!
while our sonas are not a perfect 1 to 1 of who we are, they are absolutely an extension of us! here's a little more info about them for those who were curious! Bun species: lop eared bunny age: early 20's pronouns: she/her sexuality: pansexual likes: GIRLS, plants, stuffed animals, coffee, sweets, sleeping, rain, knives??? animal crossing, harvest moon, AESTHETICS dislikes: anxiety, crowded places, scary weather, loud noises, planes, tall buildings, the dark, most social situations, RUDE PEOPLE, peas ew favorite color: MINT! & greens occupation: works in a tiny flower shop hobbies: likes to knit, tend to her garden, and ba
Rant about the lupisvulpes community
Disclaimer Nothing here is to cause drama or directed at anyone specific, i want people to be AWARE of their actions and how shitty people treat each other in this community. This isn't against Lupis herself i respect her as an artist and she hasn't done anything bad to hurt people etc. This isnt hate on lup, this is more of a rant of her community. THIS IS MY EXPERIENCE WITHIN THIS COMMUNITY. Please note: this isnt gonna be fancy shit, im bad with grammar and writing im like 2 yrs old By far this has been one of the worst communities i have ever came across, all the people in this community are so hateful and greedy and with absolutely back
Dediggefedde's avatar
By Dediggefedde   |   Watch
3 8 922 (1 Today)
Published: November 18, 2017

Firefox quantum is out and it feels great!


Many things became faster and the new UI is... not completely bad. I like how describing text is returning.

One thing that changed is what extensions can do and that they focus more on running asynchronous.
This means that the new Firefox requires new extension versions for various extensions. This also includes Greasemonkey.

And Greasemonkey decided to drop backwards-compatibility by default.
That's why almost all of my scripts stopped working in the new Firefox.

There is a backwards-compatibility solution, but I have to add it by hand.
This is also not just a header thing, but something you need to go through your script and rewrite parts that are affected.

I'm currently going through my scripts and update them.
It might take a while, though, since some are rather large and there are around 30 scripts in total...
So, please bear with me while I'm working on this.



Technical details:


In userscript GM-API-Calls all _ are replaced with .:
GM_getValue becomes GM.getValue.
Also GM.xmlHttpRequest has now a large H... before lower ones were ignored I guess.
GM.getValue doesn't return a value anymore, but a "promise" and runs asynchronous.
It HAS TO run in an asynchronous function, otherwise you get a cryptic console-error-message that a script failed to run.
Asynchronous functions have the async-prefix.
To let GM.getValue run synchronous and return its value, you need a prefix await.

So
var name=GM_getValue("myName");
becomes
(async function(){
 var name=await GM.getValue("myName");
)();


Be careful with asynchronouse functions! The browser does not guarantee that the async function is executed before the next statement. In fact on most devices it is executed in parallel:
var i=0
(async function(){
 i=await GM.getValue("di"); //di stored is 2
)();
i=3
alert(i);

Here i is either 2 or 3, depending on the device and how busy it is at the moment. Make sure you put everything depending on GM.getValue also inside, if you don't want to introduce safe-flags or singletons in your code.

GM.getValue and GM.xmlHttpRequest seem to require async functions. GM.setValue can run without, but is still executed asynchronously!
They also dropped registerMenuCommand and AddStyle, but at least the second can be written by your own easily.

Now comes the real mess: While the new Greasemonkey supports the new GM-API-Calls, old Greasemonkey versions do not. Also most probably Scriptisch, ViolentMonkey and Tampermonkey will take a while to keep up.
So, to not break the script for older devices by fixing it for newer one, you need backwards compatibility.
According to Greasemonkey this is easy: www.greasespot.net/2017/09/gre…

You just need to include their "polyfill" script and request @ grants for old and new API-Calls (remove blank space after @):


// @ grant       GM_xmlhttpRequest
// @ grant       GM_getValue
// @ grant       GM_setValue
// @ grant       GM.xmlHttpRequest
// @ grant       GM.getValue
// @ grant       GM.setValue
// @ require  greasemonkey.github.io/gm4-pol…


At least in my Tampermonkey on Chrome this seems to work.
However, this also asks the user to allow a new source for the script (greasemonkey.github.io)

As a side note, it is also told that installing new userscripts in firefox will not work from github.
Good thing I have mirrors for my links. ^^
Recommended Journals
Varyon genos! + Uploads
:new: All genos can now be exchanged for one Purity trial image each! Likewise for rite images for another arpg as well. This is where I'll pop all of the genos or imports I have up for grabs! - USD payments are to be paid via invoice right away. - Maximum hold of 1 month for art payments, if payment is not completed in that time the geno will be put back up for sale. And all progress will be kept. - There MUST be progress within the first 2 weeks for art payments or the hold will be removed. - I can refuse a sale for any reason. Accepted payments: - USD - Points - Quests/CP/PTs/Training/ICQ/Etc - Trades Ping: Xe-Li (https://www.deviantart.com/xe-li) - Female To
About Our Sona Characters!
while our sonas are not a perfect 1 to 1 of who we are, they are absolutely an extension of us! here's a little more info about them for those who were curious! Bun species: lop eared bunny age: early 20's pronouns: she/her sexuality: pansexual likes: GIRLS, plants, stuffed animals, coffee, sweets, sleeping, rain, knives??? animal crossing, harvest moon, AESTHETICS dislikes: anxiety, crowded places, scary weather, loud noises, planes, tall buildings, the dark, most social situations, RUDE PEOPLE, peas ew favorite color: MINT! & greens occupation: works in a tiny flower shop hobbies: likes to knit, tend to her garden, and ba
Rant about the lupisvulpes community
Disclaimer Nothing here is to cause drama or directed at anyone specific, i want people to be AWARE of their actions and how shitty people treat each other in this community. This isn't against Lupis herself i respect her as an artist and she hasn't done anything bad to hurt people etc. This isnt hate on lup, this is more of a rant of her community. THIS IS MY EXPERIENCE WITHIN THIS COMMUNITY. Please note: this isnt gonna be fancy shit, im bad with grammar and writing im like 2 yrs old By far this has been one of the worst communities i have ever came across, all the people in this community are so hateful and greedy and with absolutely back
anonymous's avatar
Join the community to add your comment. Already a deviant? Sign In
Comments (8)
rotane's avatar
rotane|Professional
So, what about those of us who decide to stick with legacy code for the time being (either through Firefox ESR or forks such as Pale Moon)? Should we also update your scripts once they become available, or should we stick to the current ones?
Reply  ·  
Dediggefedde's avatar
Well...I guess that is up to you. ^^
The updates I'm currently doing are only about compatibility, so if old scripts still work, you don't need to update them.
Old versions can usually be found on the greasyfork-mirror.
However, I try my best to provide backward-compatibility with the polyfill solution, so the new versions should also work in older Firefox-releases or ESR releases.
Since userscripts are pretty secure on their own, I don't need to make security updates and you will probably just miss out additional features or bugfixes.
Reply  ·  
rotane's avatar
rotane|Professional
I was just asking if i should keep an eye open for auto-updates.
Reply  ·  
Nylten's avatar
Nylten|Hobbyist General Artist
Thank you for keeping up with the updates!
Reply  ·  
TheGalleryOfEve's avatar
TheGalleryOfEve|Professional Digital Artist
And what if we're the person on the other side of this ---> thegalleryofeve.deviantart.com… phone call??? :iconblankstareplz: :XD: How do WE fix something like this??? :iconimthinkingplz:

:iconhurrplz:
Reply  ·  
Dediggefedde's avatar
I'm not sure if I understand the question or if it is related, but you should contact your local phone company to blacklist phone callers you don't like.
If it is you that you don't like phoning others then... avoid it, I guess...
Reply  ·  
TheGalleryOfEve's avatar
TheGalleryOfEve|Professional Digital Artist
No, no :giggle: I was implying that this seems too difficult to understand for people who are either not technically inclined or simply just afraid of technology, like the old guy who called that customer support guy on the video :giggle:

You killed my joke :grump:
Reply  ·  
Dediggefedde's avatar
Aw, sorry. ^^
But, to be honest, those people will also likely not install an extension like greasemonkey to install userscripts from some anonymous user to change how a website is working.
For those who are no coders the message of the journal is: all my scripts broke, I'm working on it.
And the other information is a collection of some information regarding that topic that might help other developers.
Reply  ·  
anonymous's avatar
Join the community to add your comment. Already a deviant? Sign In
©2019 DeviantArt
All Rights reserved