diff --git a/src/common/js/ChromeShittinessMitigations.js b/src/common/js/ChromeShittinessMitigations.ts similarity index 100% rename from src/common/js/ChromeShittinessMitigations.js rename to src/common/js/ChromeShittinessMitigations.ts diff --git a/src/common/js/IO.js b/src/common/js/IO.ts similarity index 100% rename from src/common/js/IO.js rename to src/common/js/IO.ts diff --git a/src/common/js/KeyboardShortcutParser.js b/src/common/js/KeyboardShortcutParser.ts similarity index 100% rename from src/common/js/KeyboardShortcutParser.js rename to src/common/js/KeyboardShortcutParser.ts diff --git a/src/common/js/utils.js b/src/common/js/utils.js deleted file mode 100644 index 51b48a3..0000000 --- a/src/common/js/utils.js +++ /dev/null @@ -1,3 +0,0 @@ -export async function sleep(timeout) { - return new Promise( (resolve, reject) => setTimeout(() => resolve(), timeout)); -} diff --git a/src/common/js/utils.ts b/src/common/js/utils.ts new file mode 100644 index 0000000..990473b --- /dev/null +++ b/src/common/js/utils.ts @@ -0,0 +1,3 @@ +export async function sleep(timeout) { + return new Promise( (resolve, reject) => setTimeout(() => resolve(), timeout)); +} diff --git a/src/popup/js/ExecAction.js b/src/popup/js/ExecAction.ts similarity index 90% rename from src/popup/js/ExecAction.js rename to src/popup/js/ExecAction.ts index 6baf140..3b5f31f 100644 --- a/src/popup/js/ExecAction.js +++ b/src/popup/js/ExecAction.ts @@ -1,6 +1,10 @@ -import Comms from '../../ext/lib/comms/Comms'; +import { browser } from '../../../node_modules/webextension-polyfill-ts/lib/index'; +import Settings from '../../ext/lib/Settings'; class ExecAction { + settings: Settings; + site: any; + constructor(settings, site) { this.settings = settings; this.site = site; @@ -24,7 +28,7 @@ class ExecAction { arg: cmd.arg, customArg: cmd.customArg } - Comms.sendMessage(message); + browser.runtime.sendMessage(message); } else { // set-ar-persistence sends stuff to content scripts as well (!) @@ -41,7 +45,7 @@ class ExecAction { } // this hopefully delays settings.save() until current crops are saved on the site // and thus avoid any fucky-wuckies - await Comms.sendMessage(message); + await browser.runtime.sendMessage(message); } let site = this.site;