|
@ -46,6 +46,7 @@ const {Services} = Cu.import('resource://gre/modules/Services.jsm', null); |
|
|
|
|
|
|
|
|
var vAPI = self.vAPI = self.vAPI || {}; |
|
|
var vAPI = self.vAPI = self.vAPI || {}; |
|
|
vAPI.firefox = true; |
|
|
vAPI.firefox = true; |
|
|
|
|
|
vAPI.firefoxPre35 = Services.vc.compare(Services.appinfo.platformVersion, '35.0') < 0; |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
@ -1883,18 +1884,25 @@ vAPI.net.registerListeners = function() { |
|
|
pendingReq.tabId = tabWatcher.tabIdFromTarget(e.target); |
|
|
pendingReq.tabId = tabWatcher.tabIdFromTarget(e.target); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// https://github.com/gorhill/uMatrix/issues/200
|
|
|
|
|
|
// We need this only for Firefox 34 and less: the tab id is derived from
|
|
|
|
|
|
// the origin of the message.
|
|
|
|
|
|
if ( vAPI.firefoxPre35 ) { |
|
|
vAPI.messaging.globalMessageManager.addMessageListener( |
|
|
vAPI.messaging.globalMessageManager.addMessageListener( |
|
|
shouldLoadListenerMessageName, |
|
|
shouldLoadListenerMessageName, |
|
|
shouldLoadListener |
|
|
shouldLoadListener |
|
|
); |
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
httpObserver.register(); |
|
|
httpObserver.register(); |
|
|
|
|
|
|
|
|
cleanupTasks.push(function() { |
|
|
cleanupTasks.push(function() { |
|
|
|
|
|
if ( vAPI.firefoxPre35 ) { |
|
|
vAPI.messaging.globalMessageManager.removeMessageListener( |
|
|
vAPI.messaging.globalMessageManager.removeMessageListener( |
|
|
shouldLoadListenerMessageName, |
|
|
shouldLoadListenerMessageName, |
|
|
shouldLoadListener |
|
|
shouldLoadListener |
|
|
); |
|
|
); |
|
|
|
|
|
} |
|
|
httpObserver.unregister(); |
|
|
httpObserver.unregister(); |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|