optimize: global.script中,GM_getValue和GM_setValue方法,添加实现。
parent
fd8c6575b9
commit
ed87887786
|
@ -1,9 +1,12 @@
|
|||
window.__ds_global__={
|
||||
GM_registerMenuCommand: () => {},
|
||||
GM_unregisterMenuCommand: () => {},
|
||||
GM_openInTab: () => {},
|
||||
GM_getValue: () => {},
|
||||
GM_setValue: () => {},
|
||||
GM_notification: () => {}
|
||||
}
|
||||
(function(){
|
||||
const config = {};
|
||||
window.__ds_global__={
|
||||
GM_registerMenuCommand: () => {},
|
||||
GM_unregisterMenuCommand: () => {},
|
||||
GM_openInTab: () => {},
|
||||
GM_getValue: (key) => config[key],
|
||||
GM_setValue: (key, value) => { config[key] = value; },
|
||||
GM_notification: () => {}
|
||||
}
|
||||
}();
|
||||
console.log("ds_global completed")
|
Loading…
Reference in New Issue