<commit_before>'use strict';

const fs = require('fs');
const path = require('path');
const electron = require('electron');
const appMenu = require('./menu');
const windowStateKeeper = require('electron-window-state');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;

let mainWindow;

function isEmptyObject(obj) {
    return Object.keys(obj).length === 0;
}

app.on('ready', () => {
    if (!isEmptyObject(appMenu)) {
        electron.Menu.setApplicationMenu(appMenu);
    }

    let mainWindowState = windowStateKeeper({
      defaultWidth: 1000,
      defaultHeight: 800
    });

    function createWindow() {

      mainWindow = new BrowserWindow({
          title: app.getName(),
          'x': mainWindowState.x,
          'y': mainWindowState.y,
          'width': mainWindowState.width,
          'height': mainWindowState.height,
          minWidth: 500,
          minHeight: 300,
          icon: 'resources/icon.png',
          webPreferences: {
              nodeIntegration: false
          }
      });

      mainWindow.loadURL('https://forum.snapcraft.io/');
      mainWindow.setMenu(null);
      //Menu bar kept around in event that we want to use in future.
      //mainWindow.setAutoHideMenuBar(true);

      mainWindow.on('closed', () => {
          mainWindow = null;<commit_msg>External links now open in browser.<commit_after>'use strict';

const fs = require('fs');
const path = require('path');
const electron = require('electron');
const appMenu = require('./menu');
const windowStateKeeper = require('electron-window-state');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;

let mainWindow;

function isEmptyObject(obj) {
    return Object.keys(obj).length === 0;
}

app.on('ready', () => {
    if (!isEmptyObject(appMenu)) {
        electron.Menu.setApplicationMenu(appMenu);
    }

    let mainWindowState = windowStateKeeper({
      defaultWidth: 1000,
      defaultHeight: 800
    });

    function createWindow() {

      mainWindow = new BrowserWindow({
          title: app.getName(),
          'x': mainWindowState.x,
          'y': mainWindowState.y,
          'width': mainWindowState.width,
          'height': mainWindowState.height,
          minWidth: 500,
          minHeight: 300,
          icon: 'resources/icon.png',
          webPreferences: {
              nodeIntegration: false
          }
      });

      mainWindow.loadURL('https://forum.snapcraft.io/');
      mainWindow.setMenu(null);
      //Menu bar kept around in event that we want to use in future.
      //mainWindow.setAutoHideMenuBar(true);

      var wc = mainWindow.webContents;

      wc.on('will-navigate', function(e, url) {
        /* If url isn't the actual page */
        if(url != wc.getURL()) {
          e.preventDefault();
          electron.shell.openExternal(url);
        }
      });

      mainWindow.on('closed', () => {
          mainWindow = null;
{'fraction_non_alphanumeric': 0.13333333333333333, 'fraction_numerical': 0.009572649572649573, 'mean_word_length': 2.5509708737864076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '2505122', 'n_tokens_mistral': 869, 'n_tokens_neox': 812, 'n_words': 188}