|
|
@@ -23,10 +23,11 @@ export function createGmApiProps() {
|
|
|
GM_deleteValue(key) {
|
|
|
const { id } = this;
|
|
|
const values = loadValues(id);
|
|
|
+ const oldRaw = values[key];
|
|
|
+ delete values[key];
|
|
|
dumpValue({
|
|
|
- id, key, oldRaw: values[key],
|
|
|
+ id, key, oldRaw,
|
|
|
});
|
|
|
- delete values[key];
|
|
|
},
|
|
|
GM_getValue(key, def) {
|
|
|
const raw = loadValues(this.id)[key];
|
|
|
@@ -40,10 +41,11 @@ export function createGmApiProps() {
|
|
|
const dumped = jsonDump(val);
|
|
|
const raw = dumped ? `o${dumped}` : null;
|
|
|
const values = loadValues(id);
|
|
|
+ const oldRaw = values[key];
|
|
|
+ values[key] = raw;
|
|
|
dumpValue({
|
|
|
- id, key, val, raw, oldRaw: values[key],
|
|
|
+ id, key, val, raw, oldRaw,
|
|
|
});
|
|
|
- values[key] = raw;
|
|
|
},
|
|
|
/**
|
|
|
* @callback GMValueChangeListener
|