I have this chrome extension, its contentScript.js triggers a refresh while execution. When the page is refreshed, execution ceases and doesn’t resume.
I want it to resume from where it caused the refresh page.
This causes the Refresh.
const nextItem = selectedItem.nextElementSibling;
if (nextItem) {
nextItem.click();
} else {
console.log("Next item not found.");
break;
}
await new Promise((resolve) => setTimeout(resolve, 3000));}
I want to resume execution from the very next line.
I just don’t understand how to do it. I have tried different resources but no luck.
Please help me, I am really new to this.