feat(config): add configuration window (#70)

This commit is contained in:
2026-05-21 04:16:21 -07:00
committed by GitHub
parent a54f03f0cd
commit dc52bc2fba
287 changed files with 14507 additions and 8134 deletions
@@ -0,0 +1,36 @@
type ReloadableWebContents = {
isDestroyed?: () => boolean;
reload: () => void;
};
type ReloadableOverlayWindow = {
isDestroyed: () => boolean;
webContents?: ReloadableWebContents;
};
export function reloadOverlayWindowsForYomitanContentScripts(
windows: ReloadableOverlayWindow[],
logWarn?: (message: string, error: unknown) => void,
): number {
let reloadCount = 0;
for (const window of windows) {
if (window.isDestroyed()) {
continue;
}
const webContents = window.webContents;
if (!webContents || webContents.isDestroyed?.()) {
continue;
}
try {
webContents.reload();
reloadCount += 1;
} catch (error) {
logWarn?.('Failed to reload overlay window after Yomitan extension load.', error);
}
}
return reloadCount;
}