1. You can use location.reload() to reload the window.
2. When the HTML file is loaded remotely you cannot load the previews because they are local files. This is because of security restrictions in the webview. To get around this you can keep your HTML file local but load your JS and CSS files remotely. You can set the path to your JS and CSS files in main.js.