Skip to content

[FireMonkey] GM_getValue/GM_setValue should be synchronous #98

@qsniyg

Description

@qsniyg

GM_getValue/GM_setValue are synchronous:

GM_setValue("variable", "test");
console.log(GM_getValue("variable"));
// logs 'test'

Looking at the source code (scriptAPI.js), it appears GM_setValue is just mapped directly to GM.setValue:

  script.defineGlobals({

    GM,
    GM_setValue:        GM.setValue,
    GM_getValue:        GM.getValue,
    GM_deleteValue:     GM.deleteValue,
    GM_listValues:      GM.listValues,
    GM_openInTab:       GM.openInTab,
    GM_setClipboard:    GM.setClipboard,
    GM_notification:    GM.notification,
    GM_xmlhttpRequest:  GM.xmlHttpRequest,
    GM_getResourceURL:  GM.getResourceUrl,
    GM_info:            GM.info,

    GM_fetch:           GM.fetch
  });

I'm not sure if GM_setValue needs to be changed, but GM_getValue returning a promise prevents some userscripts (including mine) from properly working. I'm guessing GM_listValues should also be synchronous.

Thank you for doing this by the way, it's great to have more options :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions