Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ![compakt](chrome/assets/icon_128.png) Twitch compakt
# ![compakt](assets/icon_128.png) Twitch compakt
Twitch Chat streamlining.

Compress long messages and condense repeated messages.
Expand Down
19 changes: 10 additions & 9 deletions chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,23 @@

"content_scripts": [
{
"matches": ["https://www.twitch.tv/*"],
"matches": ["https://go.twitch.tv/*"],
"js": [
"jquery.min.js",
"compakt.js"
],
"css": [
"compaktstyles.css"
],
"exclude_globs": ["https://www.twitch.tv/directory/*",
"https://www.twitch.tv/p/*",
"https://www.twitch.tv/products/*",
"https://www.twitch.tv/*/manager*",
"https://www.twitch.tv/*/dashboard",
"https://www.twitch.tv/broadcast",
"https://www.twitch.tv/messages/*",
"https://www.twitch.tv/settings"
"exclude_globs": [
"https://go.twitch.tv/directory/*",
"https://go.twitch.tv/p/*",
"https://go.twitch.tv/products/*",
"https://go.twitch.tv/*/manager*",
"https://go.twitch.tv/*/dashboard",
"https://go.twitch.tv/broadcast",
"https://go.twitch.tv/messages/*",
"https://go.twitch.tv/settings"
],
"run_at": "document_end"
}
Expand Down
2 changes: 1 addition & 1 deletion src/compakt.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function Compakt(cache_size) {
mutation.addedNodes.forEach(function (addedNode) {
// At this point it's potentially a chatMessage object.
var chatMessage = $(addedNode);
if (!chatMessage.is(twitch.chatMsg1Selector, twitch.chatMsg2Selector)) {
if (!chatMessage.is(twitch.chatMsg1Selector)) {
// this isn't a chat message, skip processing.
return;
}
Expand Down
10 changes: 4 additions & 6 deletions src/twitchvars.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// These are variables for Twitch elements related to chat.
// We expose them here so changes can be easily made if Twitch changes them.
twitchChatUlClassName = "chat-lines";
twitchChatUlSelector = ".chat-lines";
twitchChatMessage1Selector = ".message-line";
twitchChatMessage2Selector = ".chat-line";
twitchChatMessageContent = ".message";
twitchChatUlClass = ".chat-list__lines .simplebar-scroll-content .simplebar-content .full-height";
twitchChatMessageClass1 = ".chat-line__message";
twitchChatMessageContent = "span:nth-child(4)";

module.exports.chatULClassName = twitchChatUlClassName;
module.exports.chatULSelector = twitchChatUlSelector;
module.exports.chatMsg1Selector = twitchChatMessage1Selector;
module.exports.chatMsg2Selector = twitchChatMessage2Selector;
module.exports.chatMsgContent = twitchChatMessageContent;
module.exports.chatMsgContent = twitchChatMessageContent;