<commit_before>package failchat.core;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

import java.util.logging.Logger;

public class Gui extends Application {

    private static final Logger logger = Logger.getLogger(MessageManager.class.getName());

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("failchat");
        WebView webView = new WebView();
        WebEngine webEngine = webView.getEngine();
        Scene webScene = new Scene(webView, 350, 500);

        webEngine.load(Bootstrap.workDir.resolve("skins/default/default.html").toAbsolutePath().toUri().toURL().toString());

        primaryStage.setScene(webScene);
        primaryStage.show();
        primaryStage.setOnCloseRequest(event -> Bootstrap.shutDown());
        logger.fine("GUI loaded");
    }

    public static void main(String[] args) {
        launch();
    }
}<commit_msg>Links opening in default browser<commit_after>package failchat.core;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

import java.nio.file.Path;
import java.util.logging.Logger;

public class Gui extends Application {

    private static final Logger logger = Logger.getLogger(MessageManager.class.getName());
    private static final Path skinsPath = Bootstrap.workDir.resolve("skins");

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("failchat");
        WebView webView = new WebView();
        WebEngine webEngine = webView.getEngine();
        Scene webScene = new Scene(webView, 350, 500);

        webEngine.load(Bootstrap.workDir.resolve("skins/default/default.html").toAbsolutePath().toUri().toURL().toString());

        //url opening interceptor
        webEngine.locationProperty().addListener(new ChangeListener<String>() {
            @Override
            public void changed(ObservableValue<? extends String> observable, final String oldValue, final String newValue) {
                if (!newValue.contains(skinsPath.toAbsolutePath().toString())) {
                    logger.fine("Opening url: " + newValue);
                    Platform.runLater(() -> webEngine.getLoadWorker().cancel());
                    getHostServices().showDocument(newValue);
                }
            }
        });

        primaryStage.setScene(webScene);
        primaryStage.show();
        primaryStage.setOnCloseRequest(event -> Bootstrap.shutDown());
        logger.fine("GUI loaded");
    }

    public static void main(String[] args) {
        launch();
    }
}
{'fraction_non_alphanumeric': 0.11438474870017332, 'fraction_numerical': 0.004159445407279029, 'mean_word_length': 3.2818991097922847, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6328072', 'n_tokens_mistral': 795, 'n_tokens_neox': 746, 'n_words': 162}