In the past, there was no alternative to GreaseMonkey. Now there is. If a 
script doesn't work in GreaseMonkey, many people will shift over to 
TamperMonkey. 

Async APIs might* be a good idea going forward, but priority should be on 
making sure that you don't break most scripts. 

Also, Tampermonkey has a previous version which was open source, so you 
might be able to pull from that. 

*I say might because I'm not sold on promises. I still can't get my head 
around them, as I can't find anything that really explains them except to 
programmers already used to similar concepts in other languages. And I 
think most userscript authors are amateur.

Plus, well, you aren't the only one defining APIs anymore. 

On Tuesday, May 30, 2017 at 12:18:09 PM UTC-5, Anthony Lieuallen wrote:
>
> On Tue, May 30, 2017 at 2:52 AM, <[email protected] <javascript:>> wrote:
>
>> Or using ES2017, something like:
>>
>> let sData = await GM.getValue("serialised") ; 
>> let oData = JSON.parse(sData) ;
>> // useful things still happen here.
>>
>>
> I've largely decided to go for ideal design/good performance.  Since I'm 
> also learning the new WebExt APIs along the way I might not do so 
> perfectly, but I'm trying.  This means new async APIs.  The possibility for 
> compatibility-increasing shims, even perhaps automatic ones, is not 
> impossible.  But this proposal you have above is basically exactly what I'm 
> doing.  New APIs return promises.  You can await 
> <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await>
>  
> a promise and get code like the example you've got above.
>
> We've been through painful compatibility migrations in the past.  They're 
> not awesome, but they happen.  Plus, roughly half of all scripts use no 
> privileged APIs and won't be affected.  In the future we can invest effort 
> into repairing compatibility with old scripts that haven't been updated.  
> But now (read: by the time 57 is out and we have to do something to not 
> break 100%) we'll have something that works, and efficiently.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to