# Startup and behavior

#### Startup state

WProofreader starts in the enabled state by default. To start it disabled (users can turn it on from the badge):

```js
autoStartup: false,
```

#### Auto-destroy

By default, `autoDestroy` is `false`, but it's automatically enabled for instances initialized using `autoSearch`. It removes the WProofreader instance when the editable container is removed from the page, so you don't need to handle destruction manually.

```js
autoDestroy: true,
```

#### AutoSearch scope

When `autoSearch` is enabled, WProofreader activates in the focused editable area. You can control which elements it targets using one of these options (don't use both at the same time):

`enableAutoSearchIn` limits WProofreader to specific elements by class, ID, data attribute, or HTML element type. `disableAutoSearchIn` excludes specific elements. If both are set, `enableAutoSearchIn` takes priority and `disableAutoSearchIn` is ignored.

```js
enableAutoSearchIn: ['.my-editor'],
// or
disableAutoSearchIn: ['#skip-this', 'textarea'],
```

**Enabling proofreading in inputs**

WProofreader is disabled in `<input>` elements by default due to compatibility limitations. To enable it:

```js
enableAutoSearchIn: ['input'],
```

#### Ignore rules

These options control what WProofreader skips during checking.

| Option                      | Default | Skips                        |
| --------------------------- | ------- | ---------------------------- |
| `ignoreAllCapsWords`        | `false` | Words like "EXAMPLE"         |
| `ignoreDomainNames`         | `true`  | URLs and email addresses     |
| `ignoreWordsWithMixedCases` | `false` | Words like "WebSpellChecker" |
| `ignoreWordsWithNumbers`    | `true`  | Words like "v2"              |

To change the default, set the option to the opposite value. Note that user preferences stored in the browser take priority over these defaults. To prevent that, add the option name to `disableOptionsStorage`.

**Disabled rules**

To disable specific grammar or style guide rules by their rule ID or category ID for all users:

```js
disabledRules: ['UPPERCASE_SENTENCE_START'],
```

#### Content exclusion

**HTML elements**

To skip checking inside specific HTML elements, provide tag names separated by `|`. Default: `'pre|style|script'`.

```js
ignoreElements: 'pre|style|script|table',
```

**CSS classes and data attributes**

```js
ignoreClasses: ['ignore-checking'],
ignoreAttributes: ['data-wsc-ignore-checking'],
```

**Skip highlighting in ignored segments**

When part of a word falls inside an ignored element, the error is still detected but highlighted by default. To skip highlighting in these cases (useful in track changes modes):

```js
skipMarkupForIgnoredText: true,
```

#### Theme

The default theme is `'default'`. Available values: `'default'`, `'gray'`, `'dark'`, `'custom'`, `'ckeditor5'`, `'tinymce'`.

```js
theme: 'gray',
```

The `'gray'` theme works well with most rich text editors. The `'ckeditor5'` and `'tinymce'` themes match those editors' look and feel. The `'custom'` theme lets you write your own CSS styles.

#### Minimum word length

The minimum number of characters in a word for it to be spell checked. Default is 3. This option applies to **algorithmic spell check only**.

```js
minWordLength: 2,
```

#### Options storage

By default, user preferences aren't stored in the browser between sessions. After a page reload, all options reset to the admin-defined defaults.

To enable storage for all options:

```js
disableOptionsStorage: [],
```

To enable storage for specific options only:

```js
disableOptionsStorage: ['all'],
// then override individual options you want stored
```

Possible values: `'options'` (all ignore options except lang), `'ignoreAllCapsWords'`, `'ignoreDomainNames'`, `'ignoreWordsWithMixedCases'`, `'ignoreWordsWithNumbers'`, `'spellingSuggestions'`, `'grammarSuggestions'`, `'styleGuideSuggestions'`, `'autocorrect'`, `'autocomplete'`, `'lang'`, `'all'`. Set to `[]` to enable storage for all options.

#### Synchronize options across instances

By default, ignore options and language are synchronized across all WProofreader instances on the page. To disable:

```js
syncOptions: false,
```

#### Restore native spell check

When WProofreader is disabled by the user, browser spell check stays off. To restore the browser's native spell check when WProofreader is disabled:

```js
restoreNativeSpellCheck: true,
```

#### Caching

Request response caching is disabled by default. When enabled, it caches responses, words added to the dictionary, ignored suggestions, and disabled rules. The cache resets every 24 hours.

{% hint style="info" %}
This is useful for projects where the document isn't reloaded frequently and content doesn't change much, similar to Google Docs.
{% endhint %}

```js
cache: true,
```

#### CSS scale support

If a parent element has a CSS `scale` transform applied, WProofreader UI elements may be misaligned. To enable scale detection and adjustment:

```js
enableScale: true,
```

#### Requests per check

The `requestTokensCount` option controls the maximum number of sentences sent per request. The default value of `4` is optimized for performance but can be adjusted if needed.

```js
requestTokensCount: 6,
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wproofreader.com/integrations/initialization/configuration-options/startup-and-behavior.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
