Skip to content
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

Bypass external link dialog for links on the trusted osu! domain #28363

Merged
merged 10 commits into from
May 31, 2024

Conversation

peppy
Copy link
Sponsor Member

@peppy peppy commented May 30, 2024

Kind of addresses #28055 for trusted links at least.

osu.Game/Online/Chat/ExternalLinkOpener.cs Outdated Show resolved Hide resolved
osu.Game/Online/Chat/ExternalLinkOpener.cs Outdated Show resolved Hide resolved
@bdach bdach self-requested a review May 31, 2024 06:05
bdach added 2 commits May 31, 2024 08:09
The `Strings` suffix is not supposed to be in here, judging by other
localisation classes.
osu.Game/OsuGame.cs Outdated Show resolved Hide resolved
@@ -170,6 +173,8 @@ public partial class MenuImage : OsuClickableContainer

private Sprite flash = null!;

public override bool IsPresent => base.IsPresent || Scheduler.HasPendingTasks;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a safety for

openUrlAction = Scheduler.AddDelayed(() =>
{
if (!string.IsNullOrEmpty(Image.Url))
game?.HandleLink(Image.Url);
}, 250);

I will admit I spent over 1 hour making the test for this work. It turned out that online content was replacing the test content in headless only, amongst other issues. I'm not 100% sure this is required, but it feels like it may be for the an edge case where the banner somehow fades out before the delay is reached.

@bdach bdach enabled auto-merge May 31, 2024 06:51
@bdach bdach merged commit b76ec96 into ppy:master May 31, 2024
10 of 11 checks passed
@peppy peppy deleted the external-link-open-trusted branch June 1, 2024 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants