Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module enhances the Drupal comment system by offering AI-powered features directly in the browser. It allows users to translate comments as they write or read them, and warns commenters about potentially toxic language before they submit their posts, improving community interaction and moderation.

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
6 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Slowing

Releases

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