initial pwa + custom tabs

This commit is contained in:
Fabian Freund
2026-02-10 16:20:54 +01:00
parent 592c6afdc5
commit 188dfdd003
47 changed files with 3974 additions and 130 deletions
+24
View File
@@ -75,6 +75,20 @@ Future<void> clearMozillaProfileCache(String profileId) async {
}
}
/// Returns the list of Mozilla profile IDs (`.default` directory names)
/// inside the given profile directory's `mozilla/` subdirectory.
List<String> getMozillaProfileIds(Directory profileDir) {
final mozillaDir = Directory(p.join(profileDir.path, 'mozilla'));
if (!mozillaDir.existsSync()) return [];
return mozillaDir
.listSync()
.whereType<Directory>()
.map((dir) => p.basename(dir.path))
.where((name) => name.endsWith('.default'))
.toList();
}
Future<List<Directory>> getProfilesWithDuplicateMozillaProfiles(
Directory profilesDir,
) async {
@@ -122,6 +136,16 @@ Future<UuidValue?> selectStartupProfile(Directory profilesDir) async {
var startupProfile = await readStartupProfile(profilesDir);
final availableProfiles = await getAvailableProfileDirectories(profilesDir);
// Verify the startup profile directory actually exists
if (startupProfile != null) {
final profileDir = getProfileDir(profilesDir, startupProfile);
final exists = availableProfiles.any((dir) => dir.path == profileDir.path);
if (!exists) {
logger.w('Startup profile directory missing, selecting fallback');
startupProfile = null;
}
}
if (startupProfile == null) {
final sortedDirs = await sortByAccessTime(availableProfiles);