derpierre65 / BetterStreamChat

5 stars 4 forks source link

"BetterStreamChat" menu option appears where it isn't supposed to #31

Open sn-o-w opened 1 year ago

sn-o-w commented 1 year ago

Describe the bug I see "BetterStreamChat" menu option after I click on a user in the chat.

To Reproduce Click on the 3 dots on any user in any YouTube livestream chat.

Expected behavior "BetterStreamChat" option to appear only after clicking 3 dots at the top of the screen.

Screenshots Screenshot_22

Desktop:

sn-o-w commented 1 year ago

@cyfung1031 Perhaps you have an idea how this could be fixed. 🤔

sn-o-w commented 1 year ago

Having a small icon alongside the text "BetterStreamChat" would be nice. Maybe the extension's icon? It would require two versions (one for dark mode and one for light mode). The current extension's icon should be fine for YouTube's light mode. 🤔

cyfung1031 commented 1 year ago

@cyfung1031 Perhaps you have an idea how this could be fixed. 🤔

3 options

  1. inject a script into the unisolated context (page context) to the check the menu data. if menu data is not the required one, ignore the addition of button
  2. add eventlistener to check whether it is really a click action on that three dots button. ('tap' or 'click')
  3. (the correct way) in unisolated context (page context), change the menu data of yt-live-chat-header-renderer, and monitor data change via _dataChanged

2nd option should be easier to do. detected a tap / click action => add button

I don't have time to do a PR. You can try to implement by yourself.


what's 3rd option

3rd option is the only correct way to do, but it requires high level coding skills and knowledge. don't waste your time to go for it.

Screen Shot 2023-08-24 at 9 26 11

Conclusion:

go for 2nd option. and use setInterval or mutationObserver to hide the button when the menu is hidden.

sn-o-w commented 1 year ago

@cyfung1031 Perhaps you have an idea how this could be fixed. 🤔

3 options

  1. inject a script into the unisolated context (page context) to the check the menu data. if menu data is not the required one, ignore the addition of button
  2. add eventlistener to check whether it is really a click action on that three dots button. ('tap' or 'click')
  3. (the correct way) in unisolated context (page context), change the menu data of yt-live-chat-header-renderer, and monitor data change via _dataChanged

2nd option should be easier to do. detected a tap / click action => add button

I don't have time to do a PR. You can try to implement by yourself.

what's 3rd option

3rd option is the only correct way to do, but it requires high level coding skills and knowledge. don't waste your time to go for it.

Screen Shot 2023-08-24 at 9 26 11

Conclusion:

go for 2nd option. and use setInterval or mutationObserver to hide the button when the menu is hidden.

Have no idea how to implement any of these options. My coding skills aren't that great.

derpierre65 commented 1 year ago

i can check it later, but i am very busy with other projects and work
maybe this weekend