aboutsummaryrefslogtreecommitdiff
path: root/src/background/Application.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/Application.ts')
-rw-r--r--src/background/Application.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/background/Application.ts b/src/background/Application.ts
index 69fe4a4..2006965 100644
--- a/src/background/Application.ts
+++ b/src/background/Application.ts
@@ -3,6 +3,7 @@ import ContentMessageListener from "./infrastructures/ContentMessageListener";
import SettingController from "./controllers/SettingController";
import VersionController from "./controllers/VersionController";
import SettingRepository from "./repositories/SettingRepository";
+import FindRepositoryImpl from "./repositories/FindRepository";
@injectable()
export default class Application {
@@ -11,12 +12,19 @@ export default class Application {
private settingController: SettingController,
private versionController: VersionController,
@inject("SyncSettingRepository")
- private syncSettingRepository: SettingRepository
+ private syncSettingRepository: SettingRepository,
+ @inject("FindRepository")
+ private readonly findRepository: FindRepositoryImpl
) {}
run() {
this.settingController.reload();
+ browser.tabs.onUpdated.addListener((tabId: number, info) => {
+ if (info.status == "loading") {
+ this.findRepository.deleteLocalState(tabId);
+ }
+ });
browser.runtime.onInstalled.addListener((details) => {
if (details.reason !== "install" && details.reason !== "update") {
return;