diff --git a/saveprompt.user.js b/saveprompt.user.js index 4b95532..920bd7d 100644 --- a/saveprompt.user.js +++ b/saveprompt.user.js @@ -8,12 +8,13 @@ // ==/UserScript== -//This userscript will save any prompt you write into chatgpt into your local storage -//This means if a tab gets closed and you had a very well thought out prompt that gets lost you can still dig for it -//Prompts are saved by their unix timestamp - (async function(){ - function timeout(ms) { + for await (let newTarget of targetDivs()) { + applyHandler(newTarget); + } +})(); + +function timeout(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } @@ -31,10 +32,6 @@ await timeout(500); } } - for await (let newTarget of targetDivs()) { - applyHandler(newTarget); - } -})(); function shouldSaveDraft(oldVal, newVal) { // Save if text was added or replaced (not pure deletion).