From 1c4ea56865c0f2d6e0a6e26847ffc0f7a575994e Mon Sep 17 00:00:00 2001 From: a Date: Wed, 12 Aug 2020 00:23:14 +0200 Subject: [PATCH] Minor refactoring --- src/background/gtranslate_content_script.ts | 3 --- src/frontend/content_script/content_script.ts | 5 ----- src/types.d.ts | 4 ++++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/background/gtranslate_content_script.ts b/src/background/gtranslate_content_script.ts index a7aaf5e..0a771e6 100644 --- a/src/background/gtranslate_content_script.ts +++ b/src/background/gtranslate_content_script.ts @@ -1,7 +1,4 @@ import { browser } from "webextension-polyfill-ts"; -declare interface Window { - hasRun: boolean; -} (async () => { if (window.location.host != "translate.google.com" || window.hasRun) return; diff --git a/src/frontend/content_script/content_script.ts b/src/frontend/content_script/content_script.ts index ea1f605..ff714f5 100644 --- a/src/frontend/content_script/content_script.ts +++ b/src/frontend/content_script/content_script.ts @@ -4,11 +4,6 @@ import App from "./Translate.svelte"; import "tippy.js/dist/tippy.css"; import "./tippy.scss"; -declare global { - interface Window { - hasRun: any; - } -} (() => { //Make sure our script only runs once if (window.hasRun) return; diff --git a/src/types.d.ts b/src/types.d.ts index e1ec848..067ece3 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -15,3 +15,7 @@ declare interface Flashcard { dateAdded: Date; exported: boolean; } + +declare interface Window { + hasRun: any; +}