创建WebView之前,设置代理,代码如下所示:
System.setProperty("http.proxyHost", "127.0.0.1");
System.setProperty("http.proxyPort", "10809");
System.setProperty("https.proxyHost", "127.0.0.1");
System.setProperty("https.proxyPort", "10809");
webView = new WebView();
webEngine = webView.getEngine();
webEngine.setJavaScriptEnabled(true);
webEngine.load("https://gmail.com/");
效果如下图:
imageDONE!
欢迎点赞!
网友评论