I even tried just boiling it down in a new test script and making something 
super simple but no result

(function() {
    'use strict';
     GM.setValue("user", "yes");
     var test = GM.getValue("user", "no");
    console.log(test);
    if (test == "yes")
        console.log("succeed");
    // Your code here...
})();

This are the includes if that changes anything
// @grant       GM_addStyle
// @grant       GM_setClipboard
// @grant       GM.setValue
// @grant       GM.getValue
// @grant       GM.listValues
// @grant       GM_registerMenuCommand





On Friday, June 8, 2018 at 12:58:05 PM UTC-7, Jacob Miller wrote:
>
> I am grabbing the text from a web page and trying to save it so I can use 
> the text in a menu somewhere else.
>
> Grabbing text:
>
> if (window.location.pathname == "/app/list) {
>     jQuery(function($) {
>         var listOfUsers = 
> $("a[href$='javascript:void(0)']").map(function() {
>             return this.text;
>         });
>         var listS = "";
>         console.log(listOfUsers);
>         for (var i = 0; i <= listOfUsers.length; i++) {
>             listS += listOfUsers[i] + ",";
>         }
>         GM.setValue("users", JSON.stringify(list));
>     })
> }
>
> When trying to read the save I have tried:
> var menuList = GM.getValue("users");
> menuList = GM.getValue("users", "noreturn") + "";
> menuList = (async function(){return await GM.getValue("user", 
> "noreturn");})();
>
> but every time I try and read the information it just returns a promise
> console.log(menuList);
>
>
>
>
> <https://lh3.googleusercontent.com/-a27KEktO8G4/WxregqV7CjI/AAAAAAAAC2E/S2jKWbv_fJsildSijyfSM_bjNnF1dJtDQCLcBGAs/s1600/Capture.PNG>
>
> Am I missing something or doing something wrong? Or is it supposed to 
> return a promise and if so then how do I use the Promise?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

-- 
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