<commit_before>var path = require('path');
var electron = require('electron');
var helpers = require('./../../helpers/helpers');
var createMenu = require('./../menu/menu');

var BrowserWindow = electron.BrowserWindow;
var shell = electron.shell;
var isOSX = helpers.isOSX;
var linkIsInternal = helpers.linkIsInternal;

const ZOOM_INTERVAL = 0.1;

/**
 *
 * @param {{}} options AppArgs from nativefier.json
 * @param {electron.app.quit} onAppQuit
 * @param {electron.app.dock.setBadge} setDockBadge
 * @returns {electron.BrowserWindow}
 */
function createMainWindow(options, onAppQuit, setDockBadge) {
    var mainWindow = new BrowserWindow(
        {
            width: options.width || 1280,
            height: options.height || 800,
            'web-preferences': {
                javascript: true,
                plugins: true,
                nodeIntegration: false,
                preload: path.join(__dirname, 'static', 'preload.js')
            }
        }
    );

    var currentZoom = 1;

    var onZoomIn = function () {
        currentZoom += ZOOM_INTERVAL;
        mainWindow.webContents.send('change-zoom', currentZoom);
    };

    var onZoomOut = function () {
        currentZoom -= ZOOM_INTERVAL;
        mainWindow.webContents.send('change-zoom', currentZoom);
    };

    createMenu(options.nativefierVersion, onAppQuit, mainWindow.webContents.goBack, mainWindow.webContents.goForward, onZoomIn, onZoomOut);

    if (options.userAgent) {
        mainWindow.webContents.setUserAgent(options.userAgent);
    }

    mainWindow.webContents.on('did-finish-load', function () {<commit_msg>Set window title immediately when the window is created, fixes #54<commit_after>var path = require('path');
var electron = require('electron');
var helpers = require('./../../helpers/helpers');
var createMenu = require('./../menu/menu');

var BrowserWindow = electron.BrowserWindow;
var shell = electron.shell;
var isOSX = helpers.isOSX;
var linkIsInternal = helpers.linkIsInternal;

const ZOOM_INTERVAL = 0.1;

/**
 *
 * @param {{}} options AppArgs from nativefier.json
 * @param {electron.app.quit} onAppQuit
 * @param {electron.app.dock.setBadge} setDockBadge
 * @returns {electron.BrowserWindow}
 */
function createMainWindow(options, onAppQuit, setDockBadge) {
    var mainWindow = new BrowserWindow(
        {
            width: options.width || 1280,
            height: options.height || 800,
            title: options.name,
            'web-preferences': {
                javascript: true,
                plugins: true,
                nodeIntegration: false,
                preload: path.join(__dirname, 'static', 'preload.js')
            }
        }
    );

    var currentZoom = 1;

    var onZoomIn = function () {
        currentZoom += ZOOM_INTERVAL;
        mainWindow.webContents.send('change-zoom', currentZoom);
    };

    var onZoomOut = function () {
        currentZoom -= ZOOM_INTERVAL;
        mainWindow.webContents.send('change-zoom', currentZoom);
    };

    createMenu(options.nativefierVersion, onAppQuit, mainWindow.webContents.goBack, mainWindow.webContents.goForward, onZoomIn, onZoomOut);

    if (options.userAgent) {
        mainWindow.webContents.setUserAgent(options.userAgent);
    }

    mainWindow.webContents.on('did-finish-load', function () {
{'fraction_non_alphanumeric': 0.12583383869011522, 'fraction_numerical': 0.0066707095209217705, 'mean_word_length': 2.8629976580796255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2547439', 'n_tokens_mistral': 1017, 'n_tokens_neox': 962, 'n_words': 198}