Add simple messenger to check it Tridactyl is running in a tab

This commit is contained in:
Oliver Blanthorn 2020-07-04 18:29:43 +01:00
parent 47a3180ff1
commit 110d55119f
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
2 changed files with 5 additions and 1 deletions

View file

@ -48,6 +48,9 @@ messaging.addListener(
messaging.attributeCaller(controller),
)
// eslint-disable-next-line @typescript-eslint/require-await
messaging.addListener("alive", async () => true)
// Hook the keyboard up to the controller
import * as ContentController from "@src/content/controller_content"
import { getAllDocumentFrames } from "@src/lib/dom"

View file

@ -13,6 +13,7 @@ export type TabMessageType =
| "commandline_frame"
| "state"
| "lock"
| "alive"
export type NonTabMessageType =
| "owntab_background"
@ -140,7 +141,7 @@ export async function messageActiveTab(
export async function messageTab(
tabId,
type: TabMessageType,
command,
command?,
args?,
): Promise<any> {
const message: Message = {