Remove leading slash from message names

This commit is contained in:
hensm
2021-04-24 04:16:20 +01:00
committed by Matt Hensman
parent e349ce5db7
commit d48efe4840
23 changed files with 207 additions and 192 deletions

View File

@@ -65,7 +65,7 @@ const getInfo = () => new Promise<BridgeInfo>(async (resolve, reject) => {
applicationVersion = await nativeMessaging.sendNativeMessage(
applicationName
, { subject: "bridge:/getInfo"
, { subject: "bridge:getInfo"
, data: version });
} catch (err) {
logger.error("Bridge connection failed.");

View File

@@ -39,7 +39,7 @@ export default async function loadSender (opts: LoadSenderOptions) {
}
shim.contentPort.postMessage({
subject: "shim:/launchApp"
subject: "shim:launchApp"
, data: { receiver: opts.selection.receiver }
});

View File

@@ -3,10 +3,12 @@
import logger from "./logger";
import options from "./options";
import { Message } from "../messaging";
type DisconnectListener = (port: browser.runtime.Port) => void;
type MessageListener = (message: any) => void;
type MessageListener = (message: Message) => void;
function connectNative (application: string) {
/**
@@ -165,7 +167,7 @@ function connectNative (application: string) {
async function sendNativeMessage (
application: string
, message: any) {
, message: Message) {
try {
return await browser.runtime.sendNativeMessage(application, message);