Note: Advice in this article will only work for JxBrowser 6. See the corresponding article for JxBrowser 7 here and here.(注意:本文中的建议仅适用于JxBrowser6。请在此处和此处参阅有关JxBrowser 7的相应文章。)
HTTP Server Authorization Whitelist(HTTP服务器授权白名单)
Since 6.8 you can configure JxBrowser with HTTP server authorization whitelist that represents a string with comma/semicolon separated list of URLs. For example:(从6.8开始,您可以使用HTTP服务器授权白名单配置JxBrowser,该白名单表示一个用逗号/分号分隔的URL列表的字符串。例如:)
Browser browser = new Browser(); BrowserContext browserContext = browser.getContext(); NetworkService networkService = browserContext.getNetworkService(); networkService.setServerWhiteList("*google.com,*example.com,*baz");
HTTP Network Delegate Whitelist(HTTP网络代表白名单)
To configure JxBrowser with HTTP network delegate whitelist you can use the approach described below:(要使用HTTP网络委托白名单配置JxBrowser,可以使用以下方法:)
Browser browser = new Browser(); BrowserContext browserContext = browser.getContext(); NetworkService networkService = browserContext.getNetworkService(); networkService.setDelegateWhiteList("*google.com,*example.com,*baz");
This functionality is available since 6.8.(从6.8开始提供此功能。)