mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-22 12:11:27 -07:00
Add read-only external Yomitan profile support
- add `yomitan.externalProfilePath` config and default/template wiring - load Yomitan from an external Electron profile/session when configured - disable SubMiner Yomitan writes/settings UI in external-profile mode and update docs/tests
This commit is contained in:
@@ -58,3 +58,16 @@ export function resolveYomitanExtensionPath(
|
||||
): string | null {
|
||||
return resolveExistingYomitanExtensionPath(getYomitanExtensionSearchPaths(options), existsSync);
|
||||
}
|
||||
|
||||
export function resolveExternalYomitanExtensionPath(
|
||||
externalProfilePath: string,
|
||||
existsSync: (path: string) => boolean = fs.existsSync,
|
||||
): string | null {
|
||||
const normalizedProfilePath = externalProfilePath.trim();
|
||||
if (!normalizedProfilePath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const candidate = path.join(path.resolve(normalizedProfilePath), 'extensions', 'yomitan');
|
||||
return existsSync(path.join(candidate, 'manifest.json')) ? candidate : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user