migrate most of webview function