Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using DCL.Multiplayer.Connections.DecentralandUrls;
using System;
using UnityEngine;
#if ALTTESTER
using DCL.Diagnostics;
using System.IO;
#endif

namespace DCL.Browser
{
Expand All @@ -15,7 +19,23 @@ public UnityAppWebBrowser(IDecentralandUrlsSource decentralandUrlsSource)

public void OpenUrl(string url)
{
Application.OpenURL(Uri.EscapeUriString(url));
var escaped = Uri.EscapeUriString(url);

#if ALTTESTER
// ALTTESTER builds redirect the auth URL to disk and suppress the system browser
// so cross-stack Playwright tests can drive their own browser to the same target.
try
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Per CLAUDE.md: "Never write multi-line comment blocks — one short line max." This 2-line comment should be compressed to one line.

Suggested change
// so cross-stack Playwright tests can drive their own browser to the same target.
try
// ALTTESTER builds write auth URL to disk and suppress the system browser so Playwright tests can drive their own browser to it.

{
var path = Path.Combine(Application.persistentDataPath, "auth-url.txt");
File.WriteAllText(path, escaped);
}
catch (Exception e)
{
ReportHub.LogException(e, ReportCategory.AUTHENTICATION);
}
#else
Application.OpenURL(escaped);
#endif
}

public void OpenUrl(DecentralandUrl url)
Expand Down
Loading