mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 02:29:59 +00:00
Message response doesn't need to be in message format
This commit is contained in:
@@ -100,10 +100,7 @@ async function handleMessage (message) {
|
|||||||
case "bridge:/getInfo": {
|
case "bridge:/getInfo": {
|
||||||
const extensionVersion = message.data;
|
const extensionVersion = message.data;
|
||||||
|
|
||||||
return {
|
return __applicationVersion;
|
||||||
subject: "main:/bridgeInfo"
|
|
||||||
, data: __applicationVersion
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
case "bridge:/startDiscovery":
|
case "bridge:/startDiscovery":
|
||||||
|
|||||||
@@ -3,12 +3,10 @@ import semver from "semver";
|
|||||||
export default async function getBridgeInfo () {
|
export default async function getBridgeInfo () {
|
||||||
let applicationVersion;
|
let applicationVersion;
|
||||||
try {
|
try {
|
||||||
const response = await browser.runtime.sendNativeMessage(
|
applicationVersion = await browser.runtime.sendNativeMessage(
|
||||||
APPLICATION_NAME
|
APPLICATION_NAME
|
||||||
, { subject: "bridge:/getInfo"
|
, { subject: "bridge:/getInfo"
|
||||||
, data: EXTENSION_VERSION });
|
, data: EXTENSION_VERSION });
|
||||||
|
|
||||||
applicationVersion = response.data;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user