Simplify view creation

Also this PR fixes the case when a new webview is created from JS.