Drupal is a registered trademark of Dries Buytaert

Browser AI Comments adds AI-powered helpers directly to Drupal’s comment system, using capabilities available in modern Chrome browsers. It lets site visitors translate comments (while writing or while reading) and helps moderators and communities by warning commenters about potentially toxic language before they post.

Features

  • In-comment translation
    • Translate the current comment while writing.
    • Translate a published comment while viewing.
    • Uses Chrome’s experimental Web AI APIs: LanguageDetector and Translator.
  • Toxicity / harmful language warnings while typing
    • Detects potentially toxic or hateful language as users type.
    • Runs client-side using Transformers.js in a Web Worker (keeps the UI responsive).
    • Uses the Xenova/toxic-bert model for classification.
  • Optional submit protection
    • Can disable the comment submit button when toxic content is detected (configurable).

Post-Installation

After enabling the module, configure it from the admin UI and then use it in any place Drupal comments are available.

  1. Go to Admin > Configuration > Content authoring > Browser AI Comments.
  2. Select which toxicity labels should be flagged and set a threshold value.
  3. Customize the warning message shown to commenters.
  4. Optionally enable the setting to disable the submit button while toxic content is detected.

What you’ll see after setup:

  • On comment forms: toxicity warnings can appear live while typing.
  • On comment display pages: a Translate action is available for published comments (browser support required).

Additional Requirements

  • Drupal 11
  • Google Chrome Dev/Canary with experimental Web AI features enabled
  • Secure context: HTTPS or localhost
  • Network access (first run): required to download the toxicity model the first time it runs

Notes: Translation relies on Chrome Web AI APIs (Translator, LanguageDetector). Toxicity detection does not require window.ai.

  • Transformers.js (used for toxicity detection in a Web Worker)
  • Xenova/toxic-bert model (used for toxicity classification)

If your site uses advanced moderation workflows, pairing with Drupal’s moderation tools (core/workflow setups) can complement the warnings, but this module primarily focuses on front-end assistance at comment time.

Similar projects

This module is different from typical server-side translation or moderation modules because it runs AI features in the browser (client-side) using Chrome’s experimental Web AI APIs and an in-browser toxicity model. That means:

  • No server-side translation service is required for the translation feature (but browser support is required).
  • Toxicity detection runs locally in the user’s browser via a Worker, instead of needing a remote API.

How it works

  • Translation uses the LanguageDetector and Translator APIs as shown in the Chrome Web AI playground.
  • Toxicity detection runs Transformers.js inside a Web Worker using the Xenova/toxic-bert model (inspired by toxic review demos).

Chrome setup

  1. Enable AI-related flags in chrome://flags (flag names change frequently).
  2. Restart Chrome and allow any required model downloads.
  3. Confirm the APIs exist in DevTools: Translator and LanguageDetector.

Usage

  1. Enable the module.
  2. Open a comment form or view a published comment.
  3. Use the Translate button or review toxicity warnings while typing.

Activity

Total releases
2
First release
Jan 2026
Latest release
1 month ago
Release cadence
0 days
Stability
50% stable

Releases

Version Type Release date
1.0.0 Stable Jan 15, 2026
1.0.x-dev Dev Jan 15, 2026