mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 09:39:58 +00:00
Remove leading slash from message names
This commit is contained in:
@@ -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.");
|
||||
|
||||
@@ -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 }
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user