Skip to content

Commit

Permalink
fix dump pages path error again
Browse files Browse the repository at this point in the history
  • Loading branch information
PhantomGamers committed Apr 26, 2024
1 parent 0688a67 commit 211d405
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SFP/Models/Injection/Injector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ public static partial class Injector

private static string PreferredColorScheme { get; set; } = "light";

public static string[] ColorNames { get; } = new[]
{
public static string[] ColorNames { get; } =
[
"SystemAccentColor",
"SystemAccentColorLight1",
"SystemAccentColorLight2",
"SystemAccentColorLight3",
"SystemAccentColorDark1",
"SystemAccentColorDark2",
"SystemAccentColorDark3"
};
];

public static string ColorsCss { get; private set; } = string.Empty;

Expand Down Expand Up @@ -288,7 +288,7 @@ private static async Task ProcessFrame(Frame frame)
await DumpFrame(frame, url);
if (!config._isFromMillennium)
{
var httpPatches = patches.Where(p => p.MatchRegexString.ToLower().StartsWith("http"));
var httpPatches = patches.Where(p => p.MatchRegexString.StartsWith("http", StringComparison.CurrentCultureIgnoreCase));
var patchEntries = httpPatches as PatchEntry[] ?? httpPatches.ToArray();
var patch = patchEntries.FirstOrDefault(p => p.MatchRegex.IsMatch(frame.Url));
if (patch != null)
Expand Down Expand Up @@ -318,9 +318,9 @@ private static async Task DumpFrame(Frame frame, string? fileName)
}
try
{
Directory.CreateDirectory("dumps");
var content = await frame.GetContentAsync();
var dumpsPath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "dumps");
Directory.CreateDirectory(dumpsPath);
await File.WriteAllTextAsync(Path.Join(dumpsPath, fileName + ".html"), content);
}
catch (PuppeteerException e)
Expand Down

0 comments on commit 211d405

Please sign in to comment.