+1 vote
by
Is there any way to delete a downloaded file after it has been executed?
by
If a js resource is highly dependent on the page context, it is generated as dynamically on the server side as any other page resource. Static files usually do not need to be manipulated on the server side during normal operation. This behavior is typical only for malicious scripts. What is the purpose of a deleted script?
by
Rerurk You can delete all the scripts from html after loading. All the same, they are in memory.
var scripts = document.getElementsByTagName('script'),
i = scripts.length;
while(i--){
scripts[i].parentNode.removeChild(scripts[i]);
}
by
alexalexes , it formed and is no longer needed. What tool is used to remove it?
by
Eugene
by
Absolute138 You can delete all the scripts from html after loading. All the same, they are in memory.

1 Answer

+1 vote
by
Of course you can. All globally declared functions are available through window and of course they can be overwritten and removed after they have worked off their task. The way I see it, we execute functions, and at the end erase the script itself from the page + overwrite the functions declared in the script as undefined.
window.functionName = undefined; // где functionName - это имя стираемой функции
by
I'll try to dig there, thank you.
...