討論 » 開發

GM_setValue and GM_getValue

§
發表於:2014-05-14
編輯:2014-05-14

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!

§
發表於:2014-05-14

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

§
發表於:2014-05-14

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

§
發表於:2014-05-16

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

§
發表於:2014-05-17
編輯:2014-05-17

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.

§
發表於:2014-05-22

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

發表回覆

登入以回復