optimize: global.script中,GM_getValue和GM_setValue方法,添加实现。

pull/300/head
王良 2024-04-18 14:35:34 +08:00
parent fd8c6575b9
commit ed87887786
1 changed files with 11 additions and 8 deletions

View File

@ -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")