mirror of https://github.com/gorhill/uBlock.git
#868: code review
This commit is contained in:
parent
c99b61da96
commit
c5c8edc4d1
|
@ -220,7 +220,7 @@ var contentObserver = {
|
|||
}
|
||||
|
||||
// Important: hard test against `false`.
|
||||
if ( Array.isArray(r) && r.length !== 0 && r[0] === false ) {
|
||||
if ( Array.isArray(r) && r[0] === false ) {
|
||||
return this.REJECT;
|
||||
}
|
||||
|
||||
|
|
|
@ -2161,7 +2161,6 @@ vAPI.net.registerListeners = function() {
|
|||
// requests.
|
||||
var details = e.data;
|
||||
var sourceTabId = null;
|
||||
var mustLoad;
|
||||
|
||||
details.tabId = tabWatcher.tabIdFromTarget(e.target);
|
||||
|
||||
|
@ -2177,8 +2176,10 @@ vAPI.net.registerListeners = function() {
|
|||
// https://github.com/gorhill/uBlock/issues/868
|
||||
// Firefox quirk: for some reasons, there are instances of resources
|
||||
// for `video` tag not being reported to HTTP observers.
|
||||
if ( details.rawtype === 15 ) {
|
||||
mustLoad = shouldLoadMedia(details);
|
||||
// If blocking, do not bother creating a pending request entry, it
|
||||
// won't be used anyway.
|
||||
if ( details.rawtype === 15 && shouldLoadMedia(details) === false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We are being called synchronously from the content process, so we
|
||||
|
@ -2190,8 +2191,6 @@ vAPI.net.registerListeners = function() {
|
|||
pendingReq.rawtype = details.rawtype;
|
||||
pendingReq.sourceTabId = sourceTabId;
|
||||
pendingReq.tabId = details.tabId;
|
||||
|
||||
return mustLoad;
|
||||
};
|
||||
|
||||
vAPI.messaging.globalMessageManager.addMessageListener(
|
||||
|
|
Loading…
Reference in New Issue