Skip to content

Commit 391c4fa

Browse files
authored
WebView: Allow to load style sheet from jlink images
Currently, loading a style sheet file using `WebView.getEngine().setUserStyleSheetLocation(url)` fails if the url start's with `jrt`, i.e. if the file is packaged in an application image using jlink. This is fixed with this PR.
1 parent ab6ea3b commit 391c4fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/javafx.web/src/main/java/javafx/scene/web/WebEngine.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ public final BooleanProperty javaScriptEnabledProperty() {
491491
* Location of the user stylesheet as a string URL.
492492
*
493493
* <p>This should be a local URL, i.e. either {@code 'data:'},
494-
* {@code 'file:'}, or {@code 'jar:'}. Remote URLs are not allowed
494+
* {@code 'file:'}, {@code 'jar:'}, or {@code 'jrt:'}. Remote URLs are not allowed
495495
* for security reasons.
496496
*
497497
* @defaultValue null
@@ -554,6 +554,7 @@ public final StringProperty userStyleSheetLocationProperty() {
554554
dataUrl = url;
555555
} else if (url.startsWith("file:") ||
556556
url.startsWith("jar:") ||
557+
url.startsWith("jrt:") ||
557558
url.startsWith("data:"))
558559
{
559560
try {

0 commit comments

Comments
 (0)