-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement rudimentary redirect banner #155
Conversation
eb1fa02
to
e658b7c
Compare
Supports send and receive, uses the urlEndpoint or watchEndpoint link to open a new tab with the given url if the button is clicked This also adds support for bold text (but not deemphasized text yet) to MessageRun This does not implement contextMenuButton at all yet, only inlineActionButton.
e658b7c
to
e81381a
Compare
const url = baseRenderer.inlineActionButton?.buttonRenderer.command.urlEndpoint?.url || | ||
(baseRenderer.inlineActionButton?.buttonRenderer.command.watchEndpoint?.videoId ? | ||
"/watch?v=" + baseRenderer.inlineActionButton?.buttonRenderer.command.watchEndpoint?.videoId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This handling should probably be cleaned up at some point.
code looks good, but how should i actually test this without catching a redirect by sheer luck? how did u test it? |
This is fully tested, at this point. I also lucked out today in that 2 different people raided someone, and the new redirect banner overwrote the old one, so that's confirmed to work as well. I believe Svelte's reactive statements means that any time the 'redirect' object gets swapped out for a new redirect, it un-collapses and starts a new timer too. Prior to that, during initial implementation/testing, I grabbed some actual data and mocked it in via one of these two in
Other considerations from stock YT behavior that could affect what order we show these in: Since all of these only collapse instead of disappear under this Hyperchat impl, I'm not sure what order to put them in. |
order probably isn't too big of a deal tbh |
@FlaminSarge lmk if ur happy with the small tweaks i made, if it's all good with u ima merge |
Now that the button has moved: Also the mock data doesn't really seem necessary to keep in. Trying to figure out if there's a good way to tell if YT's format changes, for which we should refuse to render anything for this to avoid breakage. |
oh perchance that's a good idea, if u could fix that up that'd be great and ill merge |
how does this look? with/without the profile icons enabled
|
checking over now |
yep seems to work and looks good to me! tyty |
Supports send and receive, uses the urlEndpoint or watchEndpoint link to open a new tab with the given url if the button is clicked
This also adds support for bold text (but not deemphasized text yet) to MessageRun
This does not implement contextMenuButton at all yet, only inlineActionButton.
Has the same auto-collapse behavior as other banner messages.
Built on top of #156
Very hacky URL handling and button handling at the moment.
"Redirect Notice" is added to the header because it looks a bit silly without anything there.
"Redirect profile photo" is set as the alt text for the image since the author's actual name is only available elsewhere and it would be too hacky to try to grab it.
Tested on mv3 w/ chrome