I am trying to wrap GM4's asynchronous methods into synchronous methods for a fast and easy way to make my current userscripts "cross-API compatible".
I'm not familiar with asynchronous Javascript, but by reading som posts on subject I thought I had found out how to achieve what I wanted. But it doesn't work :-/ ... When running below code in GM3 it alerts "value=42" (as expected). But when running on GM4 it alerts "value=[object Promise]". What am I doing wrong? How do I get rid of that Promise?... [ I have trouble posting in this forum. Maybe it doesn't like the code I'm posting or my posts get to big? So now posting a link to code instead: ] https://gist.github.com/StigNygaard/ea03b7ad2faeabe732c308786e3046c9 I know it would be better to try to take advantage of the possibilities of asynchronous code, but that must be a project for a later time. Right now I'm just looking for the quick and easy fix. /Stig. -- 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.
