问题
I'm trying to share variable between 2 different Tampermonkey scripts running in 2 separate tabs.
I tried using GM_setValue in one script then retrieving it with GM_getValue in the other one but without any success, so I assume there's separate storage for each script.
Is there any easy way to do this? Am I just missing something simple? Can I somehow make both scripts share the same storage?
回答1:
Yes, you can. You can use localStorage, or you can use a database at your server and get/set values with AJAX.
来源:https://stackoverflow.com/questions/25949711/sharing-variables-between-2-separate-scripts