mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-06-01 18:10:17 +12:00
Firefox: behind-the-scene requests / non-http tabs
This commit is contained in:
parent
995236c6a9
commit
f196d31a2f
|
@ -143,28 +143,26 @@ vAPI.messaging = {
|
|||
};
|
||||
|
||||
return this.channels[channelName];
|
||||
},
|
||||
|
||||
toggleListener: function({type, persisted}) {
|
||||
if ( !vAPI.messaging.connector ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( type === 'pagehide' ) {
|
||||
removeMessageListener();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( persisted ) {
|
||||
addMessageListener(vAPI.messaging.connector);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
var toggleListener = function({type, persisted}) {
|
||||
if ( !vAPI.messaging.connector ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( type === 'pagehide' ) {
|
||||
removeMessageListener();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( persisted ) {
|
||||
addMessageListener(vAPI.messaging.connector);
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('pagehide', toggleListener, true);
|
||||
window.addEventListener('pageshow', toggleListener, true);
|
||||
window.addEventListener('pagehide', vAPI.messaging.toggleListener, true);
|
||||
window.addEventListener('pageshow', vAPI.messaging.toggleListener, true);
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
|
Loading…
Reference in a new issue