From fdff7685492bb40c8b6721b2290d9d5a8cc7ceb2 Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Wed, 22 Aug 2018 13:39:43 -0400 Subject: [PATCH] handle onDisconnect --- app/vendor/trezor/content-script.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/vendor/trezor/content-script.js b/app/vendor/trezor/content-script.js index c8888c1b6..a21332f46 100644 --- a/app/vendor/trezor/content-script.js +++ b/app/vendor/trezor/content-script.js @@ -6,6 +6,10 @@ let port = chrome.runtime.connect({ name: 'trezor-connect' }); port.onMessage.addListener(message => { window.postMessage(message, window.location.origin); }); +port.onDisconnect.addListener(d => { + port = null; +}); + /* Passing messages from popup to background script */