From a087190847347b093949b6485cc115e14e1650a1 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 29 Nov 2014 01:00:45 -0200 Subject: [PATCH] code review, fixes #383 --- platform/chromium/vapi-background.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 890af5454..22e6e8d9f 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -251,7 +251,7 @@ vAPI.messaging.onPortMessage = function(request, port) { if ( request.requestId !== undefined ) { callback = function(response) { // https://github.com/gorhill/uBlock/issues/383 - if ( port.disconnected === true ) { + if ( vAPI.messaging.ports.hasOwnProperty(port.name) === false ) { return; } port.postMessage({ @@ -292,8 +292,6 @@ vAPI.messaging.onPortDisconnect = function(port) { port.onDisconnect.removeListener(vAPI.messaging.onPortDisconnect); port.onMessage.removeListener(vAPI.messaging.onPortMessage); delete vAPI.messaging.ports[port.name]; - // https://github.com/gorhill/uBlock/issues/383 - port.disconnected = true; }; /******************************************************************************/