mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-09-30 00:56:32 +13:00
Remove unnecessary messaging workaround
A better fix was introduced in e36c702 for this issue. The actual problem was that Safari when sends a message from the background to content, then it passes to all the frames in the target tab, but it doesn't make copies, it passes only references to the same object, so if one frame modifies the message, then other frames would have received the modified message.
This commit is contained in:
parent
aebfb15aa2
commit
8f0172467a
1 changed files with 2 additions and 8 deletions
|
@ -29,6 +29,8 @@ var messagingConnector = function(response) {
|
|||
|
||||
if (response.requestId) {
|
||||
listener = vAPI.messaging.listeners[response.requestId];
|
||||
delete vAPI.messaging.listeners[response.requestId];
|
||||
delete response.requestId;
|
||||
}
|
||||
|
||||
if (!listener) {
|
||||
|
@ -37,14 +39,6 @@ var messagingConnector = function(response) {
|
|||
}
|
||||
|
||||
if (typeof listener === 'function') {
|
||||
// Safari bug
|
||||
// Deleting the response.requestId below (only in some cases, probably
|
||||
// when frames are present on the page) will remove it from all the
|
||||
// future messages too, however with the following line it won't.
|
||||
vAPI.safari && console.log;
|
||||
|
||||
delete vAPI.messaging.listeners[response.requestId];
|
||||
delete response.requestId;
|
||||
listener(response.msg);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue