tmarenko / twitch_chat_antiban

This extension automatically opens a proxy chat to channels where you are banned.
Apache License 2.0
24 stars 7 forks source link

Addon connecting and disconnecting repeatedly on twitchtheater.tv (bug)? #17

Closed kurtdh closed 1 year ago

tmarenko commented 1 year ago

Shouldn't be related to twitchtheater.tv as it simply opens an iframe to the actual twitch chat. Does this issue occur frequently (every 5-10 seconds) or just periodically (every 5-10 minutes or so)? The problem likely is a bad connection to the Twitch chat IRC websocket. This could be due to a slow wifi/internet connection on your end or server issues on twitch's side.

kurtdh commented 1 year ago

It happens every couple of minutes it seems. I know it's not on my end. I use wired 1 gig ethernet with a ping window running the entire time with no packet loss. So it has to be Twitch side. If you can't figure it out, is it possible to do a workaround of only allowing the message to show once every hour or so? At least that way it won't be spamming us.

tmarenko commented 1 year ago

Not much can be done from extension side if the connection is unstable. I could suppress "Disconnected ... Connected" messages if reconnection happens quickly. So at least it won't be an eyesore in the chat

tmarenko commented 1 year ago

Added the change at other branch: https://github.com/tmarenko/twitch_chat_antiban/compare/master...supress-reconnection-logs @kurtdh if you could please test the extension:

- src-2.11.zip

You can just drag & drop the archive to Extension tab. Don't forget to disable 2.10 extension from Chrome Store before testing this one. I've added 5 sec timeout threshold for reconnection. So on quick reconnects it won't spam logs in the chat Found the root cause: https://github.com/tmarenko/twitch_chat_antiban/issues/17#issuecomment-1712507955

tmarenko commented 1 year ago

It also seems that I'm not properly handling keepalive messages, which is probably the reason why twitch disconnects the client. This portion of the code never runs because the command is parsed incorrectly: https://github.com/tmarenko/twitch_chat_antiban/blob/c4001c1e389c243c65fe5989b365e97df6b5afa5/src/proxy-chat.js#L273-L274

tmarenko commented 1 year ago

Fix is merged and released. Please update to 2.11 version

kurtdh commented 1 year ago

Ok please leave issue open until I confirm fixed. Thanks.

kurtdh commented 1 year ago

Now the addon doesn't work at all on twitchtheater.tv. It just says "You are banned from Chat" and doesn't create any iframe.

tmarenko commented 1 year ago

Strangely, works for me on twitchtheater.tv. I also haven't changed any parts that are related to ban recognition. Please double check that the extension is enabled and working. Maybe there is some info in the browser dev console (F12)?

kurtdh commented 1 year ago

I figured it out. I had to go into addon settings for your addon, click permissions, and turn on the slider next to access your data for sites in the *://twitch.tv domain. This fixed it for both twitch.tv and twitchtheater.tv

Maybe you should update the text "This extension automatically opens a proxy chat to channels where you are banned." because it's not automatic without turning on that slider first..

tmarenko commented 1 year ago

It is automatic for twitch: https://github.com/tmarenko/twitch_chat_antiban/blob/3350d02abc7c085f7c32fe6e4e64f991e49297c0/src/manifest.json#L14 My guess is that you're using Firefox since it doesn't inject content scripts everywhere (even with all_frames": true) and the user also must manually confirm the permissions: https://discourse.mozilla.org/t/are-content-scripts-not-automatically-injected-anymore-with-manifest-v3/108146/2

image

Works well on Chrome without any additional settings.

I don't think that I want to add instructions for users of how to use their browser properly. But maybe just for Firefox I could downgrade manifest version to 2 (since they still support it for some reason)

kurtdh commented 1 year ago

Yep, using Firefox. I didn't have this issue prior to this version though, so that's weird.

tmarenko commented 1 year ago

Switched to V2 for Firefox: https://github.com/tmarenko/twitch_chat_antiban/commit/9efce137ece89819d52b67884cffda6d77a076e8 Released as 2.11.1 version: https://addons.mozilla.org/en-US/firefox/addon/twitch-chat-anti-ban/versions/

kurtdh commented 1 year ago

Original issue seems fixed, it no longer spams. Closing issue now.