Greasy Fork

Shined up real nice.

SingletonData

try to take over the world!

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://greasyfork.org/scripts/31539-singletondata/code/SingletonData.js?version=212334

After trying this script, you can ask a question about it, review it, or report it.
Advertisement
Author
Cologler
Ratings
0 0 0
Version
0.3
Created
Updated
License
N/A
Applies to
All sites

Author's Description

Singleton data on mulit-tabs.

// create instance
let sd = new SingletonData(key, defaultValue = null);
// set root value and it auto save.
sd.data = 1;
// set second level value and you need to call save()
sd.data.data2 = 1;
sd.save();

Share