Extension icon indicating copy to clipboard operation
Extension copied to clipboard

Fix rendering of 3rd party emotes in : autocomplete tray

Open Excellify opened this issue 3 years ago • 8 comments

Twitch recently changed how they render the emotes in the autocomplete tray. The renderEmoteSuggestion is no longer called, so we need to override the srcSet elsewhere. Seems to be working when overriding the getMatches.

Excellify avatar May 28 '22 00:05 Excellify

This appears to remove the provider indicators in colon completion. (Perhaps because the code block which handled this has been removed for some reason?)

The best solution i could find was editing the srcSet in the getMatches function. And there i only had access to the react element. I dont know what the provider indicators are supposed to do, but couldnt find anything to "update" in the element accordingly.

    current: ":4Hea"
    element: Array(2)
        0: {$$typeof: Symbol(react.element), type: {…}, key: 'emote-img-354', ref: null, props: {…}, …}
        1: {$$typeof: Symbol(react.element), type: {…}, key: 'emote-text-354', ref: null, props: {…}, …}
        length: 2
        [[Prototype]]: Array(0)
    replacement: "4Head"
    type: "emote"

Excellify avatar May 29 '22 12:05 Excellify

It added information about where any given emote came from, i.e Kappa (Twitch Global) or GIGACHAD (Channel 7TV)

AnatoleAM avatar May 29 '22 12:05 AnatoleAM

It added information about where any given emote came from, i.e Kappa (Twitch Global) or GIGACHAD (Channel 7TV)

Does twitch do that by default? We could alternatively just add edit the displayed text

Excellify avatar May 29 '22 12:05 Excellify

It added information about where any given emote came from, i.e Kappa (Twitch Global) or GIGACHAD (Channel 7TV)

Does twitch do that by default?

No. This is something I added, you can see it in the code block you removed in this PR

AnatoleAM avatar May 29 '22 12:05 AnatoleAM

It added information about where any given emote came from, i.e Kappa (Twitch Global) or GIGACHAD (Channel 7TV)

Does twitch do that by default? We could alternatively just add edit the displayed text

Seems like provider isnt available in the scope of this function making it difficult to add it to the name. We could get the id and then find it by iteration over all of the emote sets, but dont think that would be a good solution

Excellify avatar May 29 '22 12:05 Excellify

It added information about where any given emote came from, i.e Kappa (Twitch Global) or GIGACHAD (Channel 7TV)

Does twitch do that by default? We could alternatively just add edit the displayed text

Seems like provider isnt available in the scope of this function

That's because it was added to the emote objects. Remember all objects in JavaScript are pointers.

AnatoleAM avatar May 29 '22 17:05 AnatoleAM

It added information about where any given emote came from, i.e Kappa (Twitch Global) or GIGACHAD (Channel 7TV)

Does twitch do that by default? We could alternatively just add edit the displayed text

Seems like provider isnt available in the scope of this function

That's because it was added to the emote objects. Remember all objects in JavaScript are pointers.

Yea, was just stating that we dont have access the provider of the emote element that is returned to us. So that we'd have to resolve the emote again from using the id if we want to find the provider.

Excellify avatar May 30 '22 12:05 Excellify

It added information about where any given emote came from, i.e Kappa (Twitch Global) or GIGACHAD (Channel 7TV)

Does twitch do that by default? We could alternatively just add edit the displayed text

Seems like provider isnt available in the scope of this function

That's because it was added to the emote objects. Remember all objects in JavaScript are pointers.

Yea, was just stating that we dont have access the provider of the emote element that is returned to us. So that we'd have to resolve the emote again from using the id if we want to find the provider.

Oh, so Twitch changed something. Then yeah I guess that's the only way to reinstate this feature

AnatoleAM avatar May 30 '22 12:05 AnatoleAM