Feat: Game UI optimization #342
+13
-10
@@ -112,6 +112,7 @@ public class CasinoBrowserController {
|
|||||||
TRUSTED_DOMAINS.add("mojeek.com");
|
TRUSTED_DOMAINS.add("mojeek.com");
|
||||||
TRUSTED_DOMAINS.add("searx.be");
|
TRUSTED_DOMAINS.add("searx.be");
|
||||||
TRUSTED_DOMAINS.add("startpage.com");
|
TRUSTED_DOMAINS.add("startpage.com");
|
||||||
|
TRUSTED_DOMAINS.add("vscode.dev");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Aliases for common websites. */
|
/** Aliases for common websites. */
|
||||||
@@ -138,7 +139,10 @@ public class CasinoBrowserController {
|
|||||||
Map.entry("gradle", "gradle.org"),
|
Map.entry("gradle", "gradle.org"),
|
||||||
Map.entry("spring", "spring.io"),
|
Map.entry("spring", "spring.io"),
|
||||||
Map.entry("jetbrains", "jetbrains.com"),
|
Map.entry("jetbrains", "jetbrains.com"),
|
||||||
Map.entry("uni", "unibas.ch"));
|
Map.entry("uni", "unibas.ch"),
|
||||||
|
Map.entry("vs", "vscode.dev"),
|
||||||
|
Map.entry("vscode", "vscode.dev"),
|
||||||
|
Map.entry("vs code", "vscode.dev"));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves user input into a valid URL.
|
* Resolves user input into a valid URL.
|
||||||
@@ -653,23 +657,22 @@ public class CasinoBrowserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ("file".equalsIgnoreCase(scheme)) {
|
if ("file".equalsIgnoreCase(scheme)) {
|
||||||
Path allowed =
|
|
||||||
Paths.get(
|
Path baseDir = Paths.get(System.getProperty("user.dir")).normalize();
|
||||||
System.getProperty("user.dir"),
|
|
||||||
"documents",
|
Path manual = baseDir.resolve("documents/docs/game-engine/manual.html").normalize();
|
||||||
"docs",
|
|
||||||
"game-engine",
|
Path outreach = baseDir.resolve("outreach/index.html").normalize();
|
||||||
"manual.html")
|
|
||||||
.normalize();
|
|
||||||
|
|
||||||
Path requested = Paths.get(uri).normalize();
|
Path requested = Paths.get(uri).normalize();
|
||||||
|
|
||||||
if (requested.equals(allowed)) {
|
if (requested.equals(manual) || requested.equals(outreach)) {
|
||||||
securityLabel.setText("LOCAL OK");
|
securityLabel.setText("LOCAL OK");
|
||||||
engine.load(uri.toString());
|
engine.load(uri.toString());
|
||||||
} else {
|
} else {
|
||||||
securityLabel.setText("BLOCKED");
|
securityLabel.setText("BLOCKED");
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user