<commit_before># browser-window

The `BrowserWindow` class gives you ability to create a browser window, an
example is:

```javascript
var BrowserWindow = require('browser-window');

var win = new BrowserWindow({ width: 800, height: 600, show: false });
win.on('closed', function() {
  win = null;
});

win.loadUrl('https://github.com');
win.show();
```

You can also create a window without chrome by using
[Frameless Window](frameless-window.md) API.

## Class: BrowserWindow

`BrowserWindow` is an
[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter).

### new BrowserWindow(options)

* `options` Object
  * `x` Integer - Window's left offset to screen
  * `y` Integer - Window's top offset to screen
  * `width` Integer - Window's width
  * `height` Integer - Window's height
  * `use-content-size` Boolean - The `width` and `height` would be used as web
     page's size, which means the actual window's size will include window
     frame's size and be slightly larger.
  * `center` Boolean - Show window in the center of the screen
  * `min-width` Integer - Minimum width
  * `min-height` Integer - Minimum height
  * `max-width` Integer - Maximum width
  * `max-height` Integer - Maximum height
  * `resizable` Boolean - Whether window is resizable
  * `always-on-top` Boolean - Whether the window should always stay on top of
     other windows
  * `fullscreen` Boolean - Whether the window should show in fullscreen, when
    set to `false` the fullscreen button would also be hidden on OS X
  * `skip-taskbar` Boolean - Do not show window in taskbar
  * `zoom-factor` Number - The default zoom factor of the page, zoom factor is
    zoom percent / 100, so `3.0` represents `300%`
  * `kiosk` Boolean - The kiosk mode
  * `title` String - Default window title
  * `icon` [Image](image.md) - The window icon
  * `show` Boolean - Whether window should be shown when created
  * `frame` Boolean - Specify `false` to create a
    [Frameless Window](frameless-window.md)
  * `node-integration` Boolean - Whether node integration is enabled, default
     is `true`
  * `accept-first-mouse` Boolean - Whether the web view accepts a single
     mouse-down event that simultaneously activates the window
  * `auto-hide-menu-bar` Boolean - Auto hide the menu bar unless the `Alt`
    key is pressed.
  * `enable-larger-than-screen` Boolean - Enable the window to be resized larger
    than screen.
  * `dark-theme` Boolean - Forces using dark theme for the window, only works on
    some GTK+3 desktop environments.
  * `web-preferences` Object - Settings of web page's features
    * `javascript` Boolean
    * `web-security` Boolean
    * `images` Boolean
    * `java` Boolean
    * `text-areas-are-resizable` Boolean
    * `webgl` Boolean
    * `webaudio` Boolean
    * `plugins` Boolean - Whether plugins should be enabled, currently only
      `NPAPI` plugins are supported.
    * `extra-plugin-dirs` Array - Array of paths that would be searched for
      plugins. Note that if you want to add a directory under your app, you
      should use `__dirname` or `process.resourcesPath` to join the paths to
      make them absolute, using relative paths would make atom-shell search
      under current working directory.
    * `experimental-features` Boolean
    * `experimental-canvas-features` Boolean
    * `subpixel-font-scaling` Boolean
    * `overlay-scrollbars` Boolean
    * `overlay-fullscreen-video` Boolean
    * `shared-worker` Boolean
    * `direct-write` Boolean - Whether the DirectWrite font rendering system on
       Windows is enabled

Creates a new `BrowserWindow` with native properties set by the `options`.
Usually you only need to set the `width` and `height`, other properties will
have decent default values.

### Event: 'page-title-updated'
<commit_msg>docs: "preload" option of BrowserWindow<commit_after># browser-window

The `BrowserWindow` class gives you ability to create a browser window, an
example is:

```javascript
var BrowserWindow = require('browser-window');

var win = new BrowserWindow({ width: 800, height: 600, show: false });
win.on('closed', function() {
  win = null;
});

win.loadUrl('https://github.com');
win.show();
```

You can also create a window without chrome by using
[Frameless Window](frameless-window.md) API.

## Class: BrowserWindow

`BrowserWindow` is an
[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter).

### new BrowserWindow(options)

* `options` Object
  * `x` Integer - Window's left offset to screen
  * `y` Integer - Window's top offset to screen
  * `width` Integer - Window's width
  * `height` Integer - Window's height
  * `use-content-size` Boolean - The `width` and `height` would be used as web
     page's size, which means the actual window's size will include window
     frame's size and be slightly larger.
  * `center` Boolean - Show window in the center of the screen
  * `min-width` Integer - Minimum width
  * `min-height` Integer - Minimum height
  * `max-width` Integer - Maximum width
  * `max-height` Integer - Maximum height
  * `resizable` Boolean - Whether window is resizable
  * `always-on-top` Boolean - Whether the window should always stay on top of
     other windows
  * `fullscreen` Boolean - Whether the window should show in fullscreen, when
    set to `false` the fullscreen button would also be hidden on OS X
  * `skip-taskbar` Boolean - Do not show window in taskbar
  * `zoom-factor` Number - The default zoom factor of the page, zoom factor is
    zoom percent / 100, so `3.0` represents `300%`
  * `kiosk` Boolean - The kiosk mode
  * `title` String - Default window title
  * `icon` [Image](image.md) - The window icon
  * `show` Boolean - Whether window should be shown when created
  * `frame` Boolean - Specify `false` to create a
    [Frameless Window](frameless-window.md)
  * `node-integration` Boolean - Whether node integration is enabled, default
     is `true`
  * `accept-first-mouse` Boolean - Whether the web view accepts a single
     mouse-down event that simultaneously activates the window
  * `auto-hide-menu-bar` Boolean - Auto hide the menu bar unless the `Alt`
    key is pressed.
  * `enable-larger-than-screen` Boolean - Enable the window to be resized larger
    than screen.
  * `dark-theme` Boolean - Forces using dark theme for the window, only works on
    some GTK+3 desktop environments
  * `preload` String - Specifies a script that will be loaded before other
    scripts run in the window. This script will always have access to node APIs
    no matter whether node integration is turned on for the window, and the path
    of `preload` script has to be absolute path.
  * `web-preferences` Object - Settings of web page's features
    * `javascript` Boolean
    * `web-security` Boolean
    * `images` Boolean
    * `java` Boolean
    * `text-areas-are-resizable` Boolean
    * `webgl` Boolean
    * `webaudio` Boolean
    * `plugins` Boolean - Whether plugins should be enabled, currently only
      `NPAPI` plugins are supported.
    * `extra-plugin-dirs` Array - Array of paths that would be searched for
      plugins. Note that if you want to add a directory under your app, you
      should use `__dirname` or `process.resourcesPath` to join the paths to
      make them absolute, using relative paths would make atom-shell search
      under current working directory.
    * `experimental-features` Boolean
    * `experimental-canvas-features` Boolean
    * `subpixel-font-scaling` Boolean
    * `overlay-scrollbars` Boolean
    * `overlay-fullscreen-video` Boolean
    * `shared-worker` Boolean
    * `direct-write` Boolean - Whether the DirectWrite font rendering system on
       Windows is enabled

Creates a new `BrowserWindow` with native properties set by the `options`.
Usually you only need to set the `width` and `height`, other properties will
have decent default values.

### Event: 'page-title-updated'

{'fraction_non_alphanumeric': 0.09412802419354839, 'fraction_numerical': 0.003780241935483871, 'mean_word_length': 3.5354285714285716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '783811', 'n_tokens_mistral': 2258, 'n_tokens_neox': 2181, 'n_words': 929}