Anthony created a script to bridge compatibility. You can add this to the top of your script and it will define a GM_addStyle() function
@require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js ... or you can take the part that sets the CSS styles (the variable "aCss" should contain the css text) let head = document.getElementsByTagName('head')[0]; if (head) { let style = document.createElement('style'); style.setAttribute('type', 'text/css'); style.textContent = aCss; head.appendChild(style); } On Wednesday, November 22, 2017 at 2:27:21 AM UTC-7, Ben wrote: > > @Phillip Cazzola > > thank for the comment. > > However I am still confused. > > I have some scripts with lots of GM_addStyle() statements. > > According to webpage http://www.greasespot.net/ there is ", there is *no > support* for GM_addStyle". > On the other side it is written: "In general these methods work like their > old counterparts, but their return values are Promise > <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise> > s" > > Hmm, so when I re-write a (formerly working) script to > > .... > // @grant GM.addStyle > ... > GM.addStyle("#foobarid { font-size: 16px !important;"); > > > it does still not work. > > How do I have to adjust the script otherwise to be v4.0 compatible? > > Ben > > On Wednesday, 22 November 2017 05:00:17 UTC+1, Phillip Cazzola wrote: >> >> >> >> GM 4.0 has a new API >> >> http://www.greasespot.net/ >> >> "We've elected to make a rare *backwards incompatible* change." >> >> On Tuesday, November 21, 2017 at 9:17:59 AM UTC-7, Ben wrote: >>> >>> Today I updated Firefox to new 64bit v57 and to Greasemonkey AddOn v4.0 >>> >>> As far as I can see all my old scripts do not work any more. >>> >>> Unfortunately I cannot figure out if the update to GM 4.0 or the update >>> to Firefox v57 causes the trouble. >>> >>> Do others have the same problems? >>> >>> Or do I have to adjust something to work? >>> >>> Ben >>> >>> >>> >>> >>> -- You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to greasemonkey-users+unsubscr...@googlegroups.com. To post to this group, send email to greasemonkey-users@googlegroups.com. Visit this group at https://groups.google.com/group/greasemonkey-users. For more options, visit https://groups.google.com/d/optout.