mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Add simple messenger to check it Tridactyl is running in a tab
This commit is contained in:
parent
47a3180ff1
commit
110d55119f
2 changed files with 5 additions and 1 deletions
|
@ -48,6 +48,9 @@ messaging.addListener(
|
||||||
messaging.attributeCaller(controller),
|
messaging.attributeCaller(controller),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/require-await
|
||||||
|
messaging.addListener("alive", async () => true)
|
||||||
|
|
||||||
// Hook the keyboard up to the controller
|
// Hook the keyboard up to the controller
|
||||||
import * as ContentController from "@src/content/controller_content"
|
import * as ContentController from "@src/content/controller_content"
|
||||||
import { getAllDocumentFrames } from "@src/lib/dom"
|
import { getAllDocumentFrames } from "@src/lib/dom"
|
||||||
|
|
|
@ -13,6 +13,7 @@ export type TabMessageType =
|
||||||
| "commandline_frame"
|
| "commandline_frame"
|
||||||
| "state"
|
| "state"
|
||||||
| "lock"
|
| "lock"
|
||||||
|
| "alive"
|
||||||
|
|
||||||
export type NonTabMessageType =
|
export type NonTabMessageType =
|
||||||
| "owntab_background"
|
| "owntab_background"
|
||||||
|
@ -140,7 +141,7 @@ export async function messageActiveTab(
|
||||||
export async function messageTab(
|
export async function messageTab(
|
||||||
tabId,
|
tabId,
|
||||||
type: TabMessageType,
|
type: TabMessageType,
|
||||||
command,
|
command?,
|
||||||
args?,
|
args?,
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const message: Message = {
|
const message: Message = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue