Discuții » Dezvoltare

GM_setValue and GM_getValue

§
Postat în: 14-05-2014
Editat în: 14-05-2014

GM_setValue and GM_getValue

Hi! I'm looking for a new home for my script since userscripts.org is down. (Script is https://greasyfork.org/scripts/951-survivor-sucks-block-users.) The problem is my script uses GM_setValue to save a list of usernames, and it seems like moving the script to Greasy Fork will cause my users to lose that list. Is there any way of getting around this? In other words, can the Greasy Fork version use the value from the userscripts.org version?

TIA!

§
Postat în: 14-05-2014

1. Do NOT change the @name or @namespace metadata of the scripts.
2. Reinstall a script may cause the storage reset.

§
Postat în: 14-05-2014

Unfortunately my original script did not have a @namespace key, and GreasyFork requires a @namespace.

§
Postat în: 16-05-2014

In case anyone else reads this - Chrome/Tampermonkey uses default namespace null, while Firefox/Greasemonkey uses userscripts.org (or whatever domain the script was hosted at). So there's no namespace that will preserve the GM values with both browsers. Bummer :(

§
Postat în: 17-05-2014
Editat în: 17-05-2014

recent versions of GM keep script variables in SQLite DB file which, AFAIK, doesn't contain any information about namespace. You can find GM sqlite files in %your_firefox_profile_folder%/gm_scripts/*.db - or - for Chrome - by scanning your system drive for chrome-extension*.localstorage
And there's Firefox add-on called SQLite manager.

§
Postat în: 22-05-2014

Actually, the location for chrome (for windows 7) is

Users\[User]\AppData\Local\Google\Chrome\User Data\[Profile]\Local Storage

And, if you aren't using Firefox and the SQLite manager extension, there are portable apps (at portableapps.com) called SQLiteman, or SQLite Database Browser that you can use

Postează un raspuns

Autentifică-te pentru a posta un răspuns.