nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

Removing a webview element deletes temporary folder

Open escatg opened this issue 6 years ago • 4 comments

NWJS Version : 0.46.3 Operating System : Windows 10

Expected behavior

After removing a webview element from the DOM, we can create another one, add it to the DOM, and load the same page again into it.

Actual behavior

After the webview element is removed from the DOM and garbage collected, some or all files from the temporary directory (unzip of application files) are deleted. This means assets like css, images are missing and it is not possible to load the same page in a new webview.

We can see that as soon as the chromium process dedicated to the webview stops, the deletion starts. Procmon confirms it is nw.exe that is deleting files.

Could it be a result of that change a83eb54 from #5208 ?

escatg avatar Jul 06 '20 14:07 escatg

Thanks for reporting. Could you please provide a full sample (not code snippets) so I can reproduce?

rogerwang avatar Jul 06 '20 23:07 rogerwang

As a workaround, you can redistribute your app in the way that nw.exe resides in the same directory tree of package.json.

rogerwang avatar Jul 06 '20 23:07 rogerwang

app.zip

Here is a minimal sample with which the bug can be reproduced on Windows. It can take several tries, but after the second window containing a webview closes, the temporary nw folder is often emptied.

escatg avatar Jul 07 '20 16:07 escatg

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 09:01 stale[bot]