Message response doesn't need to be in message format

This commit is contained in:
hensm
2019-02-24 17:33:13 +00:00
parent 41280031bf
commit db7edb70bb
2 changed files with 2 additions and 7 deletions

View File

@@ -100,10 +100,7 @@ async function handleMessage (message) {
case "bridge:/getInfo": {
const extensionVersion = message.data;
return {
subject: "main:/bridgeInfo"
, data: __applicationVersion
};
return __applicationVersion;
};
case "bridge:/startDiscovery":

View File

@@ -3,12 +3,10 @@ import semver from "semver";
export default async function getBridgeInfo () {
let applicationVersion;
try {
const response = await browser.runtime.sendNativeMessage(
applicationVersion = await browser.runtime.sendNativeMessage(
APPLICATION_NAME
, { subject: "bridge:/getInfo"
, data: EXTENSION_VERSION });
applicationVersion = response.data;
} catch (err) {
return null;
}