您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
2/16/2022, 9:49:50 PM
(github repo with front and back source code is here)
Buy enabling this script you're getting the global object foreignStorage
, which is quite similar to the well known (I hope) standard localStorage
object.
Differences are:
localStorage
stores data per page (domain), foreignStorage
stores common data no matter which page you are onlocalStorage
stores data just in one browser for one user account, foreignStorage
stores in the cloud (Google Sheet actually) for everybodylocalStorage
is limited by around 5Mb, foreignStorage
limits are currently unknown, but I have a big hope that it is much morelocalStorage
is synchronous, foreignStorage
is asyncronous (because it stores data far away in the cloud)Really. Without authorization or anything like that. Total trust. So please don't use it to store sensitive information.
await foreignStorage.setItem('my_unique_key', '["JSON", "stringified", "data", {"with": "some", "data": "in it"}]')
Stores new key/value pair or overwrites value of existing, if one was already stored. Returns true or throws an error.
await foreignStorage.getItem('my_unique_key')
Reads key/value pair and returns what was stored. Returns the string value or undefined (if key not found). Or throws an error.
await foreignStorage.removeItem('my_unique_key')
Removes key/value pair if it was there. Returns true or throws an error.
await foreignStorage.getLength()
Returns the total count of key/value pairs in the foreignStorage or throws an error.
await foreignStorage.listKeys()
Returns the list of all keys in the foreignStorage or throws an error.
await foreignStorage.clear()
Removes all key/value pairs. Yours, everyone's. Returns true or throws an error.
CAUTION!!! THIS WILL SIGNIFICANTLY LOWER YOUR CARMA IF SOMEBODY'S DATA IS LOST IN THE PROCESS AND HE OR SHE WASN'T ACTUALLY READY TO LOOSE IT!
If you're going to use foreignStorage
, be nice and play carefully!
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址