Fix: Checkstyle
This commit is contained in:
+6
-2
@@ -192,7 +192,9 @@ public class CasinoBrowserController {
|
|||||||
WebView webView = new WebView();
|
WebView webView = new WebView();
|
||||||
WebEngine engine = webView.getEngine();
|
WebEngine engine = webView.getEngine();
|
||||||
|
|
||||||
engine.locationProperty().addListener((obs, oldUrl, newUrl) -> {
|
engine.locationProperty()
|
||||||
|
.addListener(
|
||||||
|
(obs, oldUrl, newUrl) -> {
|
||||||
if (isDownloadUrl(newUrl)) {
|
if (isDownloadUrl(newUrl)) {
|
||||||
LOGGER.warn("Download navigation blocked: " + newUrl);
|
LOGGER.warn("Download navigation blocked: " + newUrl);
|
||||||
engine.getLoadWorker().cancel();
|
engine.getLoadWorker().cancel();
|
||||||
@@ -749,7 +751,9 @@ public class CasinoBrowserController {
|
|||||||
* @return true if the URL is likely a download link, false otherwise
|
* @return true if the URL is likely a download link, false otherwise
|
||||||
*/
|
*/
|
||||||
private static boolean isDownloadUrl(String url) {
|
private static boolean isDownloadUrl(String url) {
|
||||||
if (url == null) return false;
|
if (url == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return url.matches(".*\\.(exe|zip|dmg|msi|apk|jar|pdf)(\\?.*)?$");
|
return url.matches(".*\\.(exe|zip|dmg|msi|apk|jar|pdf)(\\?.*)?$");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user