1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

Merge branch 'master' of github.com:gorhill/uBlock into shadow

This commit is contained in:
gorhill 2015-07-06 09:08:07 -04:00
commit 96a254091b

View File

@ -585,7 +585,7 @@ vAPI.messaging.onPortMessage = (function() {
}; };
var toAux = function(details, portFrom) { var toAux = function(details, portFrom) {
var portTo; var port, portTo;
var chromiumTabId = toChromiumTabId(details.toTabId); var chromiumTabId = toChromiumTabId(details.toTabId);
// TODO: This could be an issue with a lot of tabs: easy to address // TODO: This could be an issue with a lot of tabs: easy to address
@ -594,8 +594,11 @@ vAPI.messaging.onPortMessage = (function() {
if ( messaging.ports.hasOwnProperty(portName) === false ) { if ( messaging.ports.hasOwnProperty(portName) === false ) {
continue; continue;
} }
if ( messaging.ports[portName].sender.tab.id === chromiumTabId ) { // When sending to an auxiliary process, the target is always the
portTo = messaging.ports[portName]; // port associated with the root frame.
port = messaging.ports[portName];
if ( port.sender.frameId === 0 && port.sender.tab.id === chromiumTabId ) {
portTo = port;
break; break;
} }
} }