* work around missing JFX WebView navigator.language settings
This commit is contained in:
parent
53aadcd8ae
commit
2602dc20ef
|
@ -5,6 +5,7 @@ import static net.filebot.Settings.*;
|
|||
import java.awt.Desktop;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.URI;
|
||||
import java.util.Locale;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -75,6 +76,9 @@ public class GettingStartedStage {
|
|||
|
||||
// force black background while page is loading
|
||||
setBackground(webview.getEngine(), 0xFF000000);
|
||||
|
||||
// make sure that we can read the user locale in JS
|
||||
webview.getEngine().executeScript(String.format("navigator.locale = '%s'", Locale.getDefault()));
|
||||
}
|
||||
|
||||
public void show() {
|
||||
|
|
|
@ -49,7 +49,7 @@ function getData() {
|
|||
}]
|
||||
|
||||
var links = location.hash.length > 0
|
||||
var youtube = !(/zh(.CN)?/i).test(navigator.language) // YouTube is blocked in China (mainland)
|
||||
var youtube = !(/zh(.CN)?/i).test(navigator.locale ? navigator.locale : navigator.language) // YouTube is blocked in China (mainland)
|
||||
|
||||
if (links) {
|
||||
data = data.slice(0, 5) // use only tutorial images
|
||||
|
|
Loading…
Reference in New Issue