Add bridge debug info to options page

This commit is contained in:
hensm
2018-12-11 23:11:01 +00:00
parent c555d72a0d
commit c24c6412c0
6 changed files with 281 additions and 130 deletions

View File

@@ -340,12 +340,6 @@ function initBridge (tabId, frameId) {
bridgeMap.set(tabId, port);
}
// Start version handoff
port.postMessage({
subject: "bridge:initialize"
, data: EXTENSION_VERSION
});
port.onDisconnect.addListener(p => {
if (p.error) {
console.error(`${APPLICATION_NAME} disconnected:`, p.error.message);
@@ -431,27 +425,6 @@ messageRouter.register("main", async (message, sender) => {
break;
};
case "main:bridgeInitialized": {
const applicationVersion = message.data;
/**
* Compare installed bridge version to the version the
* extension was built alongside and is known to be
* compatible with.
*
* TODO: Determine compatibility with semver and enforce/notify
* user.
*/
if (applicationVersion !== APPLICATION_VERSION) {
console.error(`Expecting ${APPLICATION_NAME} v${APPLICATION_VERSION}, found v${applicationVersion}.`
, semver.lt(applicationVersion, APPLICATION_VERSION)
? "Try updating the native app to the latest version."
: "Try updating the extension to the latest version");
}
break;
};
case "main:openPopup": {
await openPopup(tabId);
break;