The Proofreader API allows web pages to check for grammar, spelling, and punctuation errors. It goes beyond returning corrected text by providing structured annotations detailing the error type and plain-language explanations of why the correction was made.
chrome://flags. Note that Chrome's current implementation does not yet support the includeCorrectionTypes and includeCorrectionExplanations options — results will omit types and explanation for now. Checks if the browser can support proofreading based on the specified requirements, allowing progressive enhancement.
staticavailability(options?: ProofreaderCreateCoreOptions): Promise<Availability>; | Property | Type | Description |
|---|---|---|
| includeCorrectionTypes | boolean | If true, requires the model to label each correction with a CorrectionType: "spelling", "punctuation", "capitalization", "preposition", "missing-words", or "grammar" (the spec draft currently lists a subset without "preposition"/"missing-words"). Defaults to false. |
| includeCorrectionExplanations | boolean | If true, requires the model to provide a short plain-language explanation for corrections. Defaults to false. |
| expectedInputLanguages | sequence<DOMString> | The expected input language tags (e.g., ['en']). |
| correctionExplanationLanguage | DOMString | The target language for the explanation text. |
A promise that resolves to an Availability string: 'available', 'downloadable', 'downloading', or 'unavailable'.
Instantiates a new Proofreader object, initiating any necessary model downloads.
staticcreate(options?: ProofreaderCreateOptions): Promise<Proofreader>; Inherits all properties from ProofreaderCreateCoreOptions (above) — including includeCorrectionTypes, includeCorrectionExplanations, expectedInputLanguages, and correctionExplanationLanguage — plus:
| Property | Type | Description |
|---|---|---|
| signal | AbortSignal | Allows aborting the creation and download process. |
| monitor | CreateMonitorCallback | Callback to listen to downloadprogress events. |
Proofreads the input string and returns a complete ProofreadResult object containing the corrected string and a detailed array of corrections.
proofread(input: DOMString, options?: ProofreaderProofreadOptions): Promise<ProofreadResult>; | Property | Type | Description |
|---|---|---|
| correctedInput | DOMString | The fully corrected string. |
| corrections | sequence<ProofreadCorrection> | Detailed list containing startIndex, endIndex, correction, and optional types/explanation (present only when the corresponding include* option was set at creation). |
The explainer additionally defines proofreadStreaming(input, options), which returns a ReadableStream that delivers correction explanations as they become available. It is not yet part of the spec draft.
Destroys the proofreader instance, aborting any active requests and allowing the browser to unload the underlying machine learning models from memory.
destroy(): undefined; | Property | Type | Description |
|---|---|---|
| includeCorrectionTypes | boolean (readonly) | True if the proofreader provides correction types. |
| includeCorrectionExplanations | boolean (readonly) | True if the proofreader provides explanations. |
| expectedInputLanguages | FrozenArray<DOMString> | null (readonly) | The expected input languages provided during creation. |
| correctionExplanationLanguage | DOMString | null (readonly) | The language explanations are generated in, provided during creation. |