From 9209f1fe6acca9a4b9c210301e1fe1e4ad816da4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Sep 2026 00:29:43 +0000 Subject: [PATCH 1/2] Initial plan From c7633191d41e8a1e278d73cb995897179137502f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Sep 2026 00:32:04 +0000 Subject: [PATCH 2/2] Fix Firefox profiles.ini parsing for LF line endings Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> --- Flow.Launcher.Test/Flow.Launcher.Test.csproj | 1 + .../Plugins/BrowserBookmarkPluginTest.cs | 55 +++++++++++++++++++ .../FirefoxBookmarkLoader.cs | 5 +- 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 Flow.Launcher.Test/Plugins/BrowserBookmarkPluginTest.cs diff --git a/Flow.Launcher.Test/Flow.Launcher.Test.csproj b/Flow.Launcher.Test/Flow.Launcher.Test.csproj index 4d994de049c..95c120744d7 100644 --- a/Flow.Launcher.Test/Flow.Launcher.Test.csproj +++ b/Flow.Launcher.Test/Flow.Launcher.Test.csproj @@ -45,6 +45,7 @@ + diff --git a/Flow.Launcher.Test/Plugins/BrowserBookmarkPluginTest.cs b/Flow.Launcher.Test/Plugins/BrowserBookmarkPluginTest.cs new file mode 100644 index 00000000000..39833372e34 --- /dev/null +++ b/Flow.Launcher.Test/Plugins/BrowserBookmarkPluginTest.cs @@ -0,0 +1,55 @@ +using System; +using System.IO; +using System.Reflection; +using Flow.Launcher.Plugin.BrowserBookmark; +using NUnit.Framework; + +namespace Flow.Launcher.Test.Plugins +{ + [TestFixture] + public class BrowserBookmarkPluginTest + { + [TestCase("\n")] + [TestCase("\r\n")] + public void GetProfileIniPath_ParsesDefaultProfileWithDifferentLineEndings(string newline) + { + var tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(tempDir); + + try + { + var profileRoot = Path.Combine(tempDir, "Mozilla", "Firefox"); + Directory.CreateDirectory(profileRoot); + + var defaultProfile = "Profiles/7789f565.default-release"; + var lines = new[] + { + "[Install736426B0AF4A39CB]", + $"Default={defaultProfile}", + "Locked=1", + string.Empty, + "[Profile0]", + "Name=default-release", + "IsRelative=1", + $"Path={defaultProfile}" + }; + + File.WriteAllText(Path.Combine(profileRoot, "profiles.ini"), string.Join(newline, lines)); + + var method = typeof(FirefoxBookmarkLoader).GetMethod("GetProfileIniPath", + BindingFlags.NonPublic | BindingFlags.Static); + Assert.That(method, Is.Not.Null); + + var path = method.Invoke(null, new object[] { profileRoot }) as string; + var expected = Path.Combine(profileRoot, defaultProfile, "places.sqlite"); + + Assert.That(path, Is.EqualTo(expected)); + } + finally + { + if (Directory.Exists(tempDir)) + Directory.Delete(tempDir, true); + } + } + } +} diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs index be83f61584f..0c434d38474 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs @@ -267,10 +267,7 @@ private static string GetProfileIniPath(string profileFolderPath) return string.Empty; // get firefox default profile directory from profiles.ini - using var sReader = new StreamReader(profileIni); - var ini = sReader.ReadToEnd(); - - var lines = ini.Split("\r\n").ToList(); + var lines = File.ReadAllLines(profileIni).ToList(); var defaultProfileFolderNameRaw = lines.FirstOrDefault(x => x.Contains("Default=") && x != "Default=1") ?? string.Empty;