Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

---

## [1.7.3] - 2026-05-18

### Added
- **URL redaction** — any `http://`, `https://`, or `www.` link in a message is replaced with "URL posted" before being spoken. The full URL is never read aloud.

---

## [1.7.2] - 2026-05-18

### Fixed
Expand Down Expand Up @@ -145,6 +152,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

---

[1.7.3]: https://github.com/sbcmsbgithub/message-reader/releases/tag/v1.7.3
[1.7.2]: https://github.com/sbcmsbgithub/message-reader/releases/tag/v1.7.2
[1.7.1]: https://github.com/sbcmsbgithub/message-reader/releases/tag/v1.7.1
[1.7.0]: https://github.com/sbcmsbgithub/message-reader/releases/tag/v1.7.0
Expand Down
6 changes: 4 additions & 2 deletions message-reader.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Message Reader
// @namespace https://github.com/sbcmsbgithub/message-reader
// @version 1.7.2
// @version 1.7.3
// @description Reads chat messages aloud on configured sites. Pick any element as the watched container. Includes playback controls, ignore list, voice/rate/volume settings, and time/first-name options.
// @match *://*/*
// @grant none
Expand Down Expand Up @@ -215,6 +215,8 @@
// Strips a bare time (with or without AM/PM) anchored to the very start of a string —
// used as a safety-net pass after the main timestamp stripping.
const TS_LEADING = /^\[?\d{1,2}:\d{2}(?::\d{2})?\s*(?:AM|PM)?\]?\s*/i;
// Matches http/https URLs and bare www. links — replaced with "URL posted" before speaking.
const URL_RE = /https?:\/\/\S+|www\.\S+/gi;

function getMessageRoot(node) {
if (!(node instanceof HTMLElement)) return null;
Expand Down Expand Up @@ -423,7 +425,7 @@
if (config.announceTime && msg.timeText) parts.push(msg.timeText);
if (config.readSender && msg.sender) parts.push(msg.sender + ':');
parts.push(msg.body);
const spoken = parts.join(' ').trim();
const spoken = parts.join(' ').replace(URL_RE, 'URL posted').replace(/\s+/g, ' ').trim();

LOG('NEW →', spoken);
enqueueSpeak(spoken);
Expand Down