'tampermonkey @grant GM_setValue // @grant GM_getValue when i try open file
// @grant GM_setValue
// @grant GM_getValue
let fileHandle;
let fileData;
let text
async function read(){
[fileHandle] = await window.showOpenFilePicker()
fileData = await fileHandle.getFile();
text = await fileData.text();
}
async function save(){
let stream = await fileHandle.createWritable();
var val= getValues();
await stream.write(text+"\n"+val);
await stream.close();
}
how to open the file correctly so that I can simultaneously use // @provide GM_setValue // @provide GM_getValue
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
