Added toggle for "Highlight Mentions"

This commit is contained in:
nutty
2026-05-10 21:11:07 +10:00
parent e32387d906
commit e4761eae79
2 changed files with 12 additions and 3 deletions
+4 -3
View File
@@ -42,6 +42,7 @@ const ignoreChatters = urlParams.get("ignoreChatters") || "";
const scrollDirection = GetIntParam("scrollDirection", 1); const scrollDirection = GetIntParam("scrollDirection", 1);
const groupConsecutiveMessages = GetBooleanParam("groupConsecutiveMessages", false); const groupConsecutiveMessages = GetBooleanParam("groupConsecutiveMessages", false);
const inlineChat = GetBooleanParam("inlineChat", false); const inlineChat = GetBooleanParam("inlineChat", false);
const highlightMentions = GetBooleanParam("highlightMentions", true);
const imageEmbedPermissionLevel = GetIntParam("imageEmbedPermissionLevel", 20); const imageEmbedPermissionLevel = GetIntParam("imageEmbedPermissionLevel", 20);
const showYouTubeLinkPreviews = GetBooleanParam("showYouTubeLinkPreviews", true); const showYouTubeLinkPreviews = GetBooleanParam("showYouTubeLinkPreviews", true);
@@ -672,7 +673,7 @@ async function TwitchChatMessage(data) {
// Highlight mentions // Highlight mentions
const mentionRgx = new RegExp(`(^|\\s)@${twitchUsername}(\\s|$)`, 'i'); const mentionRgx = new RegExp(`(^|\\s)@${twitchUsername}(\\s|$)`, 'i');
const mention = mentionRgx.test(data.text); const mention = mentionRgx.test(data.text);
if (mention && showMessage) if (mention && highlightMentions && showMessage)
messageContainerDiv.classList.add("highlightMessage"); messageContainerDiv.classList.add("highlightMessage");
// Set furry mode // Set furry mode
@@ -1371,7 +1372,7 @@ async function YouTubeMessage(data) {
// Highlight mentions // Highlight mentions
const mentionRgx = new RegExp(`(^|\\s)@${youtubeUsername}(\\s|$)`, 'i'); const mentionRgx = new RegExp(`(^|\\s)@${youtubeUsername}(\\s|$)`, 'i');
const mention = mentionRgx.test(message); const mention = mentionRgx.test(message);
if (mention && showMessage) if (mention && highlightMentions && showMessage)
messageContainerDiv.classList.add("highlightMessage"); messageContainerDiv.classList.add("highlightMessage");
// Set furry mode // Set furry mode
@@ -2348,7 +2349,7 @@ async function KickChatMessage(data) {
// Highlight mentions // Highlight mentions
const mentionRgx = new RegExp(`(^|\\s)@${kickUsername}(\\s|$)`, 'i'); const mentionRgx = new RegExp(`(^|\\s)@${kickUsername}(\\s|$)`, 'i');
const mention = mentionRgx.test(message); const mention = mentionRgx.test(message);
if (mention && showMessage) if (mention && highlightMentions && showMessage)
messageContainerDiv.classList.add("highlightMessage"); messageContainerDiv.classList.add("highlightMessage");
// Set furry mode // Set furry mode
+8
View File
@@ -192,6 +192,14 @@
"defaultValue": false, "defaultValue": false,
"group": "General" "group": "General"
}, },
{
"id": "highlightMentions",
"label": "Highlight Mentions",
"description": "Highlight messages that mention the streamer",
"type": "checkbox",
"defaultValue": true,
"group": "General"
},
{ {
"id": "imageEmbedPermissionLevel", "id": "imageEmbedPermissionLevel",
"label": "Embed Images", "label": "Embed Images",